Skip to main content

Ankr Bridge mechanics

Smart contracts

Smart contracts involved in bridging Liquid Staking tokens are:

  • Ankr Bridge on Avalanche (0x31BE0FA706E391a88C3A09cC13112bd55E0887f5) — sends assets to other blockchains from Avalanche and receives assets sent to Avalanche.
  • Ankr Bridge on Binance (0xc437df90b37c1db6657339e31bfe54627f0e7181) — sends assets to other blockchains from Binance and receives assets sent to Binance.
  • Ankr Bridge on Ethereum (0xc437df90b37c1db6657339e31bfe54627f0e7181) — sends assets to other blockchains from Ethereum and receives assets sent to Ethereum.
  • Ankr Bridge on Fantom (0x31BE0FA706E391a88C3A09cC13112bd55E0887f5) — sends assets to other blockchains from Fantom and receives assets sent to Fantom.
  • Ankr Bridge on Polygon (0x31be0fa706e391a88c3a09cc13112bd55e0887f5) — sends assets to other blockchains from Polygon and receives assets sent to Polygon.

Briding workflow

The mechanics of what's going on under the hood when a user transfers their funds between networks can be described as following:

  1. The user has Ankr Liquid Staking tokens on the network where our smart contract minted them for said user.
  2. The user wants to transfer them onto another network. They visit Ankr Bridge, choose the amount to be transferred and click Approve. That causes Ankr Bridge to call the approve() function of the bridging smart contract to allow transfer of the assets. From the user side, it looks like they approve the operation in their MetaMask.
  3. The user clicks Send on the page, which causes Ankr Bridge to call the deposit() function to transfer the assets to the destination network. This operation is called peg-in.
  4. The user's assets are now locked on Ankr Bridge and the user gets the transaction hash.
  5. The user sends the transaction hash to Ankr backend for notarization.
  6. The user clicks Switch on the page and switches to the destination network.
  7. The user clicks Receive, which causes Ankr Bridge to call the withdraw() function (both for ERC-20 or native tokens). This operation is called peg-out.
  8. The user sees the transferred assets deposited to their wallet on the destination network.

To sum up, the flow in any direction is the same: approve() (if necessary) -> deposit() -> notarize -> withdraw().