LayerZeroBridge

The following describes relevant, public functions on the LayerZeroBridge smart contract.

View Methods

estimateSendFee

This function allows users to get the fee required to deliver a LayerZero message on a specified destination chain.

function estimateSendFee(
    uint16 _dstChainId, 
    bytes memory _toAddress,
    uint256 _amount
) public view virtual returns (uint256 nativeFee, uint256 zroFee) {}
Parameter NameTypeDescription

_dstChainId

uint16

The LayerZero chain ID of the destination chain. Please refer to the Deployed Contracts page to see a list of chain IDs.

_toAddress

bytes

The abi-encoded recipient address on the destination chain: the account USX will get transferred to.

_amount

uint256

The amount of USX token to be transferred, in Wei units (18 decimals).

Return ValueTypeDescription

nativeFee

uint256

The amount, in terms of source chain native, required to pay for destination chain gas fees. The amount must be included as msg.value when calling sendFrom on the source chain USX contract.

zroFee

uint256

At present, this value is not used by Ax Protocol.

Last updated