Skip to main content

How bridging FA tokens works

The bridge uses tickets to send tokens from the source network to the target network.

Bridge contracts

Three types of contracts work together to bridge FA tokens between Tezos layer 1 and Etherlink EVM:

  • Ticketer contract: Stores tokens and issues tickets that represent them.
  • Token bridge helper contract: Handles bridging requests on layer 1 and coordinates ticket transfers.
  • ERC-20 proxy contract: Stores tickets and mints ERC-20 tokens that are equivalent to the FA tokens in layer 1.

These contracts implement the TZIP-029 standard for token bridging.

To deposit FA tokens, users first grant access to their tokens (an allowance for FA1.2 tokens or operator status for FA2 tokens). Then they call the deposit entrypoint on the token bridge helper contract.

The deposit process works like this:

  1. The user grants the token bridge helper contract access to their tokens.
  2. The user calls the token bridge helper contract's deposit entrypoint.
  3. The token bridge helper contract transfers the tokens to the ticketer contract.
  4. The ticketer contract issues a ticket that represents the tokens.
  5. The token bridge helper contract sends the ticket to the Etherlink Smart Rollup.
  6. The Etherlink kernel processes the ticket and makes the tokens available on Etherlink EVM.
  7. An automated system calls the ERC-20 proxy contract's claim function, which mints equivalent ERC-20 tokens in the user's Etherlink EVM account.

To withdraw FA tokens from Etherlink EVM back to layer 1:

  1. The user calls the FA bridging precompiled contract with the details of the withdrawal, including the target layer 1 address.
  2. The proxy contract sends the information about the withdrawal to the helper contract by putting it in a transaction in the Smart Rollup outbox.
  3. After the commitment is cemented on layer 1, anyone can execute the outbox transaction.
  4. The helper contract receives the ticket from the outbox transaction.
  5. The helper contract calls the ticketer contract to burn the ticket.
  6. The ticketer contract transfers the original tokens to the specified layer 1 address.

Both processes rely on an implementation accessible at https://github.com/baking-bad/etherlink-bridge.

arrow icon

Prev

Bridging FA tokens

Next

arrow icon
Sending FA bridging transactions