Skip to main content
A hook receiver is a destination-side contract that receives CCTP for non-USDC tokens and runs custom logic in the same transaction that delivers them. The receiver must implement executeWithCrossChainToken and return EXECUTE_SUCCESS. For background, see Hooks.

Prerequisites

Before you begin, ensure that you’ve:

Steps

1

Implement executeWithCrossChainToken

Create a contract that exposes the hook entrypoint the destination service calls. Restrict the caller to the local CrossChainTokenService, run your logic, and return EXECUTE_SUCCESS.
Solidity
Reverting inside executeWithCrossChainToken rolls back destination delivery (including the mint or unlock) in that receiveMessage transaction. The source burn or lock has already happened and is not undone. Delivery can be retried later. Use autoExecuteHookData: false if you want tokens delivered without running hook logic.
2

Deploy the receiver on every destination blockchain

Deploy the receiver on every blockchain where transfers will arrive with hook data. Each deployment must bind to the local CrossChainTokenService.
3

Send a transfer with hook data

On the source blockchain, encode the hook payload and call crossChainTransfer with destinationAddress set to the receiver contract and autoExecuteHookData set to true.
TypeScript
The claim and feeTotalAmount values are returned by the Iris fee-quote endpoint. Use a standard quote body (amount + feeToken only) unless your token is enabled for fast transfer. Do not include FORWARD when autoExecuteHookData is true—hook transfers require self-relay. See QuoteClaim.Before calling crossChainTransfer on the service, approve the source TokenManager (not the service) for the transfer amount. This applies to NATIVE_CROSSCHAIN_TOKEN, BURN_MINT, and LOCK_UNLOCK.
4

Relay the message to the destination

Iris does not relay transfers that carry hook data with autoExecuteHookData set to true. After Iris attests the source blockchain message, you or your own relayer must call receiveMessage on the destination MessageTransmitterV2 to deliver the transfer and trigger the hook. See Self-relay required for hook transfers.When the destination service receives the message, it delivers the tokens and calls your receiver’s hook in the same transaction.