Lesson 6: Control not entering verify function #455
-
Hey everyone! Thanks for being such a supportive community! I am in Lesson 6, and I tried to run my Hardhat Simple Storage, which is running, but skipping over one key element - auto verification. console.log("Deploying Contract...")
const simpleStorage = await SimpleStorageFactory.deploy()
await simpleStorage.deployed()
console.log(`Deployed contract to: ${simpleStorage.address}`)
if (network.config.chainId === 4 || process.env.ETHERSCAN_API_KEY) {
console.log("awaiting block confirmations...")
await simpleStorage.deployTransaction.wait(6)
await verify(simpleStorage.address, [])
} This is working, output:
The following is the output when I use Patrick's code:
This is my hardhat.config.js: require("@nomiclabs/hardhat-waffle")
require("dotenv").config()
require("@nomiclabs/hardhat-etherscan")
task("accounts", "Prints the list of accounts", async (taskArgs, hre) => {
const accounts = await hre.ethers.getSigners()
for (const account of accounts) {
console.log(account.address)
}
})
const RINKEBY_RPC_URL = process.env.RINKEBY_RPC_URL
const PRIVATE_KEY = process.env.PRIVATE_KEY
const ETHERSCAN_API_KEY = process.env.ETHERSCAN_API_KEY
module.exports = {
defaultNetwork: "hardhat",
networks: {
rinkeby: {
url: RINKEBY_RPC_URL,
accounts: [PRIVATE_KEY],
chainID: 4,
},
},
solidity: "0.8.8",
etherscan: {
apiKey: ETHERSCAN_API_KEY,
},
} What is happening here? I feel like I'm missing something very small. Thank you for your time! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
@rayb0y which one is your output please clarify, it is not clear. You are showing the output, but the first output is correct, I do not know which one is your output. |
Beta Was this translation helpful? Give feedback.
@rayb0y which one is your output please clarify, it is not clear. You are showing the output, but the first output is correct, I do not know which one is your output.