Contract Verification Doesn't Run #2493
Answered
by
RoboCrypter
blaynejosh
asked this question in
Q&A
-
Hey, I am not sure this is an error, however, when I deploy my deploy script, the verification doesn't run but the contract gets deployed and I can view it on the goerli.etherscan.io Here's the code: const { networkConfig, developmentChains } = 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
let ethUsdPriceFeedAddress
if (developmentChains.includes(network.name)) {
const ethUsdAggregator = await deployments.get("MockV3Aggregator")
ethUsdPriceFeedAddress = ethUsdAggregator.address
} else {
ethUsdPriceFeedAddress = networkConfig[chainId]["ethUsdPriceFeed"]
}
// const ethUsdPriceFeedAddress = networkConfig[chainId]["ethUsdPriceFeed"]
// what happens when we want to change chains?
// when going for localhost or hardhat network we want to use a mock
const args = [ethUsdPriceFeedAddress]
const fundMe = await deploy("FundMe", {
from: deployer,
args: args,
log: true,
waitConfirmations: network.config.blockConfirmations || 1,
})
if (
!developmentChains.includes(network.name) &&
process.env.EYHERSCAN_API_KEY
) {
await verify(fundMe.address, args)
}
log(
"-------------------------------------------------------------------------------",
log(`FundMe deployed at: ${fundMe.address}`)
)
}
module.exports.tags = ["all", "fundme"] |
Beta Was this translation helpful? Give feedback.
Answered by
RoboCrypter
Sep 10, 2022
Replies: 1 comment 1 reply
-
@blaynejosh : Correct this line, I'm listing below: From this : To this : You spelled ETHERSCAN wrong! If it works!, mark the answer as answered. ThankYou |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
blaynejosh
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@blaynejosh : Correct this line, I'm listing below:
From this :
process.env.EYHERSCAN_API_KEY
To this :
process.env.ETHERSCAN_API_KEY
You spelled ETHERSCAN wrong!
If it works!, mark the answer as answered. ThankYou