Skip to content

EXSC-301: add bulk contract verification helper for one network#1855

Open
0xDEnYO wants to merge 2 commits into
mainfrom
feature/exsc-301-verify-all-contracts-on-network
Open

EXSC-301: add bulk contract verification helper for one network#1855
0xDEnYO wants to merge 2 commits into
mainfrom
feature/exsc-301-verify-all-contracts-on-network

Conversation

@0xDEnYO
Copy link
Copy Markdown
Contributor

@0xDEnYO 0xDEnYO commented May 27, 2026

Which Linear task belongs to this PR?

EXSC-301

Why did I implement it this way?

Use case

When we deploy to a new network, contract verification often cannot run at deploy time. Typical reasons:

  • The block explorer is not live yet
  • The explorer API is not wired up in foundry.toml / networks.json
  • The explorer is password-protected or otherwise unavailable during the initial deploy window

Deployments still land in deployments/<network>.json and MongoDB with verified: false. Once the explorer is ready, we need a single follow-up step to verify every contract on that chain and flip the MongoDB flags — without manually calling getContractVerified dozens of times.

verifyAllUnverifiedContractsOnNetwork is that follow-up helper.

What it does

  1. Reads the contract list from deployments/<network>.json (or .staging.json) — the canonical set of addresses for that network, not the full MongoDB history (which may include old versions, staging rows, etc.).
  2. For each contract, checks whether it is already marked verified in MongoDB; skips if yes.
  3. Otherwise runs the existing getContractVerified path (forge verify-contract + MongoDB update via logContractDeploymentInfo).

Example (after Arc explorer went live):

source .env
source script/helperFunctions.sh
source script/playgroundHelpers.sh
verifyAllUnverifiedContractsOnNetwork arc production

Also fixes isContractAlreadyVerified to read MongoDB's .verified field (not only legacy .VERIFIED).

Checklist before requesting a review

  • I have performed a self-review of my code
  • This pull request is as small as possible and only tackles one problem
  • I have run /pr-ready (local CodeRabbit) on this branch and resolved (or explicitly documented) all findings — see .agents/commands/pr-ready.md
  • I have added tests that cover the functionality / test the bug
  • For new facets: I have checked all points from this list: https://www.notion.so/lifi/New-Facet-Contract-Checklist-157f0ff14ac78095a2b8f999d655622e
  • I have updated any required documentation

Checklist for reviewer (DO NOT DEPLOY and contracts BEFORE CHECKING THIS!!!)

  • I have checked that any arbitrary calls to external contracts are validated and or restricted
  • I have checked that any privileged calls (i.e. storage modifications) are validated and or restricted
  • I have ensured that any new contracts have had AT A MINIMUM 1 preliminary audit conducted on by <company/auditor>

0xDEnYO and others added 2 commits May 27, 2026 08:01
Add verifyAllUnverifiedContractsOnNetwork to iterate contracts from
deployments/<network>.json, skip those already verified in MongoDB, and
verify the rest via getContractVerified.

Co-authored-by: Cursor <cursoragent@cursor.com>
Address CodeRabbit review: capture getContractNamesFromNetworkDeploymentFile
exit status explicitly and fail when jq cannot parse the deployments file.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 27, 2026

Warning

Review limit reached

@0xDEnYO, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 1 minute and 23 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: f7699d51-4161-4c54-8fd3-daccf17fbdfc

📥 Commits

Reviewing files that changed from the base of the PR and between 6b27f08 and 620bb45.

📒 Files selected for processing (2)
  • script/helperFunctions.sh
  • script/playgroundHelpers.sh
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/exsc-301-verify-all-contracts-on-network

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@lifi-action-bot lifi-action-bot marked this pull request as draft May 27, 2026 01:06
@0xDEnYO 0xDEnYO marked this pull request as ready for review May 27, 2026 01:16
@0xDEnYO 0xDEnYO enabled auto-merge (squash) May 27, 2026 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants