IOFTCore
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
Name | Type | Description |
---|---|---|
dstChainId | uint16 | L0 defined chain id to send tokens too |
toAddress | bytes | Dynamic bytes array which contains the address to whom you are sending tokens to on the dstChain |
amount | uint256 | Amount of the tokens to transfer |
useZro | bool | Indicates to use zro to pay L0 fees |
adapterParams | bytes | Flexible 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
Name | Type | Description |
---|---|---|
from | address | The owner of token |
dstChainId | uint16 | The destination chain identifier |
toAddress | bytes | Can be any size depending on the dstChainId . |
amount | uint256 | The quantity of tokens in wei |
refundAddress | address payable | The address LayerZero refunds if too much message fee is sent |
zroPaymentAddress | address | Set to address(0x0) if not paying in ZRO (LayerZero Token) |
adapterParams | bytes | Flexible 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);