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

Conversation

fedgiac
Copy link
Contributor

@fedgiac fedgiac commented May 9, 2025

Description

Add the necessary configuration lines for allowing contract verification on the Block explorers of the networks introduced in #239.
BNB was already verified. Optimism and Polygon just worked out of the box. Avalanche defaults to Snowtrace, so I had to include a custom configuration for that network in order to use SnowScan and used:

npx hardhat verify --network avalanche 0x9E7Ae8Bdba9AA346739792d219a808884996Db67
npx hardhat verify --network avalanche 0x9008D19f58AAbD9eD0D60971565AA8510560ab41 0x2c4c28DDBdAc9C5E7055b4C863b72eA0149D8aFE 0xBA12222222228d8Ba445958a75a0704d566BF2C8

I also enabled Sourcify because why not?

Test Plan

Check out the contract addresses on the block explorer.

@fedgiac fedgiac requested a review from m-lord-renkse May 9, 2025 13:56
@fedgiac fedgiac requested a review from a team as a code owner May 9, 2025 13:56
@fedgiac fedgiac mentioned this pull request May 9, 2025
@kuzdogan
Copy link

kuzdogan commented May 9, 2025

I also enabled Sourcify because why not?

🫡

@fedgiac
Copy link
Contributor Author

fedgiac commented May 9, 2025

@kuzdogan Etherscan verification is always, constantly painful to obtain for one reason or another but Sourcify in the last (at least) year has been a breeze to use, never had any issue when I needed to verify a contract, and all this useful contract data is easily and transparently available. Great job and thanks for the service!

etherscan: {
apiKey: {
sepolia: ETHERSCAN_API_KEY,
arbitrumOne: ETHERSCAN_API_KEY,
base: ETHERSCAN_API_KEY,
optimisticEthereum: ETHERSCAN_API_KEY,
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.

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.

@m-lord-renkse m-lord-renkse force-pushed the support-multiple-networks branch from bc6649b to c6bac3f Compare May 12, 2025 12:09
Base automatically changed from support-multiple-networks to main May 12, 2025 12:48
@fedgiac fedgiac merged commit 08f8627 into main May 12, 2025
5 checks passed
@fedgiac fedgiac deleted the updated-block-explorer-configs-for-new-networks branch May 12, 2025 14:29
@github-actions github-actions bot locked and limited conversation to collaborators May 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants