Error: ERROR processing /home/surajsahoo/hh-fcc/hardhat-fund-me-fcc/deploy/01-deploy-fund-me.js:
TypeError: Cannot read properties of undefined (reading '5')
at Object.module.exports [as func] (/home/surajsahoo/hh-fcc/hardhat-fund-me-fcc/deploy/01-deploy-fund-me.js:27:47)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at DeploymentsManager.executeDeployScripts (/home/surajsahoo/hh-fcc/hardhat-fund-me-fcc/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1219:22)
at DeploymentsManager.runDeploy (/home/surajsahoo/hh-fcc/hardhat-fund-me-fcc/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1052:5)
at SimpleTaskDefinition.action (/home/surajsahoo/hh-fcc/hardhat-fund-me-fcc/node_modules/hardhat-deploy/src/index.ts:438:5)
at Environment._runTaskDefinition (/home/surajsahoo/hh-fcc/hardhat-fund-me-fcc/node_modules/hardhat/src/internal/core/runtime-environment.ts:308:14)
at Environment.run (/home/surajsahoo/hh-fcc/hardhat-fund-me-fcc/node_modules/hardhat/src/internal/core/runtime-environment.ts:156:14)
at SimpleTaskDefinition.action (/home/surajsahoo/hh-fcc/hardhat-fund-me-fcc/node_modules/hardhat-deploy/src/index.ts:584:32)
at Environment._runTaskDefinition (/home/surajsahoo/hh-fcc/hardhat-fund-me-fcc/node_modules/hardhat/src/internal/core/runtime-environment.ts:308:14)
at Environment.run (/home/surajsahoo/hh-fcc/hardhat-fund-me-fcc/node_modules/hardhat/src/internal/core/runtime-environment.ts:156:14)
at DeploymentsManager.executeDeployScripts (/home/surajsahoo/hh-fcc/hardhat-fund-me-fcc/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1222:19)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at DeploymentsManager.runDeploy (/home/surajsahoo/hh-fcc/hardhat-fund-me-fcc/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1052:5)
at SimpleTaskDefinition.action (/home/surajsahoo/hh-fcc/hardhat-fund-me-fcc/node_modules/hardhat-deploy/src/index.ts:438:5)
at Environment._runTaskDefinition (/home/surajsahoo/hh-fcc/hardhat-fund-me-fcc/node_modules/hardhat/src/internal/core/runtime-environment.ts:308:14)
at Environment.run (/home/surajsahoo/hh-fcc/hardhat-fund-me-fcc/node_modules/hardhat/src/internal/core/runtime-environment.ts:156:14)
at SimpleTaskDefinition.action (/home/surajsahoo/hh-fcc/hardhat-fund-me-fcc/node_modules/hardhat-deploy/src/index.ts:584:32)
at Environment._runTaskDefinition (/home/surajsahoo/hh-fcc/hardhat-fund-me-fcc/node_modules/hardhat/src/internal/core/runtime-environment.ts:308:14)
at Environment.run (/home/surajsahoo/hh-fcc/hardhat-fund-me-fcc/node_modules/hardhat/src/internal/core/runtime-environment.ts:156:14)
at SimpleTaskDefinition.action (/home/surajsahoo/hh-fcc/hardhat-fund-me-fcc/node_modules/hardhat-deploy/src/index.ts:669:5)
error Command failed with exit code 1.
Above mentioned error is coming while deploying. Below provided is the js file 01-deploy-fund-me.js
const { networkConfig } = require("../helper-hardhat-config")
const { network } = require("hardhat")
const { verify } = require("../utils/verify")
module.exports = async ({ getNamedAccounts, deployments }) => {
const { deploy, log } = deployments
const { deployer } = await getNamedAccounts()
const chainId = network.config.chainId
//const ethUsdPriceFeedAddress = networkConfig[chainId]["ethusdpricefeed"]
let ethUsdPriceFeedAddress
if (chainId == "31337") {
const ethUsdAggregator = await deployments.get("MockV3Aggregator")
ethUsdPriceFeedAddress = ethUsdAggregator.address
} else {
ethUsdPriceFeedAddress = networkConfig[chainId]["ethusdpricefeed"]
}
const fundMe = await deploy("FundMe", {
from: deployer,
args: [ethUsdPriceFeedAddress], //put price feed address
log: true,
waitConfirmations: network.config.blockConfirmations || 1,
})
// if (!developmentChains.includes(network.name)) {
// await verify(fundMe.address, [ethUsdPriceFeedAddress])
// }
}
module.exports.tags = ["all", "fundme"]
Below mentioned is the helper-hardhat-config file
const networkConfig = {
31337: {
name: "localhost",
},
5: {
name: "goerli",
ethusdpricefeed: "0xD4a33860578De61DBAbDc8BFdb98FD742fA7028e",
},
}
const developmentChain = ["hardhat", "localhost"]
module.export = {
networkConfig,
developmentChain,
}
helper-hardhat-config
file?