Closed asmar10 closed 2 years ago
I am not sure about this solution. But instead of this if (devChains.includes(network.name))
can you try this. For this don't for to import network at top const { network } = require("hardhat")
const chainId = network.config.chainId
if (chainId == 31337)
still error
Copy-paste the following code precisely and only replace names of files/paths/variables with what you are using already (as they are my convention):
const { network } = require("hardhat")
const {
developmentChains,
DECIMALS,
INITIAL_ANSWER,
} = require("../helper-hardhat-config")
module.exports = async ({ getNamedAccounts, deployments }) => {
const { deploy, log } = deployments
const { deployer } = await getNamedAccounts()
const chainId = network.config.chainId
// we need to edploy mocks if we are on a local network
if (chainId == 31337) {
log("Local network detected! Deploying mocks...")
await deploy("MockV3Aggregator", {
contract: "MockV3Aggregator", // to be really specific
from: deployer,
log: true,
args: [DECIMALS, INITIAL_ANSWER],
})
log("Mocks deployed!")
log("---------------------------------------------------------------")
}
}
module.exports.tags = ["all", "mocks"]
Let me know if this helps!
Still the same :( i think ill just start from scratch again
Still the same :( i think ill just start from scratch again
Try this in hardhat config:
namedAccounts: {
deployer: {
default: 0,
},
users: {
default: 0,
},
},
Still the same :( i think ill just start from scratch again
Try this in hardhat config:
namedAccounts: { deployer: { default: 0, }, users: { default: 0, }, },
THIS WORKED!! THANKS ALOTT
Still the same :( i think ill just start from scratch again
Try this in hardhat config:
namedAccounts: { deployer: { default: 0, }, users: { default: 0, }, },
THIS WORKED!! THANKS ALOTT
You're welcome! Goodluck with the course!!
Hi, im getting this error when i run "yarn hardhat deploy"
this is seems to be in the "00-deploy-mocks.js" file.
Kindly help its been hours!
here's my code:
PS: i have already added this in my hardhat-config.js file