diff --git a/.env.sample b/.env.sample index fe58744..2cde305 100644 --- a/.env.sample +++ b/.env.sample @@ -1,2 +1,3 @@ RPC_URL="https://mainnet.infura.io/v3/some-key" PRIVATE_KEY="super-secret-key" +ETHERSCAN_API_KEY="etherscan-api-key" diff --git a/README.md b/README.md index ad0c4e7..59e9eb9 100644 --- a/README.md +++ b/README.md @@ -16,11 +16,11 @@ Test: `npx hardhat test` ### Mainnet -First configure the .env file with valid RPC_URL and PRIVATE_KEY values. +First configure the .env file with valid `RPC_URL`, `PRIVATE_KEY` and `ETHERSCAN_API_KEY` values. Visualize the deployment plan: `npx hardhat ignition visualize ignition/modules/StakingRewards.ts --network mainnet` -Deploy the contract: `npx hardhat ignition deploy ignition/modules/StakingRewards.ts --network mainnet` +Deploy and verify the contract: `npx hardhat ignition deploy ignition/modules/StakingRewards.ts --network mainnet --verify` ### Local diff --git a/hardhat.config.ts b/hardhat.config.ts index b4cbad6..48b4c8a 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -29,6 +29,18 @@ const config: HardhatUserConfig = { }, ], }, + // Etherscan configuration for mainnet deployment verification + // Optional so we can still test locally without setting up etherscan + ...(process.env.ETHERSCAN_API_KEY + ? { + etherscan: { + apiKey: process.env.ETHERSCAN_API_KEY, + }, + } + : {}), + sourcify: { + enabled: true, + }, }; export default config;