Mark all chains supported by etherscan v2 for contract import - #681
Conversation
WalkthroughAdded NetworkWithExplorer to subenum annotations for many Network variants in chain_helpers.rs and updated CLI documentation to list those networks; only metadata and docs changed, no runtime logic or control flow modifications. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
codegenerator/cli/src/config_parsing/chain_helpers.rs (1)
252-254: Normalize attribute ordering for consistencyEverywhere else, attributes are ordered as
HypersyncNetwork, NetworkWithExplorer. Here it’s reversed, which is a minor inconsistency and can cause noisy diffs later.Apply this diff to match the prevalent ordering:
- #[subenum(NetworkWithExplorer, HypersyncNetwork)] + #[subenum(HypersyncNetwork, NetworkWithExplorer)]
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
codegenerator/cli/src/config_parsing/chain_helpers.rs(8 hunks)
🔇 Additional comments (15)
codegenerator/cli/src/config_parsing/chain_helpers.rs (15)
31-33: Abstract: marking as NetworkWithExplorer looks correctThis aligns with the PR goal and doesn’t affect control flow. Good addition.
76-78: Berachain: added NetworkWithExplorerChange is consistent with similar L1/L2 additions. LGTM.
134-136: Curtis: added NetworkWithExplorerLooks good and consistent with other testnet/devnet entries flagged for explorer support.
166-168: Fraxtal: added NetworkWithExplorerMatches intent. No functional side effects. LGTM.
342-344: Sonic: added NetworkWithExplorerMatches the pattern and intent. LGTM.
345-347: Sophon: added NetworkWithExplorerLooks correct. LGTM.
348-350: SophonTestnet: added NetworkWithExplorerGood and consistent with the mainnet counterpart. LGTM.
354-356: Swell: added NetworkWithExplorerAligned with PR objective. LGTM.
366-368: Unichain: added NetworkWithExplorerLooks good. LGTM.
372-374: Worldchain: added NetworkWithExplorerConsistent with similar entries. LGTM.
379-381: Xdc: added NetworkWithExplorerAppropriate addition. LGTM.
382-384: XdcTestnet: added NetworkWithExplorerMatches mainnet XDC update. LGTM.
391-393: ZksyncEra: added NetworkWithExplorer (preserving GraphNetwork)The combined classification makes sense and retains GraphNetwork membership. LGTM.
339-347: AI summary inconsistency: Soneium not marked as NetworkWithExplorerThe AI summary claims Soneium was updated to include
NetworkWithExplorer, but in the code Soneium remains#[subenum(HypersyncNetwork)]. If Soneium is indeed supported by your Etherscan v2-based import, it may have been missed.Would you like me to add it here and open a follow-up test to lock the intended set?
30-402: Verify all Etherscan v2–supported chains are annotated withNetworkWithExplorerI ran the provided script against
src/config_parsing/chain_helpers.rsand extracted:• 82 variants currently marked with
NetworkWithExplorer
• 19 variants withoutNetworkWithExplorerBefore merging, please compare these two sets against your authoritative Etherscan v2–supported chains list. Once you have that list, you can:
- Manually cross-check any missing or erroneously flagged chain names/IDs
- (Recommended) Embed the external list as a constant in your code and add a unit test in
chain_helpers.rs(or its test module) to assert that every chain in the Etherscan list appears exactly once withNetworkWithExplorer.Let me know if you share the external list—I can draft the guard test to prevent regressions.
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
codegenerator/cli/CommandLineHelp.md (1)
109-109: Avoid manual duplication; generate from source of truth.Manually maintaining this long list is brittle. Consider generating this section from the NetworkWithExplorer enum (e.g., via a doc build step or embedding the CLI’s autogenerated help) so docs don’t drift from code.
I can propose a small script to emit the set of explorer-supported networks from the Rust enum and inject it here during docs build. Want me to draft it?
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
codegenerator/cli/CommandLineHelp.md(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build_and_test
🔇 Additional comments (1)
codegenerator/cli/CommandLineHelp.md (1)
109-109: Confirm deprecations and support in Etherscan v2 (goerli, arbitrum-testnet).If this list is intended to track Etherscan v2-supported explorers, double-check that “goerli” and “arbitrum-testnet” are still supported and not deprecated in favor of sepolia variants. Adjust if necessary to avoid misleading users.
Would you like me to run a verification script to cross-check the enum variants exported as NetworkWithExplorer against this doc and flag any drift automatically?
| * `-b`, `--blockchain <BLOCKCHAIN>` — Network to import the contract from | ||
|
|
||
| Possible values: `amoy`, `arbitrum-nova`, `arbitrum-one`, `arbitrum-sepolia`, `arbitrum-testnet`, `aurora`, `aurora-testnet`, `avalanche`, `b2-testnet`, `base`, `base-sepolia`, `blast`, `blast-sepolia`, `boba`, `bsc`, `bsc-testnet`, `celo`, `celo-alfajores`, `celo-baklava`, `citrea-testnet`, `crab`, `ethereum-mainnet`, `evmos`, `fantom`, `fantom-testnet`, `fhenix-helium`, `flare`, `fuji`, `galadriel-devnet`, `gnosis`, `gnosis-chiado`, `goerli`, `harmony`, `holesky`, `kroma`, `linea`, `linea-sepolia`, `lisk`, `lukso`, `lukso-testnet`, `manta`, `mantle`, `mantle-testnet`, `metis`, `mode`, `mode-sepolia`, `moonbase-alpha`, `moonbeam`, `moonriver`, `morph`, `morph-testnet`, `neon-evm`, `opbnb`, `optimism`, `optimism-sepolia`, `poa-core`, `poa-sokol`, `polygon`, `polygon-zkevm`, `polygon-zkevm-testnet`, `rsk`, `saakuru`, `scroll`, `scroll-sepolia`, `sepolia`, `shimmer-evm`, `taiko`, `tangle`, `unichain-sepolia`, `zeta`, `zora`, `zora-sepolia` | ||
| Possible values: `abstract`, `amoy`, `arbitrum-nova`, `arbitrum-one`, `arbitrum-sepolia`, `arbitrum-testnet`, `aurora`, `aurora-testnet`, `avalanche`, `b2-testnet`, `base`, `base-sepolia`, `berachain`, `blast`, `blast-sepolia`, `boba`, `bsc`, `bsc-testnet`, `celo`, `celo-alfajores`, `celo-baklava`, `citrea-testnet`, `crab`, `curtis`, `ethereum-mainnet`, `evmos`, `fantom`, `fantom-testnet`, `fhenix-helium`, `flare`, `fraxtal`, `fuji`, `galadriel-devnet`, `gnosis`, `gnosis-chiado`, `goerli`, `harmony`, `holesky`, `kroma`, `linea`, `linea-sepolia`, `lisk`, `lukso`, `lukso-testnet`, `manta`, `mantle`, `mantle-testnet`, `metis`, `mode`, `mode-sepolia`, `monad-testnet`, `moonbase-alpha`, `moonbeam`, `moonriver`, `morph`, `morph-testnet`, `neon-evm`, `opbnb`, `optimism`, `optimism-sepolia`, `poa-core`, `poa-sokol`, `polygon`, `polygon-zkevm`, `polygon-zkevm-testnet`, `rsk`, `saakuru`, `scroll`, `scroll-sepolia`, `sepolia`, `shimmer-evm`, `sonic`, `sophon`, `sophon-testnet`, `swell`, `taiko`, `tangle`, `unichain`, `unichain-sepolia`, `worldchain`, `xdc`, `xdc-testnet`, `zeta`, `zksync-era`, `zora`, `zora-sepolia` |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Docs drift: missing networks recently marked as explorer-supported (soneium, taraxa, zircuit).
The list should reflect all NetworkWithExplorer variants added in chain_helpers.rs. Please add soneium, taraxa, and zircuit to keep CLI help accurate.
Apply this diff to update the list:
- Possible values: `abstract`, `amoy`, `arbitrum-nova`, `arbitrum-one`, `arbitrum-sepolia`, `arbitrum-testnet`, `aurora`, `aurora-testnet`, `avalanche`, `b2-testnet`, `base`, `base-sepolia`, `berachain`, `blast`, `blast-sepolia`, `boba`, `bsc`, `bsc-testnet`, `celo`, `celo-alfajores`, `celo-baklava`, `citrea-testnet`, `crab`, `curtis`, `ethereum-mainnet`, `evmos`, `fantom`, `fantom-testnet`, `fhenix-helium`, `flare`, `fraxtal`, `fuji`, `galadriel-devnet`, `gnosis`, `gnosis-chiado`, `goerli`, `harmony`, `holesky`, `kroma`, `linea`, `linea-sepolia`, `lisk`, `lukso`, `lukso-testnet`, `manta`, `mantle`, `mantle-testnet`, `metis`, `mode`, `mode-sepolia`, `monad-testnet`, `moonbase-alpha`, `moonbeam`, `moonriver`, `morph`, `morph-testnet`, `neon-evm`, `opbnb`, `optimism`, `optimism-sepolia`, `poa-core`, `poa-sokol`, `polygon`, `polygon-zkevm`, `polygon-zkevm-testnet`, `rsk`, `saakuru`, `scroll`, `scroll-sepolia`, `sepolia`, `shimmer-evm`, `sonic`, `sophon`, `sophon-testnet`, `swell`, `taiko`, `tangle`, `unichain`, `unichain-sepolia`, `worldchain`, `xdc`, `xdc-testnet`, `zeta`, `zksync-era`, `zora`, `zora-sepolia`
+ Possible values: `abstract`, `amoy`, `arbitrum-nova`, `arbitrum-one`, `arbitrum-sepolia`, `arbitrum-testnet`, `aurora`, `aurora-testnet`, `avalanche`, `b2-testnet`, `base`, `base-sepolia`, `berachain`, `blast`, `blast-sepolia`, `boba`, `bsc`, `bsc-testnet`, `celo`, `celo-alfajores`, `celo-baklava`, `citrea-testnet`, `crab`, `curtis`, `ethereum-mainnet`, `evmos`, `fantom`, `fantom-testnet`, `fhenix-helium`, `flare`, `fraxtal`, `fuji`, `galadriel-devnet`, `gnosis`, `gnosis-chiado`, `goerli`, `harmony`, `holesky`, `kroma`, `linea`, `linea-sepolia`, `lisk`, `lukso`, `lukso-testnet`, `manta`, `mantle`, `mantle-testnet`, `metis`, `mode`, `mode-sepolia`, `monad-testnet`, `moonbase-alpha`, `moonbeam`, `moonriver`, `morph`, `morph-testnet`, `neon-evm`, `opbnb`, `optimism`, `optimism-sepolia`, `poa-core`, `poa-sokol`, `polygon`, `polygon-zkevm`, `polygon-zkevm-testnet`, `rsk`, `saakuru`, `scroll`, `scroll-sepolia`, `sepolia`, `shimmer-evm`, `sonic`, `soneium`, `sophon`, `sophon-testnet`, `swell`, `taiko`, `taraxa`, `tangle`, `unichain`, `unichain-sepolia`, `worldchain`, `xdc`, `xdc-testnet`, `zeta`, `zircuit`, `zksync-era`, `zora`, `zora-sepolia`📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| Possible values: `abstract`, `amoy`, `arbitrum-nova`, `arbitrum-one`, `arbitrum-sepolia`, `arbitrum-testnet`, `aurora`, `aurora-testnet`, `avalanche`, `b2-testnet`, `base`, `base-sepolia`, `berachain`, `blast`, `blast-sepolia`, `boba`, `bsc`, `bsc-testnet`, `celo`, `celo-alfajores`, `celo-baklava`, `citrea-testnet`, `crab`, `curtis`, `ethereum-mainnet`, `evmos`, `fantom`, `fantom-testnet`, `fhenix-helium`, `flare`, `fraxtal`, `fuji`, `galadriel-devnet`, `gnosis`, `gnosis-chiado`, `goerli`, `harmony`, `holesky`, `kroma`, `linea`, `linea-sepolia`, `lisk`, `lukso`, `lukso-testnet`, `manta`, `mantle`, `mantle-testnet`, `metis`, `mode`, `mode-sepolia`, `monad-testnet`, `moonbase-alpha`, `moonbeam`, `moonriver`, `morph`, `morph-testnet`, `neon-evm`, `opbnb`, `optimism`, `optimism-sepolia`, `poa-core`, `poa-sokol`, `polygon`, `polygon-zkevm`, `polygon-zkevm-testnet`, `rsk`, `saakuru`, `scroll`, `scroll-sepolia`, `sepolia`, `shimmer-evm`, `sonic`, `sophon`, `sophon-testnet`, `swell`, `taiko`, `tangle`, `unichain`, `unichain-sepolia`, `worldchain`, `xdc`, `xdc-testnet`, `zeta`, `zksync-era`, `zora`, `zora-sepolia` | |
| Possible values: `abstract`, `amoy`, `arbitrum-nova`, `arbitrum-one`, `arbitrum-sepolia`, `arbitrum-testnet`, `aurora`, `aurora-testnet`, `avalanche`, `b2-testnet`, `base`, `base-sepolia`, `berachain`, `blast`, `blast-sepolia`, `boba`, `bsc`, `bsc-testnet`, `celo`, `celo-alfajores`, `celo-baklava`, `citrea-testnet`, `crab`, `curtis`, `ethereum-mainnet`, `evmos`, `fantom`, `fantom-testnet`, `fhenix-helium`, `flare`, `fraxtal`, `fuji`, `galadriel-devnet`, `gnosis`, `gnosis-chiado`, `goerli`, `harmony`, `holesky`, `kroma`, `linea`, `linea-sepolia`, `lisk`, `lukso`, `lukso-testnet`, `manta`, `mantle`, `mantle-testnet`, `metis`, `mode`, `mode-sepolia`, `monad-testnet`, `moonbase-alpha`, `moonbeam`, `moonriver`, `morph`, `morph-testnet`, `neon-evm`, `opbnb`, `optimism`, `optimism-sepolia`, `poa-core`, `poa-sokol`, `polygon`, `polygon-zkevm`, `polygon-zkevm-testnet`, `rsk`, `saakuru`, `scroll`, `scroll-sepolia`, `sepolia`, `shimmer-evm`, `sonic`, `soneium`, `sophon`, `sophon-testnet`, `swell`, `taiko`, `taraxa`, `tangle`, `unichain`, `unichain-sepolia`, `worldchain`, `xdc`, `xdc-testnet`, `zeta`, `zircuit`, `zksync-era`, `zora`, `zora-sepolia` |
🤖 Prompt for AI Agents
In codegenerator/cli/CommandLineHelp.md around line 109, the CLI help network
list is missing recently added networks (soneium, taraxa, zircuit); update the
comma-separated Possible values list to include soneium, taraxa, and zircuit in
the appropriate alphabetical position (or appended) so it matches the
NetworkWithExplorer variants in chain_helpers.rs and rebuild/regenerate the help
output if necessary.
Summary by CodeRabbit
New Features
Documentation