Skip to content

Commit

Permalink
Update hardhat config to get etherscan api key
Browse files Browse the repository at this point in the history
  • Loading branch information
wojciech-turek committed Oct 6, 2023
1 parent b3aaf23 commit d87dd95
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/deploy/utils/hardhatConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ export function getMnemonic(networkName?: string): string {
return mnemonic;
}

export function getVerifyApiKey(networkName?: string): string {
return process.env[`ETHERSCAN_API_KEY_${networkName?.toUpperCase()}`] || '';
}

export function addNodeAndMnemonic(
networks: NetworksUserConfig
): NetworksUserConfig {
Expand All @@ -52,6 +56,11 @@ export function addNodeAndMnemonic(
accounts: {
mnemonic: getMnemonic(k),
},
verify: {
etherscan: {
apiKey: getVerifyApiKey(k),
},
},
};
}
return networks;
Expand Down

0 comments on commit d87dd95

Please sign in to comment.