Skip to content

EXSC-301 Deploy Arc mainnet core setup#1846

Draft
0xDEnYO wants to merge 2 commits into
mainfrom
feature/exsc-301-sc-deploy-sc-core-setup
Draft

EXSC-301 Deploy Arc mainnet core setup#1846
0xDEnYO wants to merge 2 commits into
mainfrom
feature/exsc-301-sc-deploy-sc-core-setup

Conversation

@0xDEnYO
Copy link
Copy Markdown
Contributor

@0xDEnYO 0xDEnYO commented May 26, 2026

Which Linear task belongs to this PR?

https://linear.app/lifi-linear/issue/EXSC-301/sc-deploy-sc-core-setup

Why did I implement it this way?

Deploys the LI.FI diamond and periphery contracts on Arc mainnet (chainId 5042). Config, deployment logs, and target state only — no facet code changes.

Depends on: EXSC-254 / PolymerCCTPFacet v3.0.0 for dynamic CCTP domain mappings. Merge and deploy the facet upgrade before (or as part of) Arc Polymer CCTP go-live.

Arc has no GasZip support (USDC is native gas). CCTP is the only live bridge at launch.

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>

@lifi-action-bot lifi-action-bot marked this pull request as draft May 26, 2026 02:42
@lifi-action-bot lifi-action-bot changed the title EXSC-301 Arc mainnet deploy + EXSC-254 PolymerCCTP dynamic chain mappings EXSC-301 Arc mainnet deploy + EXSC-254 PolymerCCTP dynamic chain mappings [PolymerCCTPFacet v3.0.0] May 26, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 26, 2026

Review Change Stack

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 8 minutes and 51 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: 4eebe488-56f0-4183-b0fd-c6dc4473a506

📥 Commits

Reviewing files that changed from the base of the PR and between 8eeec7b and bf5e67b.

📒 Files selected for processing (8)
  • config/networks.json
  • config/permit2Proxy.json
  • config/polymercctp.json
  • config/whitelist.json
  • deployments/arc.diamond.json
  • deployments/arc.json
  • foundry.toml
  • script/deploy/_targetState.json

Walkthrough

This PR adds ARC network support across configuration and deployment artifacts and refactors PolymerCCTPFacet to store chainId→domainId mappings in diamond storage with owner-initialized init/set/get APIs; deployment scripts now load mappings from config JSON.

Changes

ARC Network Support and PolymerCCTPFacet Refactor

Layer / File(s) Summary
PolymerCCTPFacet core refactoring
src/Facets/PolymerCCTPFacet.sol
Facet bumped to v3.0.0. Replaces hardcoded chainId→domainId switch with storage-backed mappings: adds NAMESPACE, ChainIdConfig and Storage structs, events (PolymerCCTPChainMappingsInitialized, ChainIdToDomainIdSet), and external functions initPolymerCCTPChainMappings, setChainIdToDomainId, getChainIdToDomainId. Internal lookup now reads storage and reverts UnsupportedChainId when unset.
PolymerCCTPFacet test suite updates
test/solidity/Facets/PolymerCCTPFacet.t.sol
Tests updated to use new APIs: remove test-only wrapper, add events and tests for initialization, setter, non-owner and uninitialized reverts, expand default mapping helpers, and update selector wiring.
Deployment script for config-driven initialization
script/deploy/facets/UpdatePolymerCCTPFacet.s.sol
Imports stdJson and uses it to parse config/polymercctp.json .mappings; getCallData() now encodes calldata for initPolymerCCTPChainMappings with parsed ChainIdConfig[]. Excludes list updated to omit the new initializer.
ARC network configuration and deployment artifacts
config/networks.json, config/permit2Proxy.json, config/polymercctp.json, config/whitelist.json, deployments/arc.json, deployments/arc.diamond.json, script/deploy/_targetState.json, config/global.json
Adds ARC (chain id 5042) entries and addresses: network metadata (RPC, explorer), permit2Proxy mapping, Polymer CCTP mappings and arc entry, periphery whitelist entries for arc, new deployment manifests (deployments/arc*.json), and target deployment facet versions (GenericSwapFacetV3@2.0.0, PolymerCCTPFacet@3.0.0, etc.). Removes FeeCollector and LiFiDEXAggregator selector blocks from config/global.json.
Development environment and documentation updates
foundry.toml, docs/PolymerCCTPFacet.md
Adds rpc_endpoints.arc = "${ETH_NODE_URI_ARC}" and an [etherscan].arc Blockscout verifier entry (chain 5042) to foundry.toml. Documents getChainIdToDomainId(uint256 _chainId) in docs/PolymerCCTPFacet.md.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • lifinance/contracts#1731: Both PRs modify src/Facets/PolymerCCTPFacet.sol's chainId→CCTP domain-id handling (this PR refactors to storage-backed mappings; #1731 also changes mapping logic).
  • lifinance/contracts#1799: Both PRs add LiFiIntentEscrowFacet deployment entries and update deployment artifacts/versions.
  • lifinance/contracts#1445: Both PRs update config/whitelist.json periphery mappings/selectors (this PR adds an arc periphery section; #1445 updates periphery selectors elsewhere).

Suggested labels

NewNetwork

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely summarizes the main change: deploying Arc mainnet core setup, which aligns with the comprehensive changeset adding Arc network configuration and deployment files.
Description check ✅ Passed The description addresses the required sections: identifies the Linear task (EXSC-301), explains the implementation rationale, and includes a properly filled checklist with clear documentation of completed and pending items.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/exsc-301-sc-deploy-sc-core-setup

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
Copy link
Copy Markdown
Collaborator

Test Coverage Report

Line Coverage: 89.90% (3223 / 3585 lines)
Function Coverage: 93.70% ( 506 / 540 functions)
Branch Coverage: 71.51% ( 580 / 811 branches)
Test coverage (89.90%) is above min threshold (83%). Check passed.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/Facets/PolymerCCTPFacet.sol`:
- Line 19: The contract was bumped to version 3.0.0 but the audit metadata
consumed by VersionControlAndAuditVerification lacks a matching entry; add an
audit record for PolymerCCTPFacet v3.0.0 in the same structure used by the
existing audit metadata (e.g., the auditEntries/auditRecords array or
getAuditRecords/getAuditMetadata function), using the same field names and types
(version, contractName "PolymerCCTPFacet", auditor, date, reportHash/signature
or URL) so the new entry exactly mirrors the format of prior records and will be
recognized by VersionControlAndAuditVerification.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 57b5f08b-1d5d-497c-be07-13ebaba4cc06

📥 Commits

Reviewing files that changed from the base of the PR and between b4ca248 and 1a124df.

📒 Files selected for processing (12)
  • config/networks.json
  • config/permit2Proxy.json
  • config/polymercctp.json
  • config/whitelist.json
  • deployments/arc.diamond.json
  • deployments/arc.json
  • docs/PolymerCCTPFacet.md
  • foundry.toml
  • script/deploy/_targetState.json
  • script/deploy/facets/UpdatePolymerCCTPFacet.s.sol
  • src/Facets/PolymerCCTPFacet.sol
  • test/solidity/Facets/PolymerCCTPFacet.t.sol

Comment thread src/Facets/PolymerCCTPFacet.sol Outdated
/// @author LI.FI (https://li.fi)
/// @notice Provides functionality for bridging USDC through Polymer CCTP
/// @custom:version 2.0.1
/// @custom:version 3.0.0
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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add the missing audit record for PolymerCCTPFacet v3.0.0.

Line 19 bumps the facet to 3.0.0, but CI fails because no matching audit entry is logged for this version. Please add/update the audit metadata consumed by VersionControlAndAuditVerification so this upgrade can pass release gates.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/Facets/PolymerCCTPFacet.sol` at line 19, The contract was bumped to
version 3.0.0 but the audit metadata consumed by
VersionControlAndAuditVerification lacks a matching entry; add an audit record
for PolymerCCTPFacet v3.0.0 in the same structure used by the existing audit
metadata (e.g., the auditEntries/auditRecords array or
getAuditRecords/getAuditMetadata function), using the same field names and types
(version, contractName "PolymerCCTPFacet", auditor, date, reportHash/signature
or URL) so the new entry exactly mirrors the format of prior records and will be
recognized by VersionControlAndAuditVerification.

Add Arc mainnet (5042) network config, deployment logs, and target state.
Depends on PolymerCCTPFacet v3.0.0 (EXSC-254) for CCTP domain mapping.

EXSC-301

Co-authored-by: Cursor <cursoragent@cursor.com>
@0xDEnYO 0xDEnYO force-pushed the feature/exsc-301-sc-deploy-sc-core-setup branch from 8eeec7b to 1fdb6f7 Compare May 26, 2026 02:57
@0xDEnYO 0xDEnYO changed the title EXSC-301 Arc mainnet deploy + EXSC-254 PolymerCCTP dynamic chain mappings [PolymerCCTPFacet v3.0.0] EXSC-301 Deploy Arc mainnet core setup May 26, 2026
Depends on EXSC-254 merge before Arc deploy uses this version.

Co-authored-by: Cursor <cursoragent@cursor.com>
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