-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
fix(forge): fix verify-contract
etherscan cloudflare bug
#6079
Merged
Conversation
This file contains 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
Etherscan verification for non-mainnet chains requires a question mark at the end of the verifier url in order to prevent a forward slash from being added to the url which trips a cloudflare rule on requests from ec2 boxes. Verification on both Goerli and Sepolia both fails without this character present. Hardhat-verify does not add the extra forward slash to the verifier url and has no issues verifying contracts on etherscan. Fixes foundry-rs#4865, foundry-rs#5251, foundry-rs#5741
tsite
changed the title
fix
fix(forge): fix Oct 22, 2023
forge verify-contract
etherscan cloudflare bugverify-contract
etherscan cloudflare bug
mattsse
requested changes
Oct 22, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh wow very nice find
Evalir
approved these changes
Oct 22, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super nice find—I think I had seen this on the foundry chat for people running non-conventional setups
pending mattsse's nit!
Also apply the fix to --verifier-url urls
mattsse
approved these changes
Oct 22, 2023
2 tasks
mattsse
added a commit
to foundry-rs/block-explorers
that referenced
this pull request
Jan 5, 2024
ref foundry-rs/foundry#6079 previously we were always adding a trailing / to the API URL resulting in cloudfare issues with certain API calls. the alloy-chan now never include a trialing slash so this is no longer necessary. instead of format!(url/api) we're now using url.join which takes care of adding missing / this can then be removed in foundry https://github.com/foundry-rs/foundry/blob/6fc74638b797b8e109452d3df8e26758f86f31fe/crates/forge/bin/cmd/verify/etherscan/mod.rs#L272-L272
2 tasks
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.
Etherscan verification for non-mainnet chains requires a question mark at the end of the verifier url in order to prevent a forward slash from being added to the url which trips a cloudflare rule on requests from ec2 boxes.
Verification on both Goerli and Sepolia fails without this character present.
Hardhat-verify does not add the extra forward slash to the verifier url and has no issues verifying contracts on etherscan.
Fixes #4865, #5251, #5741
Motivation
Fix etherscan contract verification on non-mainnet chains.
Solution
Add a question mark to the end of the verifier url.