The Standard Bridge
Learn the basics of using the Standard Bridge to move tokens between Layer 1 and Layer 2.
Using the Standard Bridge
The Standard Bridge is a basic token bridging system available on Adventure Layer Testnet and all other standard OP Stack chains. The Standard Bridge allows you to easily move ETH and most ERC-20 tokens between Ethereum and Adventure Layer Testnet. Transfers from Ethereum to Adventure Layer Testnet via the Standard Bridge are usually completed within 1-3 minutes. Transfers from Adventure Layer Testnet to Ethereum are completed in 7 days as a result of the withdrawal challenge period.
The Standard Bridge is fully permissionless and supports standard ERC-20 tokens. Other bridging systems also exist that provide different features and security properties. You may wish to explore some of these options to find the bridge that works best for you and your application.
Design
The Standard Bridge allows users to convert tokens that are native to one chain (like Ethereum) into a representation of those tokens on the other chain (like Adventure Layer Testnet). Users can then convert these bridged representations back into their original native tokens at any time.
This bridging mechanism functions identically in both direction — tokens native to Adventure Layer Testnet can be bridged to Ethereum, just like tokens native to Ethereum can be bridged to Adventure Layer Testnet. Here you’ll get to understand how the Standard Bridge works when moving tokens from Ethereum to Adventure Layer Testnet. Since the bridging mechanism is mirrored on both sides, this will also explain how the bridge works in the opposite direction.
Architecture
The Standard Bridge is composed of two contracts, the L1StandardBridge
(on Ethereum
) and the L2StandardBridge
(on Adventure Layer Testnet
).
These two contracts interact with one another via the CrossDomainMessenger
system for sending messages between Ethereum and Adventure Layer Testnet.
You can read more about the CrossDomainMessenger
in the guide on Sending Data Between L1 and L2.
Bridged Tokens
The Standard Bridge utilizes bridged representations of tokens that are native to another blockchain. Before a token native to one chain can be bridged to the other chain, a bridged representation of that token must be created on the receiving side.
A bridged representation of a token is an ERC-20 token that implements the IOptimismMintableERC20
interface.
This interface includes a few functions that the StandardBridge
contracts use to manage the bridging process.
All bridged versions of tokens must implement this interface to be used with the StandardBridge
.
Native tokens do not need to implement this interface.
A native token may have more than one bridged representation at the same time. Users must always specify which bridged token they wish to use when using the bridge. Different bridged representations of the same native token are considered entirely independent tokens.
Bridging Native Tokens
The Standard Bridge uses a “lock-and-mint” mechanism to convert native tokens into their bridged representations. This means that native tokens are locked into the Standard Bridge on one side, after which bridged tokens are minted on the other side. The process for bridging a native token involves a few steps.
bridgeERC20To
function on the StandardBridge
contract on the chain where the native token lives (e.g., the L1StandardBridge
contract if the token is native to Ethereum).address _localToken
: Address of the native token on the sending side.address _remoteToken
: Address of the bridged representation on the receiving side.address _to
: Address of the recipient of these tokens, usually the sender’s address.uint256 _amount
: Number of tokens to transfer.uint32 _minGasLimit
: Gas to use to complete the transfer on the receiving side.bytes calldata _extraData
: Optional identify extra data.bridgeERC20To
function while transferring a native token, the Standard Bridge will pull the _amount
of _localToken
tokens from the user’s address and lock them inside of the bridge contract.
A record of all locked tokens are stored within a deposits
mapping that keeps track of the total number of tokens deposited for a given _localToken
and _remoteToken
pair.deposits
token must keep track of the deposit pools for each _localToken
/_remoteToken
pair independently.Token A
, but wish to receive two different bridged tokens, Token B
and Token C
.
Although the Standard Bridge would now have a total balance of 200 units of Token A
, the mapping would show that the Token A
/Token B
pool and the Token A
/Token C
pool both have only 100 units.CrossDomainMessenger
system.
This message tells the receiving side to mint tokens according to the parameters specified by the user.
Specifically, this message is an encoded call to the finalizeBridgeERC20
function on the other Standard Bridge contract.
At this point, execution ends on the sending side.finalizeBridgeERC20
function will be triggered on the receiving Standard Bridge contract.
This function will receive the _minGasLimit
gas defined by the user to execute to completion.finalizeBridgeERC20
verifies a number of things about the incoming request:IOptimismMintableERC20
interface.remoteToken()
.finalizeBridgeERC20
will mint tokens to the recipient equal to the number of tokens originally deposited on the other blockchain.
For this to work properly, the bridged representation of the native token must correctly implement a mint
function that allows the Standard Bridge to mint tokens arbitrarily.
This is part of the IOptimismMintableERC20
interface.Bridging Non-Native Tokens
The Standard Bridge uses a “burn-and-unlock” mechanism to convert bridged representations of tokens back into their native tokens. This means that bridged tokens are burned on the Standard Bridge on one side, after which native tokens are unlocked on the other side. The process for bridging a non-native, bridged representation of a token involves a few steps.
burn
these tokens.
Here, the user calls the bridgeERC20To
function on the StandardBridge
contract on the chain where the bridged token lives (e.g., the L2StandardBridge
contract if the token is bridged to Adventure Layer Testnet).address _localToken
: Address of the bridged token on the sending side.address _remoteToken
: Address of the native token on the receiving side.address _to
: Address of the recipient of these tokens, usually the sender’s address.uint256 _amount
: Number of tokens to transfer.uint32 _minGasLimit
: Gas to use to complete the transfer on the receiving side.bytes calldata _extraData
: Optional identify extra data.bridgeERC20To
function while transferring a bridge token, the Standard Bridge will burn the corresponding _amount
of tokens from the sender’s address.CrossDomainMessenger
system.
This message tells the receiving side to unlock tokens according to the parameters specified by the user.
Specifically, this message is an encoded call to the finalizeBridgeERC20
function on the other Standard Bridge contract.
At this point, execution ends on the sending side.finalizeBridgeERC20
function will be triggered on the receiving Standard Bridge contract.
This function will receive the _minGasLimit
gas defined by the user to execute to completion.finalizeBridgeERC20
verifies a number of things about the incoming request:finalizeBridgeERC20
will unlock and transfer tokens to the recipient equal to the number of tokens originally burned on the other blockchain.Bridging ETH
The Standard Bridge contracts can also be used to bridge ETH from Ethereum to Adventure Layer Testnet and vice versa.
The ETH bridging process is generally less complex than the ERC-20 bridging process.
Users simply need to trigger and send ETH to the bridgeETH
or bridgeETHTo
functions on either blockchain.
Tutorials
- Learn how to bridge ERC-20 tokens with the Adventure Layer SDK
- Learn how to bridge ETH with the Adventure Layer SDK
- Learn how to create a standard bridged token
- Learn how to create a custom bridged token
Superchain Token List
The Superchain Token List exists to help users discover the right bridged token addresses for any given native token. Consider checking this list to make sure that you’re not using the wrong bridged representation of a token when bridging a native token.
Developers who are creating their own bridged tokens should consider adding their token to the Superchain Token List. Tokens on the Superchain Token List will automatically appear on certain tools like the Adventure Layer Bridge UI.
Searching the Token List
You should strongly consider using the Superchain Token List to verify that you’re using the correct bridged representation of a token when bridging a native token. Doing so can help you avoid accidentally bridging to the wrong token and locking up your native token permanently.
You can easily find the bridged representation of a token for Adventure Layer Testnet on the Bridged Token Addresses page. If you want to find the bridged representation of a token for another chain, use the following steps.
Special Considerations
USDC
Circle, the issuer of USDC, natively issues USDC on Adventure Layer Testnet as of September 2023.
Before this service was made available, USDC had to be bridged to Adventure Layer Testnet via the Standard Bridge.
This bridged representation of USDC is referred to as USDC.e
.
Circle recommends that users and developers make use of the native version of USDC issued by Circle over the bridged USDC.e
token. Please note that the bridged USDC.e
token will be deprecated in the near future.
Information about the bridged USDC.e
token and native USDC token can be found below.
Symbol | Description | Address |
---|---|---|
USDC.e | Bridged USDC from Ethereum | 0x7f5c764cbc14f9669b88837ca1490cca17c31607 |
USDC | Native USDC issued by Circle | 0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85 |
Was this page helpful?