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-20tokens: 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
ETHas 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:
import { TeleportTokenParameters, teleportToken } from '@arbitrum/sdk/dist/lib/teleport/teleport';
// Configure the token teleport parameters
const params: TeleportTokenParameters = {
l1Signer, // Ethereum signer
l2Provider, // Arbitrum L2 provider
l3Provider, // Arbitrum chain provider
erc20Address, // Token address (or null for ETH)
amount, // Amount to bridge
l3WalletAddress, // Recipient address on the Arbitrum chain
teleportType: TeleportType.STANDARD, // For ETH-fee chains
};
// Initiate the teleport
const result = await teleportToken(params);
console.log(`Teleport initiated with hash: ${result.hash}`);
-
Monitor and track teleports
Track the status of a teleport:
import { TeleportStatus, getTeleportStatus } from '@arbitrum/sdk/dist/lib/teleport/status';
const status = await getTeleportStatus({
l1Provider,
l2Provider,
l3Provider,
l1TxHash,
});
console.log(`Teleport status: ${TeleportStatus[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: