Integrate with Layer Leap
Overview
Layer Leap is a protocol that enables users to bridge ETH and ERC-20 tokens directly from Ethereum to Arbitrum chains in a single transaction. This significantly improves user experience by eliminating the need for intermediate bridging steps.
Key benefits
- For users: Bridge tokens from Ethereum to any Arbitrum chain with a single transaction
- For developers: Seamlessly onboard users to your Arbitrum chain directly from Ethereum
How it works
Layer Leap uses a system of contracts to coordinate token transfers across multiple layers:
- L1Teleporter (on Ethereum): Entry point for token transfers
- L2ForwarderFactory (on Arbitrum One/Nova): Creates deterministic
L2Forwardercontracts - L2Forwarder (on Arbitrum One/Nova): Handles the final transfer to the Arbitrum chain
Technical architecture
Layer Leap leverages two key mechanisms:
- For ERC-20 tokens: The Teleport Contracts coordinate transfers through the canonical token bridges of both the parent chain and the Arbitrum chain
- For ETH: A "double retryable" approach, where a retryable ticket creates another retryable ticket to complete the cross-chain transfer
Requirements
Layer Leap currently supports Arbitrum chains with the following characteristics:
- Built on top of an Arbitrum Layer 2 (Arbitrum One or Nova)
- Using ETH as the gas token
- The parent chain must be an Arbitrum chain due to reliance on retryable tickets.
Support for Arbitrum chains with custom gas tokens is planned for future releases.
Implementation guide
Option 1: Integrate with Arbitrum bridge UI
If you want your Arbitrum chain to appear on the Arbitrum bridge UI with Layer Leap support:
- If your chain is not yet on the Arbitrum bridge, submit a request using this GitHub template
- Request Layer Leap activation using this GitHub template
Option 2: Custom integration
To integrate Layer Leap into your custom bridge UI:
-
Set up infrastructure
- Ensure your Arbitrum chain is properly configured
- Deploy and configure the necessary components
-
Implement the bridging flow
The simplest implementation uses the Arbitrum SDK (
Erc20L1L3Bridgerfrom@arbitrum/sdk):
import { Erc20L1L3Bridger } from '@arbitrum/sdk';
// Create an L1-L3 bridger instance
const l1l3Bridger = new Erc20L1L3Bridger(l3Network);
// Initiate the teleport
const result = await l1l3Bridger.deposit({
erc20ParentAddress: erc20Address, // Token address on L1
amount, // Amount to bridge
l1Signer, // Ethereum signer
l2Provider, // Arbitrum L2 provider
l3Provider, // Arbitrum chain provider
});
console.log(`Teleport initiated with hash: ${result.hash}`);
-
Monitor and track teleports
Track the status of a teleport:
import { Erc20L1L3Bridger } from '@arbitrum/sdk';
const l1l3Bridger = new Erc20L1L3Bridger(l3Network);
const status = await l1l3Bridger.getDepositStatus({
l1TxHash,
l1Provider,
l2Provider,
l3Provider,
});
console.log(`Teleport status: ${status}`);
Best practices
-
Retryable monitoring
Run the Retryables Monitoring tool to track and redeem any failed retryables.
-
Gas estimation
Layer Leap requires sufficient gas to cover all steps across multiple chains. Conservative gas estimations are recommended.
-
Error handling
Implement proper error handling for each step of the teleport process, especially for handling potential failures at the L2 or L3 level.
Contract address
| Contract | Address |
|---|---|
| Arb One/Nova L1Teleporter | 0xCBd9c6e310D6AaDeF9F025f716284162F0158992 |
Demo examples
You can see Layer Leap in action on the Arbitrum Bridge by bridging to: