Skip to content

Add Etherscan configuration for new networks #240

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 12, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,17 @@ export default {
currency: "USD",
gasPrice: 21,
},
sourcify: {
enabled: true,
},
etherscan: {
apiKey: {
sepolia: ETHERSCAN_API_KEY,
arbitrumOne: ETHERSCAN_API_KEY,
base: ETHERSCAN_API_KEY,
optimisticEthereum: ETHERSCAN_API_KEY,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought for now avalanche and polygon

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#239 also deployed the other two, so I verified those as well.

polygon: ETHERSCAN_API_KEY,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did this work for you using the same key as other chains??
I tried deploying today with Etherscan API Key (on another project) and it didn't work.
I created a new key specifically for polygonscan.com and then it did.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, you need to create an API key per block explorer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is luckily going to change soon, see foundry-rs/foundry#9196.

avalanche: ETHERSCAN_API_KEY,
},
customChains: [
{
Expand All @@ -202,6 +208,14 @@ export default {
browserURL: "https://basescan.org",
},
},
{
network: "avalanche",
chainId: 43114,
urls: {
apiURL: "https://api.snowscan.xyz/api",
browserURL: "https://snowscan.xyz",
},
},
],
},
};
Loading