Native Bridge
The Autobahn Network comes with a native bridging functionality deployed via smart contracts both on L1 and L2. This chapter explains how you can build a custom frontend for the bridge.

Deposit TXL

TXL is being used as gas in the Autobahn Network. This chapter describes how you can get TXL into the network.

Approve TXL

As TXL is an ERC20 token L1 (BNB Chain) the native bridge contract must be approved to spend TXL first. This can be done by calling the approve function on the TXL contract. Pass 0x159291Ef9bC373C3d362506355Bc9D4505fF3Bfc as the spender argument and at minimum the amount you want to deposit.

Execute the Deposit

To deposit TXL from L1 to L2 (Autobahn Network Canary) you must interact with the L1StandardBridge contract on BSC. To do so, transactions must go through the proxy contract L1ChugSplashProxy deployed at:
L1ChugSplashProxy (L1 -> L2): 0x159291ef9bc373c3d362506355bc9d4505ff3bfc
To bridge TXL the depositERC20 method must be called with the parameters in the table below. After submitting the call, TXL will be automatically credited on L2 after a few minutes.
Parameter Name
Parameter Value
Comment
_l1Token
0x1ffd0b47127fdd4097e54521c9e2c7f0d66aafc5
The address of TXL on BNB Chain.
_l2Token
0x3BbbDA5C690a1b5B3988309EBeDe453e371EC899
TXL on the Autobahn Network Canary (internal contract for native gas)
_amount
<amount>
The amount to bridge as an uint256. E.g. 1000000000000000000 for 1 full TXL.
_l2Gas
1000000
The gas to be used to actually transfer the funds on L2.
_data
0x
An optional message to be passed as bytes.

Deposit BNB

Even if TXL is used as gas on L2 you might want to bridge BNB into the network. Here it should be noted that there is no native BNB on L2 but only WBNB (Wrapped BNB). Wrapped BNB is an ERC20 compatible version of BNB.
To deposit BNB from L1 (BNB Chain) to L2 (Autobahn Network Canary) you must interact with the same contract as for bridging TXL (see Deposit TXL). The difference is that you must call the method depositETH. Don't be frustrated by the ETH in the method. This is due to the code being forked from Ethereum related codebase. Use the following params to deposit BNB.
Parameter Name
Parameter Value
Comment
payableAmount (msg.value)
<amount>
The amount to bridge as an uint256. E.g. 1000000000000000000 for 1 full BNB. If you go through the bscscan frontend, they might add the zeros for you.
_l2Gas
1000000
The gas to be used to actually transfer the funds on L2.
_data
0x
An optional message to be passed as bytes.

Withdrawing from L2

Due to the nature of the Autobahn Network Canary being an optimistic rollup, regular withdrawals are processed after a 7-day challenge window. That means that after submitting the withdrawal on L2, you must wait 7 days before you can claim your funds on L1. In the near future, a so-called fast-exit bridge will be provided by the Cross-Chain Bridge team to support instant withdrawals.
To initiate a withdrawal, you must call the withdraw method on the L2StandardBridge which is deployed at:
L2StandardBridge (L2 -> L1): 0x4200000000000000000000000000000000000010
The following parameters are accepted:
Parameter Name
Parameter Value
Text
_l2Token
<address>
The address of the token you want to withdraw. For TXL that is 0x3BbbDA5C690a1b5B3988309EBeDe453e371EC899.
_amount
<amount>
The amount to bridge as an uint256. E.g. 1000000000000000000 for 1 full TXL.
_l1Gas
1000000
The gas to be used to actually transfer the funds on L1.
_data
0x
An optional message to be passed as bytes.
In comparison to bridgings from L1 to L2, a bridging from L2 to L1 must be claimed by the user on L1. It will cost some gas. Also it can only be done after the 7-day challenge period mentioned above and only if nobody fraud proved your withdrawal. If you want to read more about the challenge period, we recommend this source.
The withdrawal finalisation is a bit more complicated and a documentation will follow shortly. In the meantime we recommend this tutorial to get an idea of how it works.

Contract ABIs and Addresses

Here are the most important contract ABIs and addresses you need to interact with the bridge.
L1StandardBridgeCustomGas.json
9KB
Code
L1CrossDomainMessenger.json
10KB
Code

Cross-Chain Bridge Support

The CrossChainBridge.org developers are already working on building the native gateway for BNB in their frontend. In addition, at a later stage, the CrossChainBridge.org will act as a fast bridge. Using the fast bridge, which works with deposits into, and withdrawals from, liquidity pools provided in both networks and thus circumvents the 7-day fraud proof window, users can withdraw and deposit in just 1-5 minutes, depending on block times. The fast exit will be available for BNB and any other token supported by the Autobahn Network - if sufficient liquidity is available within CrossChainBridge.org.