Lesson 7 npx hardhat deploy --tags mocks returns Nothing to compile #591
-
Hi everyone, i am trying to deploy mocks with mock tag but it returns nothing to compile, if i delete the cache and artifacts folders everything compile successfully but no mock deployment logs such as local network detected etc. below is the code i am working on thanks your helping hands. 00-deploy-mocks.js const {
network
} = require("hardhat")
const {
deploymentChains,
DECIMALS,
INITIAL_ANSWER
} = require("../helper-hardhat-config")
module.exports = async ({
getNamedAccounts,
deployments
}) => {
const { // deploy and log from deployments
deploy,
log
} = deployments
const { // get the deployer from getNamedAccounts / accounts
deployer
} = await getNamedAccounts()
if (deploymentChains.includes(network.name)) {
log("Local network detected! deploying mocks...")
await deploy("MockV3Aggregator", {
contract: "MockV3Aggrigator",
from: deployer,
log: true,
args: [DECIMALS, INITIAL_ANSWER]
})
log("Mocks deployed successfully!")
log("__________________________________")
}
}
module.exports.tags = ["all", "mocks"] helper-hardhat-config.js const networkConfig = {
4: {
name: "rinkeby",
ethUsdPriceFeed: "0x8A753747A1Fa494EC906cE90E9f37563A8AF630e"
},
137: {
name: "polygon",
ethUsdPriceFeed: "0xF9680D99D6C9589e2a93a78A04A279e509205945",
},
}
const developmentChains = ["hardhat", "localhost"]
const DECIMALS = 8
const INITIAL_ANSWER = 200000000000
export default {
networkConfig,
developmentChains,
DECIMALS,
INITIAL_ANSWER
} |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 9 replies
-
There are three problems in your code
but you use it as { deploymentChains } in your 00-deploy-mocks.js
and there
check your code again
hope this can help you! good luck. |
Beta Was this translation helpful? Give feedback.
-
i dont what happened actually i have deleted everything copied from the repo but i still dont get response and no errors. thanks for your time. |
Beta Was this translation helpful? Give feedback.
-
Hi, did you guys fixed that? I am having the same issue. when I do It would be amazing if someone could help us with that. |
Beta Was this translation helpful? Give feedback.
There are three problems in your code
but you use it as { deploymentChains } in your 00-deploy-mocks.js
and there