Skip to content

Deploy network arc testnet#1645

Draft
0xDEnYO wants to merge 4 commits intomainfrom
deploy-network-arc-testnet
Draft

Deploy network arc testnet#1645
0xDEnYO wants to merge 4 commits intomainfrom
deploy-network-arc-testnet

Conversation

@0xDEnYO
Copy link
Contributor

@0xDEnYO 0xDEnYO commented Mar 5, 2026

Which Jira task belongs to this PR?

https://lifi.atlassian.net/browse/EX-308

Why did I implement it this way?

Checklist before requesting a review

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 March 5, 2026 10:15
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 5, 2026

Walkthrough

Adds support for a new blockchain network (arctestnet, chain ID 5042002) by introducing configuration entries across network configs, deployment manifests, and deployment scripts. Includes updates to deployment automation tooling for async transaction sending capabilities and argument packaging adjustments.

Changes

Cohort / File(s) Summary
Network Configuration
config/networks.json, config/permit2Proxy.json, config/whitelist.json, foundry.toml
Adds arctestnet network entry with RPC endpoints, explorer URLs, contract addresses, and chain configuration. Updates foundry configuration to support arctestnet in rpc_endpoints and etherscan sections.
Deployment Manifest
deployments/arctestnet.json
New static JSON mapping of deployed facet addresses for arctestnet chain.
Target State Configuration
script/deploy/_targetState.json
Adds arctestnet entry with production LiFiDiamond facet versions (AccessManagerFacet 1.0.0, CalldataVerificationFacet 1.3.1, GasZipFacet 2.0.5, and 17 additional facets/periphery contracts).
Type Definitions
script/common/types.ts
Adds optional castSendAsync boolean property to INetwork interface.
Deployment Automation
script/deploy/deployAllContracts.sh, script/deploy/facets/UpdateDiamondLoupeFacet.s.sol, script/tasks/updateERC20Proxy.sh
Updates DiamondLoupeFacet deployment timing; modifies cutData encoding to execute earlier in conditional flow; changes ERC20Proxy authorization argument packaging from separate parameters to composite argument with trailing boolean.
Deployment Utilities
script/helperFunctions.sh, script/universalCast.sh
Adds getCastSendAsync function to read network-specific async send configuration; enhances universalSendRaw to support dynamic asynchronous transaction sending with 3-second delay post-success for async mode.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

AuditNotRequired, NewNetwork

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The PR description is mostly a template checklist with only the Jira link filled in; the 'Why did I implement it this way?' section is empty and checklists are unchecked, making the actual implementation rationale unclear. Complete the 'Why did I implement it this way?' section to explain the deployment approach and mark checklist items to reflect the actual implementation status and testing performed.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: deploying a new network (Arc testnet) by adding configuration entries across multiple files.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch deploy-network-arc-testnet

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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.

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

🧹 Nitpick comments (1)
script/deploy/_targetState.json (1)

2225-2251: Alphabetical ordering inconsistency.

Per coding guidelines, network entries should be ordered with mainnet first, then all other networks alphabetically. The arctestnet entry is placed at the end (after jovay), but it should come after arbitrum (around line 95-147).

Additionally, note that DexManagerFacet and WhitelistManagerFacet are not included in this configuration, unlike most other production network entries. If this is intentional for the testnet, no action needed; otherwise, consider adding them for consistency.

📝 Suggested fix for ordering

Move the arctestnet block to appear after arbitrum and before avalanche to maintain alphabetical ordering.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@script/deploy/_targetState.json` around lines 2225 - 2251, Move the
"arctestnet" network block so it appears immediately after "arbitrum" (i.e.,
maintain mainnet first then other networks alphabetically) and ensure its
production LiFiDiamond entry matches the typical facet set; if you want
consistency add the missing "DexManagerFacet" and "WhitelistManagerFacet" keys
to the "LiFiDiamond" object (or explicitly confirm they are intentionally
omitted) so the configuration for "arctestnet" aligns with other production
network entries.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@script/tasks/updateERC20Proxy.sh`:
- Line 30: The call to universalCast in updateERC20Proxy.sh hardcodes the
environment as "production" which ignores the ENVIRONMENT variable and can route
privileged transactions incorrectly; update the universalCast invocation (the
line using universalCast "send" "$NETWORK" "production" "$ERC20PROXY"
"setAuthorizedCaller(address,bool)" "$EXECUTOR true" "false") to use the
ENVIRONMENT variable (e.g. "$ENVIRONMENT") instead of the literal "production"
so the script respects the passed environment for staging/testnet runs.

---

Nitpick comments:
In `@script/deploy/_targetState.json`:
- Around line 2225-2251: Move the "arctestnet" network block so it appears
immediately after "arbitrum" (i.e., maintain mainnet first then other networks
alphabetically) and ensure its production LiFiDiamond entry matches the typical
facet set; if you want consistency add the missing "DexManagerFacet" and
"WhitelistManagerFacet" keys to the "LiFiDiamond" object (or explicitly confirm
they are intentionally omitted) so the configuration for "arctestnet" aligns
with other production network entries.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 81642ef3-fb55-465b-8880-8b1a65cff618

📥 Commits

Reviewing files that changed from the base of the PR and between c00e856 and 64dd968.

📒 Files selected for processing (12)
  • config/networks.json
  • config/permit2Proxy.json
  • config/whitelist.json
  • deployments/arctestnet.json
  • foundry.toml
  • script/common/types.ts
  • script/deploy/_targetState.json
  • script/deploy/deployAllContracts.sh
  • script/deploy/facets/UpdateDiamondLoupeFacet.s.sol
  • script/helperFunctions.sh
  • script/tasks/updateERC20Proxy.sh
  • script/universalCast.sh

echo "Setting $EXECUTOR as authorized caller for $ERC20PROXY on $NETWORK..."

universalCast "send" "$NETWORK" "production" "$ERC20PROXY" "setAuthorizedCaller(address,bool)" "$EXECUTOR" true
universalCast "send" "$NETWORK" "production" "$ERC20PROXY" "setAuthorizedCaller(address,bool)" "$EXECUTOR true" "false"
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Use the passed environment instead of hardcoding production.

Line 30 ignores ENVIRONMENT, which can route this privileged call through the wrong execution/governance path for staging/testnet runs.

💡 Minimal fix
-	universalCast "send" "$NETWORK" "production" "$ERC20PROXY" "setAuthorizedCaller(address,bool)" "$EXECUTOR true" "false"
+	universalCast "send" "$NETWORK" "$ENVIRONMENT" "$ERC20PROXY" "setAuthorizedCaller(address,bool)" "$EXECUTOR true" "false"
📝 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
universalCast "send" "$NETWORK" "production" "$ERC20PROXY" "setAuthorizedCaller(address,bool)" "$EXECUTOR true" "false"
universalCast "send" "$NETWORK" "$ENVIRONMENT" "$ERC20PROXY" "setAuthorizedCaller(address,bool)" "$EXECUTOR true" "false"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@script/tasks/updateERC20Proxy.sh` at line 30, The call to universalCast in
updateERC20Proxy.sh hardcodes the environment as "production" which ignores the
ENVIRONMENT variable and can route privileged transactions incorrectly; update
the universalCast invocation (the line using universalCast "send" "$NETWORK"
"production" "$ERC20PROXY" "setAuthorizedCaller(address,bool)" "$EXECUTOR true"
"false") to use the ENVIRONMENT variable (e.g. "$ENVIRONMENT") instead of the
literal "production" so the script respects the passed environment for
staging/testnet runs.

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