Closed zapaz closed 2 years ago
As ETHERSCAN_API_KEY may differ from one network to another, put an etherscan option in network config, with highest priority than generic config
hardhat.config.ts may look like this :
... networks : { mainnet: { chainId: 1, url: `https://eth-mainnet.alchemyapi.io/v2/${process.env.ALCHEMY_API_KEY}`, accounts }, rinkeby: { chainId: 4, url: `https://eth-rinkeby.alchemyapi.io/v2/${process.env.ALCHEMY_API_KEY}`, accounts }, matic: { chainId: 137, url: `https://polygon-mainnet.infura.io/v3/${process.env.INFURA_API_KEY}`, etherscan: { apiKey: process.env.ETHERSCAN_API_KEY_POLYGON }, accounts }, avalanche: { chainId: 43114, url: "https://api.avax.network/ext/bc/C/rpc", etherscan: { apiKey: process.env.ETHERSCAN_API_KEY_AVALANCHE }, accounts }, } etherscan: { apiKey: process.env.ETHERSCAN_API_KEY_ETHEREUM } ...
Follow up of #98
Thanks @zapaz !
added in hardhat-deploy 0.9.18
As ETHERSCAN_API_KEY may differ from one network to another, put an etherscan option in network config, with highest priority than generic config
hardhat.config.ts may look like this :