Lesson 7 error
#5746
-
00-deploy-Mock.jsconst network = require("hardhat");
const {Decimals, InitialAnswer} = require("../helper-hardhat-config");
module.exports = async ({getNamedAccounts, deployments}) => {
const {deploy, log} = deployments;
const {deployer} = await getNamedAccounts();
chainId = await network.getChainId();
log(chainId);
if (chainId === "31337") {
log("Local network detected, Deploying mock...");
await deploy("MockV3Aggregator", {
contract: "MockV3Aggregator",
from: deployer,
log: true,
args: [Decimals, InitialAnswer],
});
log("Mock Deployed!.");
log("----------------------------------------");
}
};
//For us to to run only our deploy scripts we can add these lines of code.
module.exports.tags = ["all", "mock"]; package.json{
"devDependencies": {
"@chainlink/contracts": "^0.6.1",
"@nomicfoundation/hardhat-chai-matchers": "^2.0.0",
"@nomicfoundation/hardhat-ethers": "npm:hardhat-deploy-ethers",
"@nomicfoundation/hardhat-network-helpers": "^1.0.0",
"@nomicfoundation/hardhat-toolbox": "^3.0.0",
"@nomicfoundation/hardhat-verify": "^1.0.0",
"@typechain/ethers-v6": "^0.4.0",
"@typechain/hardhat": "^8.0.0",
"chai": "^4.2.0",
"dotenv": "^16.3.1",
"ethers": "^6.6.0",
"hardhat": "^2.15.0",
"hardhat-deploy": "^0.11.31",
"hardhat-gas-reporter": "^1.0.8",
"solidity-coverage": "^0.8.0",
"typechain": "^8.1.0"
}
} When i try to deploy my mocks or fundme script, it results in this error code. |
Beta Was this translation helpful? Give feedback.
Answered by
Mr-Saade
Jun 26, 2023
Replies: 1 comment
-
Sorry, I just realized there was an issue with my verify.js script, thanks. Fixed. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Mr-Saade
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sorry, I just realized there was an issue with my verify.js script, thanks. Fixed.