Orbit Bridge
  • Introduction
  • Overview
  • Core Concept
  • How it works
    • Features
    • Differentiation
    • Bridge Validator
    • Bridge Operator
    • Governance
  • Bridging Transactions
    • Ethereum
    • BNB Chain
    • Klaytn
    • Heco
    • Polygon
    • Celo
    • ICON
    • XRP
  • Validator Guide
    • Notes for Validator Nodes
    • Hardware Specifications
    • Validator Reward Structure
    • Quick Start
    • REST API
    • Configuration
    • Troubleshooting
  • Operator Guide
    • Hardware Specifications
    • Quick Start
    • REST API
    • Configuration
    • Troubleshooting
  • Official Bridge Governance
  • Token Registration for Bridging
    • Registration Using Etherscan
    • Registration Using Remix
    • Bridge to The Open Network(TON)
      • Registration on TON Using Etherscan
      • Registration on TON Using Remix
  • FAQ
    • General [EN]
    • General [KO]
    • Gas Fee Guide [EN]
    • Gas Fee Guide [KO]
    • Guide for Adding RPC Network [EN]
    • Guide for Adding RPC Network [KO]
    • Anti-Phishing [EN]
    • Anti-Phishing [KO]
    • Transaction delay after setting the gas fee
    • Integration Guide
      • 1. List of supported chains
      • 2. Contract Addresses
      • 3. How to use an Orbit Bridge
      • 4. Chain Explorers
      • 5. API
  • Contract
    • OrbitHub
    • Bridge
      • Ethereum
      • BNB Chain
      • Klaytn
      • Heco
      • Polygon
      • Celo
      • ICON
      • XRP
    • Vault (Layer 1)
      • Ethereum
      • BNB Chain
      • Klaytn
      • Heco
      • Polygon
      • Celo
      • XRP
    • Minter (Layer 2)
      • Ethereum
      • Avalanche
      • BNB Chain
      • Klaytn
      • Celo
      • Fantom
      • Harmony
      • Polygon
      • Moonriver
      • OKExChain
      • Orbit
      • Gnosis
      • ICON
      • XRP
    • BridgeReceiver
    • Governance
    • Glossary
  • LINK
    • Orbit Bridge Github
    • Orbit Bridge Website
  • POLICIES
    • Layer Fee
    • Bridge Fee
      • Current
      • History
        • Ethereum Layer1
        • BNB Layer 1
        • Ripple Layer 1
        • Klaytn Layer 1
    • Terms of Use [EN]
    • Terms of Use [KO]
  • Bridging Assets
    • Ethereum Layer 1
    • Ripple Layer 1
    • BNB Layer 1
  • CROSS CHAIN TIPS
    • ICON
    • Celo
    • HECO
    • XRP
Powered by GitBook
On this page
  • EVM
  • Vault Contract Interface
  • Minter Contract Interface
  • STACKS
  • Minter Contract Interface

Was this helpful?

  1. FAQ
  2. Integration Guide

3. How to use an Orbit Bridge

Previous2. Contract AddressesNext4. Chain Explorers

Last updated 2 years ago

Was this helpful?

** The chain parameter should have the following format:

ETH, ORBIT, KLAYTN, BSC, MATIC, HECO, CELO, AVAX, FANTOM, HARMONY, MOONRIVER, OEC, XDAI

EVM

Vault Contract Interface

interface IVault {
    function deposit(string memory toChain, bytes memory toAddr) payable public;
    function depositToken(address token, string memory toChain, bytes memory toAddr, uint amount) public; 
}
  • You can use the vault to bridge assets to other chains which deployed minter. (ex) Bsc vault has only Klaytn, Orbit, Heco and Matic minter. (See ) BNB can bridge to Heco. But cannot bridge to Fantom.

  • If you want to bridge native assets like ETH or BNB, use deposit.

  • Otherwise, if you want to bridge ERC20, use depositToken.

  • Orbit Bridge has ETH, KLAYTN, BSC, MATIC, HECO, CELO vaults.

Details

deposit(string memory toChain, bytes memory toAddr) payable
  • toChain: Chain symbol to send assets.

  • toAddr: Address to receive bridged assets. ** You must send a transaction with value for the amount to be sent.

depositToken(address token, string memory toChain, bytes memory toAddr, uint amount)
  • toChain: Chain symbol to send assets

  • toAddr: Address to receive bridged assets

  • amount: The amounts of tokens to send (wei)

Example

  1. Bridge 0.1 ETH from ETH to KLAYTN

  • ETH is a native asset of the Ethereum chain.

  • In this case, call the deposit method to the ETH vault contract.

deposit("KLAYTN", <to address>){value: 100000000000000000}

2. Bridge 10 BUSD from BNB to MATIC

  • BUSD is an ERC20 token based on the BNB chain.

  • In this case, call the depositToken method to Bsc vault contract.

depositToken("MATIC", <to address>, 10000000000000000000)

Minter Contract Interface

interface IMinter {
    function getChainId(string chain) external view returns (bytes32);
    function chainFee(bytes32 chainId) external view returns (uint256);
    function getTokenAddress(bytes memory token) public view returns(address);
    function requestSwap(address tokenAddress, string memory toChain, bytes memory toAddr, uint amount) public payable;
}
  • You can use the minter to send bridged assets to the origin chain or another chain.

  • In this case, only use requestSwap

  • Depending on the chain, there may be a chain fee.

  • If there is a chain fee, you need to send a transaction by putting it in value.

  • Minted Tokens have the prefix ‘o’ which means bridged by an Orbit Bridge. (oUSDT, oBUSD, oXRP, oETH etc…)

Details

getChainId(string chain)  

Returns unique bytes32 data for each chain.

  • chain: Chain symbol to send assets.

chainFee(bytes32 chainId)

Returns chain fee for each chain.

  • chainId: bytes32 data from getChainId method.

getTokenAddress(bytes memory token)
  • token: Address of origin asset. For native assets, it is 0x0000000000000000000000000000000000000000

requestSwap(address tokenAddress, string memory toChain, bytes memory toAddr, uint amount)
  • tokenAddress: Returned value using getTokenAddress

  • toChain: Chain symbol to send assets.

  • toAddr: Address to receive bridged assets.

  • amount: The amounts of tokens to send (wei)

Example

  1. Bridge 0.1 oETH from KLAYTN to ETH

  • oETH on Klaytn is a bridged ERC20 token from Eth.

  • ETH is a native asset of the Ethereum chain.

  • In this case, use the Klaytn minter contract of Eth vault

requestSwap(
    "0x0000000000000000000000000000000000000000"
    , "KLAYTN"
    , <to address>
    , 100000000000000000 // 0.1 * 10 ** 18
){value: 100000000000000000} // chainFee

2. Bridge 10 oBUSD from MATIC to HECO

  • oBUSD on Matic is a bridged ERC20 from BNB chain.

  • BUSD is an ERC20 based on the BNB chain.

  • To bridge oBUSD from Matic to Heco, use Matic minter contract of Bsc vault

requestSwap(
    "0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56" // origin BUSD address
    , "HECO"
    , <to address>
    , 10000000000000000000 // 10 * 10 ** 18
){value: 100000000000000000} // chainFee

STACKS

Minter Contract Interface

(request-swap (to-chain (buff 256)) (to-addr (buff 20)) (amount uint))

In the case of Stacks, there is a minter corresponding to each bridged token.

  • to-addr: Address to receive bridged assets.

contract address:

contract address:

contract address:

contract address:

to-chain: Chain to send assets. This value can get using bufferCVFromString (see )

@stacks/transactions
BSC vault contracts
0x1bf68a9d1eaee7826b3593c20a0ca93293cb489a
0x89c527764f03BCb7dC469707B23b79C1D7Beb780
0x60070F5D2e1C1001400A04F152E7ABD43410F7B9
0x89c527764f03BCb7dC469707B23b79C1D7Beb780