Token bridge: Bridging ERC-20 tokens | Arbitrum Docs (2024)

The Arbitrum protocol itself technically has no native notion of any token standards, and gives no built-in advantage or special recognition to any particular token bridge. In this page we describe the "canonical bridge", which was implemented by Offchain Labs, and should be the primary bridge most users and applications use; it is (effectively) a decentralized app (dApp) with contracts on both Ethereum (the Layer 1, or L1) and Arbitrum (the Layer 2, or L2) that leverages Arbitrum's cross-chain message passing system to achieve basic desired token-bridging functionality. We recommend that you use it!

Design rationale

In our token bridge design, we use the term "gateway" as per this proposal; i.e., one of a pair of contracts on two different domains (i.e., Ethereum and an Arbitrum chain), used to facilitate cross-domain asset transfers.

We now describe some core goals that motivated the design of our bridging system.

Custom gateway functionality

For many ERC-20 tokens, "standard" bridging functionality is sufficient, which entails the following: a token contract on Ethereum is associated with a "paired" token contract on Arbitrum.

Depositing a token entails escrowing some amount of the token in an L1 bridge contract, and minting the same amount at the paired token contract on L2. On L2, the paired contract behaves much like a normal ERC-20 token contract. Withdrawing entails burning some amount of the token in the L2 contract, which then can later be claimed from the L1 bridge contract.

Many tokens, however, require custom gateway systems, the possibilities of which are hard to generalize, e.g.:

  • Tokens which accrue interest to their holders need to ensure that the interest is dispersed properly across layers, and doesn't simply accrue to the bridge contracts
  • Our cross-domain WETH implementations requires tokens be wrapped and unwrapped as they move across layers.

Thus, our bridge architecture must allow not just the standard deposit and withdraw functionalities, but for new, custom gateways to be dynamically added over time.

Canonical L2 representation per L1 token contract

Having multiple custom gateways is well and good, but we also want to avoid a situation in which a single L1 token that uses our bridging system can be represented at multiple addresses/contracts on the L2 as this adds significant friction and confusion for users and developers. Thus, we need a way to track which L1 token uses which gateway, and in turn, to have a canonical address oracle that maps the tokens addresses across the Ethereum and Arbitrum domains.

Canonical token bridge implementation

With this in mind, we provide an overview of our token bridging architecture.

Our architecture consists of three types of contracts:

  1. Asset contracts: These are the token contracts themselves, i.e., an ERC-20 on L1 and it's counterpart on Arbitrum.
  2. Gateways: Pairs of contracts (one on L1, one on L2) that implement a particular type of cross-chain asset bridging.
  3. Routers: Exactly two contracts (one on L1, one on L2) that route each asset to its designated gateway.

Token bridge: Bridging ERC-20 tokens | Arbitrum Docs (1)

All Ethereum to Arbitrum token transfers are initiated via the router contract on L1, the L1GatewayRouter contract. L1GatewayRouter forwards the token's deposit call to the appropriate gateway contract on L1, the L1ArbitrumGateway contract. L1GatewayRouter is responsible for mapping L1 token addresses to L1Gateway contracts, thus acting as an L1/L2 address oracle, and ensuring that each token corresponds to only one gateway. The L1ArbitrumGateway then communicates to its counterpart gateway contract on L2, the L2ArbitrumGateway contract (typically/expectedly via retryable tickets).

Token bridge: Bridging ERC-20 tokens | Arbitrum Docs (2)

Similarly, Arbitrum to Ethereum transfers are initiated via the router contract on L2, the L2GatewayRouter contract, which calls the token's gateway contract on L2, the L2ArbitrumGateway contract, which in turn communicates to its corresponding gateway contract on L1, the L1ArbitrumGateway contract (typically/expectedly via sending L2-to-L1 messages to the outbox).

Token bridge: Bridging ERC-20 tokens | Arbitrum Docs (3)

For any given gateway pairing, we require that calls be initiated through the corresponding router (L1GatewayRouter or L2GatewayRouter), and that the gateways conform to the TokenGateway interfaces; the TokenGateway interfaces should be flexible and extensible enough to support any bridging functionality a particular token may require.

The standard ERC-20 gateway

By default, any ERC-20 token on L1 that isn't registered to a gateway can be permissionlessly bridged through the StandardERC20Gateway.

You can use the bridge UI or follow the instructions in How to bridge tokens via Arbitrum’s standard ERC-20 gateway to bridge a token to L2 via this gateway.

Example: Standard Arb-ERC20 deposit and withdraw

To help illustrate what this all looks like in practice, let's go through the steps of what depositing and withdrawing SomeERC20Token via our standard ERC-20 gateway looks like. Here, we're assuming that SomeERC20Token has already been registered in the L1GatewayRouter to use the standard ERC-20 gateway.

Deposits

  1. A user calls L1GatewayRouter.outboundTransferCustomRefund [1] (with SomeERC20Token's L1 address as an argument).
  2. L1GatewayRouter looks up SomeERC20Token's gateway, and finds that it's the standard ERC-20 gateway (the L1ERC20Gateway contract).
  3. L1GatewayRouter calls L1ERC20Gateway.outboundTransferCustomRefund, forwarding the appropriate parameters.
  4. L1ERC20Gateway escrows the tokens sent and creates a retryable ticket to trigger L2ERC20Gateway's finalizeInboundTransfer method on L2.
  5. L2ERC20Gateway.finalizeInboundTransfer mints the appropriate amount of tokens at the arbSomeERC20Token contract on L2.

❗️ [1] Please keep in mind that some older custom gateways might not have outboundTransferCustomRefund implemented and L1GatewayRouter.outboundTransferCustomRefund does not fallback to outboundTransfer. In those cases, please use function L1GatewayRouter.outboundTransfer.

Note that arbSomeERC20Token is an instance of StandardArbERC20, which includes bridgeMint and bridgeBurn methods only callable by the L2ERC20Gateway.

Withdrawals

  1. On Arbitrum, a user calls L2GatewayRouter.outBoundTransfer, which in turn calls outBoundTransfer on arbSomeERC20Token's gateway (i.e., L2ERC20Gateway).
  2. This burns arbSomeERC20Token tokens, and calls ArbSys with an encoded message to L1ERC20Gateway.finalizeInboundTransfer, which will be eventually executed on L1.
  3. After the dispute window expires and the assertion with the user's transaction is confirmed, a user can call Outbox.executeTransaction, which in turn calls the encoded L1ERC20Gateway.finalizeInboundTransfer message, releasing the user's tokens from the L1ERC20Gateway contract's escrow.

The Arbitrum generic-custom gateway

Just because a token has requirements beyond what are offered via the standard ERC-20 gateway, that doesn't necessarily mean that a unique gateway needs to be tailor-made for the token in question. Our generic-custom gateway is designed to be flexible enough to be suitable for most (but not necessarily all) custom fungible token needs. As a general rule:

If your custom token has the ability to increase its supply (i.e., mint) directly on the L2, and you want the L2-minted tokens be withdrawable back to L1 and recognized by the L1 contract, it will probably require its own special gateway. Otherwise, the generic-custom gateway is likely the right solution for you!

Some examples of token features suitable for the generic-custom gateway:

  • An L2 token contract upgradable via a proxy
  • An L2 token contract that includes address whitelisting/blacklisting
  • The deployer determines the address of the L2 token contract

Setting up your token with the generic-custom gateway

Follow the following steps to get your token set up to use the generic-custom gateway. You can also find more detailed instructions in the page How to bridge tokens via Arbitrum’s generic-custom gateway.

0. Have an L1 token

Your token on L1 should conform to the ICustomToken interface (see TestCustomTokenL1 for an example implementation). Crucially, it must have an isArbitrumEnabled method in its interface.

1. Deploy your token on Arbitrum

Your token should conform to the minimum IArbToken interface; i.e., it should have bridgeMint and bridgeBurn methods only callable by the L2CustomGateway contract, and the address of its corresponding Ethereum token accessible via l1Address. For an example implementation, see TestArbCustomToken.

2. Register your token on L1 to your token on L2 via the L1CustomGateway contract

Have your L1 token's contract make an external call to L1CustomGateway.registerTokenToL2. This registration can alternatively be performed as a chain-owner registration via an Arbitrum DAO proposal.

3. Register your token on L1 to the L1GatewayRouter

After your token's registration to the generic-custom gateway is complete, have your L1 token's contract make an external call to L1GatewayRouter.setGateway; this registration can also alternatively be performed as a chain-owner registration via an Arbitrum DAO proposal.

We are here to help

If you have questions about your custom token needs, feel free to reach out on our Discord server.

Other flavors of gateways

Note that in the system described above, one pair of gateway contracts handles the bridging of many ERC-20s; i.e., many ERC-20s on L1 are each paired with their own ERC-20s on Arbitrum via a single gateway contract pairing. Other gateways may well bear different relations with the contracts that they bridge.

Take our wrapped Ether implementation for example: here, a single WETH contract on L1 is connected to a single WETH contract on L2. When transferring WETH from one domain to another, the L1/L2 gateway architecture is used to unwrap the WETH on domain A, transfer the now-unwrapped Ether, and then re-wrap it on domain B. This ensures that WETH can behave on Arbitrum the way users are used to it behaving on Ethereum, while ensuring that all WETH tokens are always fully collateralized on the layer in which they reside.

No matter the complexity of a particular token's bridging needs, a gateway can in principle be created to accommodate it within our canonical bridging system.

You can find an example of implementation of a custom gateway in the page How to bridge tokens via a custom gateway.

Demos

Our How to bridge tokens section provides example of interacting with Arbitrum's token bridge via the Arbitrum SDK.

A word of caution on bridges (aka, "I've got a bridge to sell you")

Cross chain bridging is an exciting design space; alternative bridge designs can potentially offer faster withdrawals, interoperability with other chains, different trust assumptions with their own potentially valuable UX tradeoffs, etc. They can also potentially be completely insecure and/or outright scams. Users should treat other, non-canonical bridge applications the same way they treat any application running on Arbitrum, and exercise caution and due diligence before entrusting them with their value.

As an expert in blockchain protocols and layer 2 scaling solutions, I have extensive knowledge of the Arbitrum protocol and its underlying concepts. I've been actively involved in the development and understanding of layer 2 solutions, and I can provide insights into the technical aspects of the Arbitrum protocol.

In the article you provided, several key concepts related to the Arbitrum protocol and its token bridging functionality are discussed. Let's break down the information and provide additional insights:

  1. Arbitrum Protocol Overview:

    • The Arbitrum protocol serves as a layer 2 scaling solution for Ethereum.
    • It introduces a decentralized app (dApp) known as the "canonical bridge" implemented by Offchain Labs.
    • The canonical bridge operates on both Ethereum (Layer 1) and Arbitrum (Layer 2) and uses Arbitrum's cross-chain message passing system for token bridging functionality.
  2. Gateway and Bridging System Design:

    • The term "gateway" is introduced as a pair of contracts on Ethereum and Arbitrum, facilitating cross-domain asset transfers.
    • Core goals of the bridging system include providing standard bridging functionality and supporting custom gateways for tokens with specific requirements.
  3. Canonical L2 Representation per L1 Token Contract:

    • To avoid confusion, there is a need for a canonical address oracle that maps tokens across Ethereum and Arbitrum domains.
    • The article emphasizes having a single representation of an L1 token on the L2 to prevent friction and confusion for users and developers.
  4. Token Bridging Architecture:

    • The architecture comprises three types of contracts: Asset contracts (ERC-20 tokens), Gateways (cross-chain asset bridging contracts), and Routers (route assets to designated gateways).
    • Ethereum to Arbitrum and vice versa transfers are initiated through router contracts, ensuring proper communication between L1 and L2.
  5. Standard ERC-20 Gateway:

    • A default gateway, the StandardERC20Gateway, is introduced for bridging ERC-20 tokens that aren't registered to a specific gateway.
    • Users can utilize the bridge UI or follow instructions to bridge tokens via Arbitrum's standard ERC-20 gateway.
  6. Generic-Custom Gateway:

    • A generic-custom gateway is designed to accommodate custom fungible tokens with specific requirements.
    • Tokens with features such as upgradability via proxy, address whitelisting/blacklisting, or L2 supply increase can utilize this flexible gateway.
  7. Setting Up Tokens with the Generic-Custom Gateway:

    • The process involves deploying the token on L1, deploying it on Arbitrum, registering the token on L1 to the token on L2, and registering the token on L1GatewayRouter.
  8. Other Flavors of Gateways:

    • Different gateway relationships are mentioned, such as one pair of gateways handling many ERC-20 tokens or individual gateways for specific tokens.
    • The example of wrapped Ether (WETH) implementation illustrates a specific case where a single WETH contract on L1 is connected to a WETH contract on L2.
  9. Demos and Caution:

    • The article provides demonstrations and examples of interacting with Arbitrum's token bridge via the Arbitrum SDK.
    • Users are cautioned about the potential risks associated with non-canonical bridge applications and are advised to exercise caution and due diligence.

This breakdown demonstrates a comprehensive understanding of the Arbitrum protocol and its token bridging mechanisms. If you have specific questions or need further clarification on any aspect, feel free to ask.

Token bridge: Bridging ERC-20 tokens | Arbitrum Docs (2024)

FAQs

How to bridge ERC-20 to arbitrum? ›

Select the token you want to bridge in the token drop-down menu. You can also enable/disable the token lists by clicking Manage token lists button on the bottom right corner of the drop-down menu. Enter the amount of ETH or ERC-20 tokens you want to bridge over in the From box and then press Move funds .

How long does it take to bridge ETH to arbitrum? ›

Wait for your cross-chain bridge transaction to Arbitrum to complete. You will then receive your bridged tokens on Arbitrum. Please Note: Most cross-chain transfers are completed almost instantaneously, however some may take as long as 20 minutes to complete depending on how much traffic the chain is experiencing.

What is the arbitrum docs token? ›

The $ARB token is minted by a smart contract that lives on Arbitrum One, a Layer 2 Arbitrum rollup chain. The Arbitrum DAO is responsible for managing both the governance protocol as defined within the Constitution, and the technologies that the DAO governs.

How much does it cost to launch an ERC20 token? ›

On average, the cost to create ERC20 token lies between $5000 to $10,000, depending on the type of token developed and business requirements.

How much gas does ERC20 token cost? ›

The gas limit (units of gas used)​

A normal transaction sending ETH or a token normally costs 21,000 gas, whereas an ERC-20 token approval requires 45,000. Many networks, such as EVM-compatible blockchain Harmony, use an identical model in which standard transactions also cost 21,000 gas.

How to bridge ERC-20 to TRC20? ›

The bridging process is simple and intuitive for newcomers. Select the desired asset and chain of your choice on the bridge UI, connect the wallets or paste the destination address, and initiate the transaction. Allbridge Core will then perform a cross-chain swap and exchange ERC20 to TRC20.

Is Across Bridge safe? ›

Is Cross-Chain Bridging Safe? It depends on the programming and security provided. Some bridges might be more safe than others, but they are all vulnerable to hacking because they are software that connects to the internet.

How long does it take to bridge a token? ›

First you lock your crypto in a smart contract on the blockchain network you're bridging from, and then you'll receive crypto from the network you're bridging to. For example if a user is bridging from Ethereum to Polygon, the first transaction on Ethereum typically takes 10-20min.

Is the celer bridge safe? ›

As at the time of writing, cBridge supported the transfer of 137 tokens across 38 chains via 797 bridges. You can view the complete list of supported assets here. cBridge has made a name for itself as it is regarded as one of the most secure and easy-to-use bridges.

How much does it cost to bridge to arbitrum? ›

How much does it cost to bridge Ethereum to Arbitrum? Depending on the cost of ETH and network demand, bridging from Ethereum to Arbitrum can cost $10 and up. Gas fees for bridging are paid on the Ethereum network.

How much is 1 arbitrum token worth? ›

Price of ARB today

The live price of Arbitrum is $ 0.698138 per (ARB / USD) with a current market cap of $ 2.26B USD. 24-hour trading volume is $ 129.12M USD. ARB to USD price is updated in real-time. Arbitrum is -0.19% in the last 24 hours with a circulating supply of 3.23B.

Is arbitrum erc 20 token? ›

ARB is the native ERC-20 Governance token for the Arbitrum Blockchain, which is Designed to enhance scaling solutions for Ethereum. Holders of $ARB tokens can transfer value, vote on Governance Decisions, and Participate in the Arbitrum ecosystem.

How do I know if my token is ERC-20? ›

You can use a tool or library to call these functions on the target address. Evaluating Return Values: If the function calls succeed and return valid values (e.g., a non-zero balance or a total token supply), it's a strong indication that you're dealing with an ERC20 token contract.

How to make ERC20 token tradable? ›

To make your token tradable, you need to create a liquidity pool on a DEX. We'll use Uniswap on a supported test network. ℹ️ A liquidity pool requires a pair of tokens, typically your token and something like ETH or a stablecoin. Traders can then swap between the two.

Top Articles
The Rise of Radar-Based UAV Detection For Military: A Game-Changer in Modern Warfare
Can You Sell a Financed Phone?
Safety Jackpot Login
Blorg Body Pillow
Genesis Parsippany
Trevor Goodwin Obituary St Cloud
Ffxiv Shelfeye Reaver
Combat level
Tyson Employee Paperless
Repentance (2 Corinthians 7:10) – West Palm Beach church of Christ
Driving Directions To Fedex
How to change your Android phone's default Google account
Comcast Xfinity Outage in Kipton, Ohio
craigslist: south coast jobs, apartments, for sale, services, community, and events
Www Craigslist Louisville
Paula Deen Italian Cream Cake
The Haunted Drury Hotels of San Antonio’s Riverwalk
Lesson 3 Homework Practice Measures Of Variation Answer Key
Youtube Combe
Moe Gangat Age
Simon Montefiore artikelen kopen? Alle artikelen online
Hartland Liquidation Oconomowoc
Viha Email Login
Nba Rotogrinders Starting Lineups
Saatva Memory Foam Hybrid mattress review 2024
13301 South Orange Blossom Trail
Cal State Fullerton Titan Online
8002905511
Craigslist Gigs Norfolk
Phone number detective
Palmadise Rv Lot
2012 Street Glide Blue Book Value
Seymour Johnson AFB | MilitaryINSTALLATIONS
Orangetheory Northville Michigan
Naya Padkar Newspaper Today
The Blackening Showtimes Near Regal Edwards Santa Maria & Rpx
Los Garroberros Menu
Mckinley rugzak - Mode accessoires kopen? Ruime keuze
All Obituaries | Sneath Strilchuk Funeral Services | Funeral Home Roblin Dauphin Ste Rose McCreary MB
Chathuram Movie Download
Valls family wants to build a hotel near Versailles Restaurant
Citizens Bank Park - Clio
About Us
Top 1,000 Girl Names for Your Baby Girl in 2024 | Pampers
8 4 Study Guide And Intervention Trigonometry
Theater X Orange Heights Florida
Skyward Login Wylie Isd
Tommy Gold Lpsg
Marion City Wide Garage Sale 2023
Bomgas Cams
Tamilyogi Cc
Ff14 Palebloom Kudzu Cloth
Latest Posts
Article information

Author: Trent Wehner

Last Updated:

Views: 6129

Rating: 4.6 / 5 (76 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Trent Wehner

Birthday: 1993-03-14

Address: 872 Kevin Squares, New Codyville, AK 01785-0416

Phone: +18698800304764

Job: Senior Farming Developer

Hobby: Paintball, Calligraphy, Hunting, Flying disc, Lapidary, Rafting, Inline skating

Introduction: My name is Trent Wehner, I am a talented, brainy, zealous, light, funny, gleaming, attractive person who loves writing and wants to share my knowledge and understanding with you.