Skip to content

feat(tools): add verifyRollup tool to verify rollup proxies on Etherscan (V2) - #613

Closed
krlosMata wants to merge 3 commits into
developfrom
agent/issue-512
Closed

krlosMata wants to merge 3 commits into
developfrom
agent/issue-512

Conversation

@krlosMata

@krlosMata krlosMata commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds tools/verifyRollup/, a reusable Hardhat tool that verifies rollup (aggchain) proxies on Etherscan.

Older and upgraded rollups

  • Upgraded rollups: the proxy's constructor argument is the implementation it was originally deployed with, not the current one. Pass that address in proxyConstructorImplementation.
  • Older rollups: the proxy bytecode depends on the rollup manager version that created the rollup. The README has a table mapping tags to proxy path and compiler settings, and explains how to verify an older rollup with proxyContract from a checkout of the matching tag. When a compiler or bytecode mismatch occurs, the error message points to that section.

Etherscan V2

  • hardhat.config.ts: adds customChains for sepolia and mainnet with the V2 endpoint (https://api.etherscan.io/v2/api?chainid=…), following the existing opSepolia entry. This switches every Sepolia and mainnet verification in the repo from the deprecated V1 API to V2.
  • @nomicfoundation/hardhat-verify 1.1.1 drops the query string on GET requests, so V2's chainid is lost. This breaks the already-verified check and the status polling after a submission. The tool wraps the plugin's internal sendGetRequest and adds the API URL's query parameters back, only for requests to that API URL.

🤖 Generated with Claude Code

krlosMata and others added 3 commits October 28, 2026 15:52
Turns the ad-hoc rollup verification script into a reusable tool:
- resolve rollups by address or by rollupID through AgglayerManager
- read implementation/admin from ERC-1967 slots and verify the
  PolygonTransparentProxy with [impl, admin, '0x']
- optionally verify the implementation with configurable contract and
  constructor args
- treat "already verified" as success, continue on errors, print a
  summary and exit non-zero on failures
- fail fast if the Etherscan API key of the selected network is missing
- dryRun mode to print the verification args without calling Etherscan

Refs agglayer/protocol-team-kanban#512

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Add optional proxyContract (global and per entry) and document that the
  proxy bytecode comes from the rollup manager version that created the
  rollup, with per-tag source paths and compiler settings; print a hint on
  compiler/bytecode mismatch errors
- Check Etherscan isVerified before verifying, since hardhat-verify does not
  throw for already verified contracts
- Fail an entry when rollupAddress and rollupID disagree (warn when no
  rollupManagerAddress is set)
- Use placeholder values in verifyRollup.json.example
- Note in README that the tool is not yet validated end to end and how to
  use the Etherscan V2 API through customChains

Refs agglayer/protocol-team-kanban#512

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add sepolia and mainnet customChains using the Etherscan V2 API, restore
the chainid query parameter that hardhat-verify 1.1.1 drops in its GET
requests, resolve the API key with the matched chain config network, add
a hint for Etherscan "Unable to verify" failures and document the
v10 compiler exceptions and the Sepolia validation.

Refs agglayer/protocol-team-kanban#512

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@krlosMata

Copy link
Copy Markdown
Member Author

Superseded by #614 (branch renamed to feature/tool-verify-rollups).

@krlosMata krlosMata closed this Oct 28, 2026
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.

1 participant