ITokenBridge interface.
Fee Quoting Interface
New in version 10.0.0: The
quoteTransferRemote function provides a standardized way to quote fees for warp route transfers.
Only applicable to routes that return >= 10.0.0 from PACKAGE_VERSION().Quote Structure
ThequoteTransferRemote function returns an array of Quote structs with the following convention:
-
Index 0: Native Fees
- Token:
address(0)(native token like ETH, MATIC, etc.) - Amount: Fees charged by the mailbox for dispatching the message
- This must be sent as
msg.valuewhen callingtransferRemote
- Token:
-
Index 1: Token Fees
- Token: The ERC20 token being bridged.
- Amount:
_amount + internalFeeAmount - This is the total amount of tokens that must be sent/approved, including any internal fees charged by the warp route
Exact Amount Out Semantics
Warp routes use “exact amount out” semantics, meaning:- The
_amountparameter intransferRemotespecifies the exact amount the recipient receives - Fees are charged on top of this amount from the sender
- Total tokens required =
_amount + internalFeeAmount + externalFeeAmount