IOFTCore

Git Source

Inherits: IERC165

Interface of the IOFT core standard

Functions

estimateSendFee

Estimate send token tokenId to (dstChainId, toAddress)

function estimateSendFee(
    uint16 dstChainId,
    bytes calldata toAddress,
    uint256 amount,
    bool useZro,
    bytes calldata adapterParams
) external view returns (uint256 nativeFee, uint256 zroFee);

Parameters

NameTypeDescription
dstChainIduint16L0 defined chain id to send tokens too
toAddressbytesDynamic bytes array which contains the address to whom you are sending tokens to on the dstChain
amountuint256Amount of the tokens to transfer
useZroboolIndicates to use zro to pay L0 fees
adapterParamsbytesFlexible bytes array to indicate messaging adapter services in L0

sendFrom

Send amount amount of token to (dstChainId, toAddress) from from

function sendFrom(
    address from,
    uint16 dstChainId,
    bytes calldata toAddress,
    uint256 amount,
    address payable refundAddress,
    address zroPaymentAddress,
    bytes calldata adapterParams
) external payable;

Parameters

NameTypeDescription
fromaddressThe owner of token
dstChainIduint16The destination chain identifier
toAddressbytesCan be any size depending on the dstChainId.
amountuint256The quantity of tokens in wei
refundAddressaddress payableThe address LayerZero refunds if too much message fee is sent
zroPaymentAddressaddressSet to address(0x0) if not paying in ZRO (LayerZero Token)
adapterParamsbytesFlexible bytes array to indicate messaging adapter services

circulatingSupply

Returns the circulating amount of tokens on current chain

function circulatingSupply() external view returns (uint256);

Events

SendToChain

Emitted when amount tokens are moved from the sender to (dstChainId, toAddress)

event SendToChain(address indexed sender, uint16 indexed dstChainId, bytes indexed toAddress, uint256 amount);

ReceiveFromChain

Emitted when amount tokens are received from srcChainId into the toAddress on the local chain.

event ReceiveFromChain(uint16 indexed srcChainId, bytes indexed srcAddress, address indexed toAddress, uint256 amount);

SetUseCustomAdapterParams

event SetUseCustomAdapterParams(bool _useCustomAdapterParams);