sendToFx
sendToFx cross chain means that the contract deployed on other chains communicates with f(x)Core through cross chain bridge to realize cross chain with f(x)Core.
supported external chains:
Ethereum
Binance Smart Chain
Polygon
Tron
Avalanche
Optimism
Arbitrum
Bridge Contract
Chain | Contract Address |
---|---|
Ethereum | |
Binance Smart Chain | |
Polygon | |
Tron | |
Avalanche | |
Base |
Method
sendToFx
send token from external chain to f(x)Core
must be approved before calling this method
_tokenContract
: the contract address of the token on the external chain_destination
: the destination address on the f(x)Core chain or other cosmos chain_targetIBC
: the target of the token on the f(x)Core chain(more details see Target)_targetIBC represents cross chain destination, such as
f(x)Core
,Pundix
,Marginx
destination f(x)Core: _targetIBC is empty
destination erc20 token: _targetIBC is
erc20
destination other cosmos chain(example Pundix): _targetIBC is
ibc/{id}/{prefix}
.id
is the channel id of the target chain on f(x)Core(examples: Pundix: 0)prefix
is the address prefix of the target chain(examples: Pundix: px)
_amount
: the amount of the token to be cross chain
_destination convert address to bytes, if less than 32, fill in 0 in front, until 32 bytes
_targetIBC convert string to bytes, if less than 32, fill in 0 in behind, until 32 bytes
getBridgeTokenList
get cross chain token list
BridgeToken struct
checkAssetStatus
check if the token is supported cross chain
_tokenAddr
: the contract address of the token on the external chainstatus
: true means good condition
Last updated