-
I have got this wierd error while deploying mocks deploy-Mock.js const { network } = require("hardhat");
const {
developmentChains,
INITIAL_ANSWER,
DECIMALS,
} = require("../helper-hardhat-config");
module.exports = async ({ getNamedAccounts, deployments }) => {
const { deploy, log } = deployments;
const { deployer } = await getNamedAccounts();
if (developmentChains.includes(network.name)) {
log("Local network detected! Deploying Mocks...");
const deployed = await deploy("MockV3Aggregator", {
contract: "MockV3Aggregator",
from: deployer,
log: true,
args: [DECIMALS, INITIAL_ANSWER],
});
log("Mocks Deployed");
log("________________________________________");
}
};
module.exports.tags = ["all", "mocks"]; helper-hardhat-config.js const networkConfig = {
4: {
name: "rinkby",
ethUsdPriceFeed: 0x8a753747a1fa494ec906ce90e9f37563a8af630e,
},
137: {
name: "polygon",
ethUsdPriceFeed: 0xf9680d99d6c9589e2a93a78a04a279e509205945,
},
};
const developmentChains = ["hardhat", "localhost"];
const DECIMALS = 8;
const INITIAL_ANSWER = 200000000000;
module.exports = {
networkConfig,
developmentChains,
DECIMALS,
INITIAL_ANSWER,
}; ERROR SCREENSHOT |
Beta Was this translation helpful? Give feedback.
Answered by
krakxn
Jul 13, 2022
Replies: 2 comments 2 replies
-
namedAccounts: {
deployer: {
default: 0, // here this will by default take the first account as deployer
1: 0, // similarly on mainnet it will take the first account as deployer. Note though that depending on how hardhat network are configured, the account 0 on one network can be different than on another
},
31337: {
name: "localhost",
},
Hope this solves your problem :D |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
alymurtazamemon
-
@ritesh798 show your hardhat config file. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
rinkeby
: