3. How to use an Orbit Bridge
** 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 BSC vault contracts) 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,CELOvaults.
Details
deposit(string memory toChain, bytes memory toAddr) payabletoChain: Chain symbol to send assets.toAddr: Address to receive bridged assets. ** You must send a transaction with value for the amount to be sent.
toChain: Chain symbol to send assetstoAddr: Address to receive bridged assetsamount: The amounts of tokens to send (wei)
Example
Bridge 0.1 ETH from ETH to KLAYTN
ETH is a
native assetof the Ethereum chain.In this case, call the
depositmethod to the ETH vault contract.contract address: 0x1bf68a9d1eaee7826b3593c20a0ca93293cb489a
2. Bridge 10 BUSD from BNB to MATIC
BUSD is an
ERC20token based on the BNB chain.In this case, call the
depositTokenmethod to Bsc vault contract.contract address: 0x89c527764f03BCb7dC469707B23b79C1D7Beb780
Minter Contract Interface
You can use the minter to send bridged assets to the origin chain or another chain.
In this case, only use
requestSwapDepending 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
Returns unique bytes32 data for each chain.
chain: Chain symbol to send assets.
Returns chain fee for each chain.
chainId: bytes32 data fromgetChainIdmethod.
token: Address of origin asset. For native assets, it is0x0000000000000000000000000000000000000000
tokenAddress: Returned value usinggetTokenAddresstoChain: Chain symbol to send assets.toAddr: Address to receive bridged assets.amount: The amounts of tokens to send (wei)
Example
Bridge 0.1 oETH from KLAYTN to ETH
oETH on Klaytn is a bridged
ERC20token from Eth.ETH is a native asset of the Ethereum chain.
In this case, use the Klaytn minter contract of Eth vault
contract address: 0x60070F5D2e1C1001400A04F152E7ABD43410F7B9
2. Bridge 10 oBUSD from MATIC to HECO
oBUSD on Matic is a bridged
ERC20from BNB chain.BUSD is an
ERC20based on the BNB chain.To bridge oBUSD from Matic to Heco, use Matic minter contract of Bsc vault
contract address: 0x89c527764f03BCb7dC469707B23b79C1D7Beb780
STACKS
Minter Contract Interface
In the case of Stacks, there is a minter corresponding to each bridged token.
to-chain: Chain to send assets. This value can get using bufferCVFromString (see @stacks/transactions)to-addr: Address to receive bridged assets.
Last updated
Was this helpful?