Hardhat-Fund-Me: Error: invalid address on rinkeby #49
-
I've been trying to deploy the contract to rinkeby testnet, but getting an error on the The Error -
I understand this has something to do with my fundMe function. So here's the deploy sciprt - const { getNamedAccounts, deployments, network } = require('hardhat');
const {
networkConfig,
developmentChains,
} = require('../helper-hardhat-config');
const { verify } = require('../utils/verify');
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
let ethUsdPriceFeedAddress;
if (chainId == 31337) {
const ethUsdAggregator = await deployments.get('MockV3Aggregator');
ethUsdPriceFeedAddress = ethUsdAggregator.address;
} else {
ethUsdPriceFeed = networkConfig[chainId]['ethUsdPriceFeed'];
}
// If the contract doesn't exist, deploy a minimal version of
// for the local testing
log('----------------------------------------------------');
log('Deploying FundMe and waiting for confirmations...');
const fundMe = await deploy('FundMe', {
from: deployer,
args: [ethUsdPriceFeedAddress],
log: true,
// we need to wait if on a live network so we can verify properly
waitConfirmations: network.config.blockConfirmations || 1,
});
log(`FundMe deployed at ${fundMe.address}`);
if (
!developmentChains.includes(network.name) &&
process.env.ETHERSCAN_API_KEY
) {
// verify
await verify(fundMe.address, [ethUsdPriceFeedAddress]);
}
log('----------------------------------------');
};
module.exports.tags = ['all', 'fundme ']; I have checked my
And here's the
Was wondering if anyone has faced the same issue. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 19 replies
-
@PatrickAlphaC any input will be really helpful 🙏🏻 |
Beta Was this translation helpful? Give feedback.
-
SummaryYou're getting an invalid address! You can see in the error right at the top of the error:
For anyone getting this issue, it means that you have an invalid address somewhere, try figuring out which address is wrong! In this specific caseThis is saying your You could either be:
You have to put the real price feed address in there for rinkeby! You can find them here The address is 0x8A753747A1Fa494EC906cE90E9f37563A8AF630e. |
Beta Was this translation helpful? Give feedback.
-
@othaime-en It worked. Successfully verified contract FundMe on Etherscan.
https://rinkeby.etherscan.io/address/0x8730397C519e2Af95fA1a837d98243C262Dc1f79#code
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
Beta Was this translation helpful? Give feedback.
Summary
You're getting an invalid address! You can see in the error right at the top of the error:
For anyone getting this issue, it means that you have an invalid address somewhere, try figuring out which address is wrong!
In this specific case
This is saying your
priceFeedAddress
is wrong.You could either be:
networkConfig
from the wrong location