ITokenMessangerV2

Git Source

Functions

depositForBurnWithHook

Deposits and burns tokens from sender to be minted on destination domain. Emits a DepositForBurn event.

reverts if:

  • hookData is zero-length
  • burnToken is not supported
  • destinationDomain has no TokenMessenger registered
  • transferFrom() reverts. For example, if sender's burnToken balance or approved allowance to this contract is less than amount.
  • burn() reverts. For example, if amount is 0.
  • maxFee is greater than or equal to amount.
  • MessageTransmitterV2#sendMessage reverts.
function depositForBurnWithHook(
    uint256 amount,
    uint32 destinationDomain,
    bytes32 mintRecipient,
    address burnToken,
    bytes32 destinationCaller,
    uint256 maxFee,
    uint32 minFinalityThreshold,
    bytes calldata hookData
) external;

Parameters

NameTypeDescription
amountuint256amount of tokens to burn
destinationDomainuint32destination domain to receive message on
mintRecipientbytes32address of mint recipient on destination domain, as bytes32
burnTokenaddresstoken to burn amount of, on local domain
destinationCallerbytes32authorized caller on the destination domain, as bytes32. If equal to bytes32(0), any address can broadcast the message.
maxFeeuint256maximum fee to pay on the destination domain, specified in units of burnToken
minFinalityThresholduint32
hookDatabyteshook data to append to burn message for interpretation on destination domain