Overview
TheArbitrum_Adapter enables the HubPool to bridge tokens and send messages from Ethereum L1 to Arbitrum using Arbitrum’s Retryable Ticket system.
Key Features
- Retryable Tickets: Uses Arbitrum Inbox to create retryable L2 transactions
- Address Aliasing: L1 contract addresses are aliased when calling L2 contracts
- Multiple Bridge Paths: Supports native bridge, CCTP, and LayerZero OFT
- Gas Pre-funding: Requires ETH deposit to pay for L2 execution
Contract Reference
Location:contracts/chain-adapters/Arbitrum_Adapter.sol
Constructor
_l1ArbitrumInbox- Arbitrum Inbox contract for creating retryable tickets_l1ERC20GatewayRouter- Gateway router for ERC20 token bridging_l2RefundL2Address- L2 address to receive excess ETH refunds_l1Usdc- USDC token address on L1_cctpTokenMessenger- Circle CCTP TokenMessenger for USDC bridging_adapterStore- Storage contract for OFT bridging_oftDstEid- LayerZero endpoint ID for Arbitrum_oftFeeCap- Maximum fee cap for OFT bridging (e.g., 1 ether)
Constants
Core Functions
relayMessage()
Sends arbitrary messages from L1 to Arbitrum via retryable tickets.- HubPool must hold at least
getL1CallValue(RELAY_MESSAGE_L2_GAS_LIMIT)ETH - Target should be the Arbitrum SpokePool address
relayTokens()
Bridges tokens from L1 to Arbitrum using the appropriate bridge.- USDC: Uses Circle CCTP for native USDC
- OFT tokens: Uses LayerZero if OFT messenger is configured
- DAI: Uses legacy Arbitrum DAI gateway (refunds to aliased HubPool)
- Other tokens: Uses standard Arbitrum ERC20 gateway
getL1CallValue()
Calculates the required ETH to send a message via the Inbox.Address Aliasing
When the HubPool sends messages to Arbitrum, its address is “aliased” on L2 to prevent L1 contract addresses from colliding with L2 addresses. Aliasing Formula:- Arbitrum SpokePool’s
_requireAdminSender()checks the aliased HubPool address - Excess ETH refunds for DAI bridging are sent to the aliased HubPool address
- Use
Arbitrum_RescueAdapterto retrieve stuck ETH from the aliased address
Gas Management
ETH Balance Requirements
The HubPool must hold sufficient ETH before calling adapter functions:Refund Handling
- Standard tokens: Excess ETH refunded to
L2_REFUND_L2_ADDRESS - DAI: Excess ETH refunded to aliased HubPool address (requires rescue adapter)
Bridge Contracts
Arbitrum Inbox
Address: Set in constructor (e.g.,0x4Dbd4fc535Ac27206064B68FfCf827b0A60BAB3f on mainnet)
Interface:
ERC20 Gateway Router
Address: Set in constructor (e.g.,0x72Ce9c846789fdB6fC1f34aC4AD25Dd9ef7031ef on mainnet)
Interface:
Special Cases
DAI Bridging
DAI uses a legacy custom gateway that doesn’t supportoutboundTransferCustomRefund(). Excess ETH is refunded to the aliased HubPool address on L2.
Recovery Process:
- Call
HubPool.setCrossChainContracts()to setArbitrum_RescueAdapter - Call
HubPool.relaySpokePoolAdminFunction()with rescue amount - Restore original
Arbitrum_AdapterviasetCrossChainContracts()
Examples
Relay Admin Function to Arbitrum SpokePool
Bridge USDC to Arbitrum
Related Contracts
Arbitrum_SpokePool.sol- Receives messages and validates admin senderArbitrum_RescueAdapter.sol- Rescues ETH from aliased HubPool addressArbitrum_CustomGasToken_Adapter.sol- For Arbitrum chains using custom gas tokens