-
Hi guys, I have been stuck on this problem for two days now, I have read similar questions in this discussion but haven't found the solution. I want to deploy my FundMe contracts using 01-deploy-fund-me.js script, however I get this error:
const { networkConfig, developmentChains } = require("../helper-hardhat-config")
const { network } = require("hardhat")
//
module.exports = async ({ getNamedAccounts, deployments }) => {
const { deploy, log } = deployments
const { deployer } = await getNamedAccounts()
const chainId = network.config.chainId
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,
})
log(
"----------------------------------------------------------------------------------"
)
}
module.exports.tags = ["all", "fundme"] Here is the script for helper-hardhat-config.js: const networkConfig = {
5: {
name: "goerli",
ethUsdPriceFeed: "0xD4a33860578De61DBAbDc8BFdb98FD742fA7028e",
},
// 31337?
}
const developmentChains = ["hardhat", "localhost"]
const DECIMALS = 8
const INITIAL_ANSWER = 200000000000
module.exports = {
networkConfig,
developmentChains,
DECIMALS,
INITIAL_ANSWER,
} |
Beta Was this translation helpful? Give feedback.
Answered by
mattjaf
Jan 22, 2023
Replies: 1 comment 2 replies
-
Console log the address, check if it's undefined |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
enless-c
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Console log the address, check if it's undefined