Skip to content

Mark all chains supported by etherscan v2 for contract import - #681

Merged
DZakh merged 3 commits into
mainfrom
dz/monad-explorer
Aug 13, 2025
Merged

Mark all chains supported by etherscan v2 for contract import#681
DZakh merged 3 commits into
mainfrom
dz/monad-explorer

Conversation

@DZakh

@DZakh DZakh commented Aug 12, 2025

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features

    • Expanded block-explorer integration to many additional networks (mainnets and testnets) for direct links to transactions, blocks, and contracts.
  • Documentation

    • CLI help updated: the -b/--blockchain option now lists the newly supported networks for clearer selection and usage.

@coderabbitai

coderabbitai Bot commented Aug 12, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Added 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

Cohort / File(s) Summary of changes
Subenum annotation updates
codegenerator/cli/src/config_parsing/chain_helpers.rs
Expanded many Network variant #[subenum(...)] annotations to include NetworkWithExplorer (e.g., Abstract, ArbitrumGoerli, Berachain, Curtis, Fraxtal, MonadTestnet (specifier order adjusted), Sonic, Sophon, SophonTestnet, Swell, Soneium, Taraxa, Unichain, UnichainSepolia, Worldchain, Xdc, XdcTestnet, Zeta, Zircuit, ZksyncEra, Zora, ZoraSepolia, MoonbaseAlpha, Goerli). No functional changes.
CLI help documentation
codegenerator/cli/CommandLineHelp.md
Extended the -b, --blockchain option's documented possible values to include the additional networks added to the annotations (documentation-only change).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

I hop through enums with nimble cheer,
New explorer flags now appear.
No logic burrowed, just labels bright,
I nibble metadata, tidy and light.
Carrot-stamped, the update's clear. 🥕

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dz/monad-explorer

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@DZakh
DZakh requested a review from JonoPrest August 12, 2025 12:21

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
codegenerator/cli/src/config_parsing/chain_helpers.rs (1)

252-254: Normalize attribute ordering for consistency

Everywhere 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

📥 Commits

Reviewing files that changed from the base of the PR and between 91562d6 and a08e548.

📒 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 correct

This aligns with the PR goal and doesn’t affect control flow. Good addition.


76-78: Berachain: added NetworkWithExplorer

Change is consistent with similar L1/L2 additions. LGTM.


134-136: Curtis: added NetworkWithExplorer

Looks good and consistent with other testnet/devnet entries flagged for explorer support.


166-168: Fraxtal: added NetworkWithExplorer

Matches intent. No functional side effects. LGTM.


342-344: Sonic: added NetworkWithExplorer

Matches the pattern and intent. LGTM.


345-347: Sophon: added NetworkWithExplorer

Looks correct. LGTM.


348-350: SophonTestnet: added NetworkWithExplorer

Good and consistent with the mainnet counterpart. LGTM.


354-356: Swell: added NetworkWithExplorer

Aligned with PR objective. LGTM.


366-368: Unichain: added NetworkWithExplorer

Looks good. LGTM.


372-374: Worldchain: added NetworkWithExplorer

Consistent with similar entries. LGTM.


379-381: Xdc: added NetworkWithExplorer

Appropriate addition. LGTM.


382-384: XdcTestnet: added NetworkWithExplorer

Matches 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 NetworkWithExplorer

The 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 with NetworkWithExplorer

I ran the provided script against src/config_parsing/chain_helpers.rs and extracted:

• 82 variants currently marked with NetworkWithExplorer
• 19 variants without NetworkWithExplorer

Before 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 with NetworkWithExplorer.

Let me know if you share the external list—I can draft the guard test to prevent regressions.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between a08e548 and ed33d4e.

📒 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`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ 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.

Suggested change
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.

@DZakh
DZakh enabled auto-merge (squash) August 13, 2025 10:49
@DZakh
DZakh merged commit 147154f into main Aug 13, 2025
2 checks passed
@DZakh
DZakh deleted the dz/monad-explorer branch August 13, 2025 10:53
@coderabbitai coderabbitai Bot mentioned this pull request Dec 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants