-
Hi guys, I am @10.52, I am trying to run
Here is my 01-deploy-fund-me.js code / import
// main function
// calling of main function
//function deployFunc() {
// console.log("Hi!")
// }
// module.exports.default = deployFunc
const { getNamedAccounts, deployments, network } = require("hardhat")
const { networkConfig, developmentChains } = require("../helper-hardhat-config")
module.exports = async ({ getNamedAccounts, deployments }) => {
const { deploy, log } = deployments
const { deployer } = await getNamedAccounts()
const chainId = network.config.chainId
//if chainID is X use address Y
// if the contract doesn't exist, we deploya mininmal version
// for our local testing
let ethUsdPriceFeedAddress
if (developmentChains.includes(network.name)) {
const ethUsdAggregator = await deployments.get("MockV3Aggregator")
ethUsdPriceFeedAddress = ethUsdAggregator.address
} else {
ethUsdPriceFeedAddress = networkConfig[chainId]["ethUsdPriceFeed"]
}
//whengoing for localhost or hardhat network we want to use a mock
const fundMe = await deploy("FundMe", {
from: deployer,
arg: [ethUsdPriceFeedAddress],
log: true,
})
log("--------------------------------------")
}
module.exports.tags = ["all", "fundme"] Here is my helper-hardhat config.js const networkConfig = {
4: {
name: "rinkeby",
ethUSDpriceFeed: "0x8A753747A1Fa494EC906cE90E9f37563A8AF630e",
},
137: {
name: "polygon",
ethUSDpriceFeed: " 0xF9680D99D6C9589e2a93a78A04A279e509205945",
},
}
const developmentChains = ["hardhat", "localhost"]
const DECIMALS = 8
const INITIAL_ANSWER = 200000000000
module.exports = {
networkConfig,
developmentChains,
DECIMALS,
INITIAL_ANSWER,
} In 01 I tried Would much appreciate for a help. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
The following changes should fix your problem. Cheers
Also, in helper-hardhat-config, you should follow camel case. Problem lies in
In deploy-fund-me, edit
|
Beta Was this translation helpful? Give feedback.
The following changes should fix your problem. Cheers
yarn hardhat deply
should bedeploy
and for deploy-fund-me done by running seperately for local networks and testnets via--network xyz
/ import
should be commented outAlso, in helper-hardhat-config, you should follow camel case. Problem lies in
e…