feat(arbitrum): wire Arbitrum One (42161) mainnet support#289
Merged
Conversation
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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
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_IDSsingle source), backend (proof.tsdomain 10 — verified,campaign.ts), frontend (scaffold.config, network meta, NetworkChooserSidebar, ChooseNetwork).Deployed + tested
Deployed and tested (transfer + batch) on both chains:
0x61fddf7cde02d4527b7d1086671d3f948e59f1d10x73d33f803600087ed1259035f9ff46f16f15c11a0x49e772bd7efd483c043402331fbf03533852850f0x740b6a46585474eb113f81999c1117e69d4be1beOn-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. Seepackages/stylus/NOTES.md.