-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Right now we do a bit of magic in the verify task:
const network = networks[chainId.toString()]
let etherscanNetworkName
switch (Number(chainId)) {
case 1:
etherscanNetworkName = 'mainnet'
break
case 42161:
etherscanNetworkName = 'arbitrum'
break
default:
etherscanNetworkName = network.name.toLowerCase()
}
if (!config.etherscan.apiKey[etherscanNetworkName]) {
console.error(
`No Etherscan API key found for '${etherscanNetworkName}'. Please add one to hardhat.config.ts`
)
return
}
and we have to configure etherscan keys in the hardhat config. It would be much better to do that as an etherscan
key in each network's config file like this:
etherscan: {
apiKey: '',
customChains: {
//..
}
}
(of course we would only use customChains
if needed.
Metadata
Metadata
Assignees
Labels
No labels