From d87dd9583f97996c3619a678c2d1a9f8027cfcec Mon Sep 17 00:00:00 2001 From: wojciech-turek Date: Fri, 6 Oct 2023 10:06:12 +0200 Subject: [PATCH] Update hardhat config to get etherscan api key --- packages/deploy/utils/hardhatConfig.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/deploy/utils/hardhatConfig.ts b/packages/deploy/utils/hardhatConfig.ts index af75d33a08..ced0b7a7b9 100644 --- a/packages/deploy/utils/hardhatConfig.ts +++ b/packages/deploy/utils/hardhatConfig.ts @@ -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 { @@ -52,6 +56,11 @@ export function addNodeAndMnemonic( accounts: { mnemonic: getMnemonic(k), }, + verify: { + etherscan: { + apiKey: getVerifyApiKey(k), + }, + }, }; } return networks;