Closed Nitro-lens closed 2 years ago
So I am at moment 10:48:00 in the tutorial, and it returns me this:
An unexpected error occurred: Error: ERROR processing C:\Users\Pc\hardhat-fund-me-fcc\deploy\00-deploy-mocks.js: TypeError: Cannot read properties of undefined (reading 'length')
error when I try to run: yarn hardhat deploy --tags mocks
yarn hardhat deploy --tags mocks
I manually copied all the code from the tutorial in my Visual Studio and I think I got all the steps right. Here's my code:
const {network} = require("hardhat") const {developmentChains, DECIMALS, INITIAL_ANSWER} = require("../helper-hardhat-config") const chainId = network.config.chainId module.exports = async({getNamedAccounts,deployments})=>{ const {deploy,log} = deployments const {deployer} = await getNamedAccounts() if(developmentChains.includes(network.name)){ log("Local Network detected! Deploying mocks...") await deploy("MockV3Aggregator", { contract: "MockV3Aggregator", from: deployer, log:true, args: [DECIMALS, INITIAL_ANSWER], }) log("Mocks deployed!") log("-----------------------") } } module.exports.tags = ["all","mocks"]
const networkConfig = { 4: { name: "rinkeyby", ethUsdPriceFeed: "0x8A753747A1Fa494EC906cE90E9f37563A8AF630e" }, 137: { name:"polygon", ethUsdPriceFeed:"0xF9680D99D6C9589e2a93a78A04A279e509205945", }, //31337 } const developmentChains = ["hardhat", "localhost"] const DECIMALS = 8 const INITIAL_ANSWER = 200000000000 module.exports = { networkConfig, developmentChains, DECIMALS, INITIAL_ANSWER, }
What am I missing? It goes beyond the first if verification so I assume it has something to do with what's beyond deploy("MockV3Aggregator",
if
deploy("MockV3Aggregator",
It was solved by this: https://github.com/PatrickAlphaC/hardhat-fund-me-fcc/issues/28
THANKS A LOT! 🥂 I didn't read it
Nice!
So I am at moment 10:48:00 in the tutorial, and it returns me this:
error when I try to run:
yarn hardhat deploy --tags mocks
I manually copied all the code from the tutorial in my Visual Studio and I think I got all the steps right. Here's my code:
00-deploy-mocks.js
helper-hardhat-config.js
What am I missing? It goes beyond the first
if
verification so I assume it has something to do with what's beyonddeploy("MockV3Aggregator",