Function: send(SendParam sendParam, MessagingFee fee, address refundAddress)
This function debits tokens from the caller, builds and sends a cross-chain message with the provided fee, refunds leftovers to refundAddress
, and returns messaging and OFT receipts.
This function is identical to the send
function from LayerZero's OFTCoreUpgradeable.sol
contract except that it adds additional zero checks on addresses, it uses whenNotPaused
modifier and it uses _msgSender()
instead of msg.sender
.
Inputs
sendParam
Control: Fully controlled by the caller.
Impact: Structure for sending includes the receiver address and amounts.
fee
Control: Fully controlled by the caller.
Impact: Fee data for LayerZero sending.
refundAddress
Control: Fully controlled by the caller.
Impact: Address for refunding with LayerZero sending.
Branches and code coverage
Intended branches
Check if the receiver address and
refundAddress
are not zero.Check if the send amount is zero.
Negative behavior
If the receiver address or
refundAddress
is zero, revert transaction withSend__ZeroAddress
.If the send amount is zero, revert transaction with
Send__ZeroAmount
.