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
sendParamControl: Fully controlled by the caller.
Impact: Structure for sending includes the receiver address and amounts.
feeControl: Fully controlled by the caller.
Impact: Fee data for LayerZero sending.
refundAddressControl: Fully controlled by the caller.
Impact: Address for refunding with LayerZero sending.
Branches and code coverage
Intended branches
Check if the receiver address and
refundAddressare not zero.Check if the send amount is zero.
Negative behavior
If the receiver address or
refundAddressis zero, revert transaction withSend__ZeroAddress.If the send amount is zero, revert transaction with
Send__ZeroAmount.