ReferenceError: deploy is not defined #4952
Answered
by
pacelliv
jeevansiddu
asked this question in
Q&A
-
This is my deploy scripts const { network } = require("hardhat");
const { developmentChains } = require("../helper-hardhat-config");
const { DECIMALS, INITIAL_ANSWER } = require("../helper-hardhat-config");
module.exports = async hre => {
const { getNamedAccounts, deployments } = hre;
const { deployer } = await getNamedAccounts();
const chainId = network.config.chainId;
// const priceFeedadd = networkConfig[chainId]["ethUsdPriceFeed"];
if (developmentChains.includes(network.name)) {
console.log("Deploying in mock");
await deploy("MockV3Aggregator.sol", {
from: deployer,
args: [DECIMALS, INITIAL_ANSWER],
log: true
});
console.log("DEPLOYED!");
console.log("--------------------------");
}
};
module.exports.tags = ["all", "mocks"];
And this is the error im getting trying to solve it but i cant
can you please provide me with a solution |
Beta Was this translation helpful? Give feedback.
Answered by
pacelliv
Feb 26, 2023
Replies: 1 comment 2 replies
-
Hello @jeevansiddu, you extracted from the const { getNamedAccounts, deployments } = hre;
const { deploy } = deployments
const { deployer } = await getNamedAccounts(); |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
alymurtazamemon
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello @jeevansiddu, you extracted from the
hre
thegetNamedAccounts
anddeployments
fields. Now you need to extract from thedeployments
fied thedeploy
function: