From 95f05f94cf2346e2df90b1620a4d2324faf5c088 Mon Sep 17 00:00:00 2001 From: Rinat Date: Mon, 2 Dec 2024 10:42:39 +0100 Subject: [PATCH] Optimism and base networks verification (#996) --- packages/hardhat/.env.example | 2 +- packages/hardhat/hardhat.config.ts | 30 ++++++++++++++++++++++++++++-- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/packages/hardhat/.env.example b/packages/hardhat/.env.example index a9ccb0860..86614fe5e 100644 --- a/packages/hardhat/.env.example +++ b/packages/hardhat/.env.example @@ -8,4 +8,4 @@ # To access the values stored in this .env file you can use: process.env.VARIABLENAME ALCHEMY_API_KEY= DEPLOYER_PRIVATE_KEY= -ETHERSCAN_API_KEY= +ETHERSCAN_MAINNET_API_KEY= diff --git a/packages/hardhat/hardhat.config.ts b/packages/hardhat/hardhat.config.ts index 7c6e72dfd..9cdbc8be1 100644 --- a/packages/hardhat/hardhat.config.ts +++ b/packages/hardhat/hardhat.config.ts @@ -13,8 +13,10 @@ import "hardhat-deploy-ethers"; // If not set, it uses the hardhat account 0 private key. const deployerPrivateKey = process.env.DEPLOYER_PRIVATE_KEY ?? "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"; -// If not set, it uses ours Etherscan default API key. -const etherscanApiKey = process.env.ETHERSCAN_API_KEY || "DNXJA8RX2Q3VZ4URQIWP7Z68CJXQZSC6AW"; +// If not set, it uses our block explorers default API keys. +const etherscanApiKey = process.env.ETHERSCAN_MAINNET_API_KEY || "DNXJA8RX2Q3VZ4URQIWP7Z68CJXQZSC6AW"; +const etherscanOptimisticApiKey = process.env.ETHERSCAN_OPTIMISTIC_API_KEY || "RM62RDISS1RH448ZY379NX625ASG1N633R"; +const basescanApiKey = process.env.BASESCAN_API_KEY || "ZZZEIPMT1MNJ8526VV2Y744CA7TNZR64G6"; // If not set, it uses ours Alchemy's default API key. // You can get your own at https://dashboard.alchemyapi.io @@ -70,10 +72,22 @@ const config: HardhatUserConfig = { optimism: { url: `https://opt-mainnet.g.alchemy.com/v2/${providerApiKey}`, accounts: [deployerPrivateKey], + verify: { + etherscan: { + apiUrl: "https://api-optimistic.etherscan.io", + apiKey: etherscanOptimisticApiKey, + }, + }, }, optimismSepolia: { url: `https://opt-sepolia.g.alchemy.com/v2/${providerApiKey}`, accounts: [deployerPrivateKey], + verify: { + etherscan: { + apiUrl: "https://api-sepolia-optimistic.etherscan.io", + apiKey: etherscanOptimisticApiKey, + }, + }, }, polygon: { url: `https://polygon-mainnet.g.alchemy.com/v2/${providerApiKey}`, @@ -102,10 +116,22 @@ const config: HardhatUserConfig = { base: { url: "https://mainnet.base.org", accounts: [deployerPrivateKey], + verify: { + etherscan: { + apiUrl: "https://api.basescan.org", + apiKey: basescanApiKey, + }, + }, }, baseSepolia: { url: "https://sepolia.base.org", accounts: [deployerPrivateKey], + verify: { + etherscan: { + apiUrl: "https://api-sepolia.basescan.org", + apiKey: basescanApiKey, + }, + }, }, scrollSepolia: { url: "https://sepolia-rpc.scroll.io",