fix: correct etherscan and sourcify verification commands#477
Open
jonaprieto wants to merge 1 commit intomainfrom
Open
fix: correct etherscan and sourcify verification commands#477jonaprieto wants to merge 1 commit intomainfrom
jonaprieto wants to merge 1 commit intomainfrom
Conversation
Strip `ETHERSCAN_API_KEY` from the sourcify recipe's environment so that `forge verify-contract --verifier sourcify` is not silently rerouted to Etherscan. Add an `[etherscan]` section to `foundry.toml` with explicit per-chain config so forge can resolve explorer URLs on L2 chains. Update the README verification section to document both providers and add `ETHERSCAN_API_KEY` to `.env-example`. Upstream Foundry issues: #6192, #7466, #7699. Closes #472
851fab2 to
8b12c69
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Work-in-progress investigation.
Closes #472
When
ETHERSCAN_API_KEYis set,forge verify-contract --verifier sourcifysilently reroutes to Etherscan because forge auto-populates the-eflag from the env var. Additionally, without an[etherscan]section infoundry.toml, forge may fail to resolve the correct explorer URL for L2 chains.Changes:
ETHERSCAN_API_KEYfrom thecontracts-verify-sourcifyrecipe environment viaenv -uso forge respects--verifier sourcify[etherscan]section tocontracts/foundry.tomlwith per-chain API key config (a single Etherscan V2 key works across all chains)ETHERSCAN_API_KEYto.env-exampleUpstream Foundry issues: foundry-rs/foundry#6192, foundry-rs/foundry#7466, foundry-rs/foundry#7699.