Skip to content

feat(arbitrum): wire Arbitrum One (42161) mainnet support#289

Merged
gianalarcon merged 3 commits into
developfrom
feat/arbitrum-one-mainnet
Jun 10, 2026
Merged

feat(arbitrum): wire Arbitrum One (42161) mainnet support#289
gianalarcon merged 3 commits into
developfrom
feat/arbitrum-one-mainnet

Conversation

@Huygon764

@Huygon764 Huygon764 commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds Arbitrum One (42161) mainnet support with the Stylus (Rust/WASM) account contract, and slims the Stylus impl so it deploys on Arbitrum One today — no need to wait for ArbOS 60.

Background

The full impl was 31202 bytes (2 fragments), over Arbitrum One's 24576-byte (24 KiB) Stylus code-size limit, so it only deployed on Arbitrum Sepolia (which already has ArbOS 60). Slimmed to 24295 bytes (1 fragment) to fit Arbitrum One's current limit.

How it was slimmed

  • Drop on-chain events (Deposit / TransactionExecuted / Owner). The app tracks transactions via the backend DB + relayer, not on-chain logs, so no functional impact. Largest saving (~6 KB of alloy event encoding for dynamic bytes).
  • Hand-roll PoseidonT3 + zkVerify STATICCALLs instead of sol_interface! bindings (internal only, no ABI change).

Kept unchanged: execute (same ABI, ZkProof[]), transfer, batch, signer management, getters, proof verification. No backend/frontend changes required.

Wiring (42161)

shared (chain def, contracts-config, STYLUS_CHAIN_IDS, USDC, CHAIN_IDS single source), backend (proof.ts domain 10 — verified, campaign.ts), frontend (scaffold.config, network meta, NetworkChooserSidebar, ChooseNetwork).

Deployed + tested

Deployed and tested (transfer + batch) on both chains:

Chain Impl Factory
Arbitrum Sepolia (421614) 0x61fddf7cde02d4527b7d1086671d3f948e59f1d1 0x73d33f803600087ed1259035f9ff46f16f15c11a
Arbitrum One (42161) 0x49e772bd7efd483c043402331fbf03533852850f 0x740b6a46585474eb113f81999c1117e69d4be1be

On-chain account verified on Arbitrum One (3 actions executed): https://arbiscan.io/address/0xdc485d168ed61c439c18b7adb44a74aee21042cd

Revert plan

Slimming is temporary. When ArbOS 60 lands on Arbitrum One (stylusVersion() returns 3, the limit is raised), restore the on-chain events and redeploy the full impl. See packages/stylus/NOTES.md.

Add Arbitrum One as a Stylus chain across shared/backend/frontend (chain
def, contracts-config entry, STYLUS_CHAIN_IDS, native USDC, zkVerify
domain 10). Introduce a shared CHAIN_IDS single source of truth and reuse
it in token.ts and ChooseNetwork. Add the mainnet deploy script and the
hardhat arbitrum public-RPC fix.

Deploy is deferred: the Stylus impl (31202 bytes) exceeds Arbitrum One's
24576-byte code-size limit until ArbOS 60 lands there. See
packages/stylus/NOTES.md.
@Huygon764 Huygon764 marked this pull request as draft June 10, 2026 07:16
The full impl was 31202 bytes (2 fragments), over Arbitrum One's 24576-byte
Stylus code-size limit, so it only deployed on Arbitrum Sepolia (ArbOS 60).
Slimmed to 24295 bytes (1 fragment) so it deploys on Arbitrum One today:

- Drop on-chain events (Deposit/TransactionExecuted/Owner); the app tracks txs
  via the backend DB + relayer, not on-chain logs, so no functional impact.
  Largest saving (~6KB of alloy event encoding).
- Hand-roll the PoseidonT3 and zkVerify STATICCALLs instead of sol_interface
  bindings (internal only, no ABI change).

Kept: execute (same ABI), transfer, batch, signer management, getters, proof
verification. Deployed and tested (transfer/batch) on Arbitrum Sepolia and
Arbitrum One. Revert plan (restore events when ArbOS 60 lands on Arbitrum One)
in packages/stylus/NOTES.md.
@Huygon764 Huygon764 marked this pull request as ready for review June 10, 2026 09:22
@gianalarcon gianalarcon merged commit bef5290 into develop Jun 10, 2026
2 checks passed
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