feat(worker): add Etherscan API proxy for free contract verification#330
Merged
AugustoL merged 2 commits intoopenscan-explorer:devfrom Mar 19, 2026
Merged
Conversation
Add /etherscan/verify route to the Cloudflare Worker that proxies contract verification requests to Etherscan V2 API using a shared API key. Frontend now uses the worker proxy as default fallback when no user key is configured, making verification free for all users. Closes openscan-explorer#322
|
🚀 Preview: https://pr-330--openscan.netlify.app |
Remove hasEtherscanKey gate from useContractVerification so that Etherscan verification runs for all users via the worker proxy, not just those with a configured API key.
MatiasOS
approved these changes
Mar 19, 2026
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.
Description
Add an Etherscan V2 API proxy to the existing Cloudflare Worker so that contract verification lookups work for all users out of the box, without requiring them to configure their own API key.
Related Issue
Closes #322
Type of Change
Changes Made
Worker (
worker/)POST /etherscan/verify— Proxies contract verification requests to Etherscan V2 API using a shared API key stored as a Worker secretchainId(positive integer) andaddress(0x + 40 hex chars)ETHERSCAN_API_KEYsecret — Set viawrangler secret put ETHERSCAN_API_KEYFrontend (
src/)contractLookup.ts— Etherscan fallback now always runs: uses user key if configured, otherwise proxies through the OpenScan WorkeruseEtherscan.ts— Same logic: no longer requiresapiKeyto activate, uses worker proxy as defaultScreenshots (if applicable)
N/A — backend change, verification results appear in existing contract UI
Checklist
npm run format:fixandnpm run lint:fixnpm run typecheckwith no errorsAdditional Notes
wrangler secret put ETHERSCAN_API_KEY