CCTPHookReceipt
Inherits: ERC721, ICCTPHookReceiver
Title: CCTPHookReceipt
Authors: David Dada <daveproxy80@gmail.com> (https://github.com/dadadave80), Modified from Uniswap v4 Periphery (https://github.com/Uniswap/v4-periphery)
Position-style ERC-721 proof that Circle CCTP v2 delivered USDC through a Lattice hook.
The receipt never custodies or controls USDC. Only the immutable CCTPHookExecutor may mint, and every
recorded transfer fact comes from the Circle-attested callback. The attacker-controlled payload is ignored.
The NFT is transferable, but originalRecipient remains the account that received the USDC.
Constants
executor
address public immutable executor;State Variables
nextTokenId
uint256 public nextTokenId = 1;_receipts
mapping(uint256 tokenId => Receipt receipt_) private _receipts;Functions
constructor
constructor(address executor_);Parameters
| Name | Type | Description |
|---|---|---|
| executor_ | address |
supportsInterface
Query ERC-165 support registered by the standalone ERC-721 initialization.
function supportsInterface(bytes4 interfaceId) external view returns (bool);Parameters
| Name | Type | Description |
|---|---|---|
| interfaceId | bytes4 |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bool |
receipt
Return the immutable delivery facts for an existing receipt.
function receipt(uint256 tokenId) external view returns (Receipt memory);Parameters
| Name | Type | Description |
|---|---|---|
| tokenId | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | Receipt |
onCCTPHook
Invoked by the CCTPHookExecutor after the attested USDC mint, with Circle-attested context.
function onCCTPHook(uint32 sourceDomain, bytes32 sender, bytes32 mintRecipient, uint256 amount, bytes calldata)
external;Parameters
| Name | Type | Description |
|---|---|---|
| sourceDomain | uint32 | The CCTP domain the burn originated on (from the attested message header). |
| sender | bytes32 | The burner on the source domain, as a right-aligned bytes32 (attested). |
| mintRecipient | bytes32 | The bytes32 recipient the USDC was minted to on this chain (attested). |
| amount | uint256 | The USDC amount actually minted to mintRecipient (attested burn amount minusattested feeExecuted). |
| _ | bytes | ATTACKER-CONTROLLED hook payload bytes (the Lattice envelope's tail). Untrusted. |
tokenURI
Returns the Uniform Resource Identifier (URI) for tokenId token.
function tokenURI(uint256 tokenId) public view override returns (string memory);Parameters
| Name | Type | Description |
|---|---|---|
| tokenId | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | string |
Events
ReceiptMinted
event ReceiptMinted(
uint256 indexed tokenId,
address indexed originalRecipient,
uint32 indexed sourceDomain,
bytes32 sender,
uint256 amount,
uint64 recordedAt
);Parameters
| Name | Type | Description |
|---|---|---|
| tokenId | uint256 | |
| originalRecipient | address | |
| sourceDomain | uint32 | |
| sender | bytes32 | |
| amount | uint256 | |
| recordedAt | uint64 |
Errors
CCTPHookReceipt__ZeroExecutor
error CCTPHookReceipt__ZeroExecutor();CCTPHookReceipt__NotExecutor
error CCTPHookReceipt__NotExecutor();CCTPHookReceipt__InvalidRecipient
error CCTPHookReceipt__InvalidRecipient(bytes32 mintRecipient);Parameters
| Name | Type | Description |
|---|---|---|
| mintRecipient | bytes32 |
Structs
Receipt
struct Receipt {
uint32 sourceDomain;
bytes32 sender;
address originalRecipient;
uint256 amount;
uint64 recordedAt;
}Properties
| Name | Type | Description |
|---|---|---|
| sourceDomain | uint32 | |
| sender | bytes32 | |
| originalRecipient | address | |
| amount | uint256 | |
| recordedAt | uint64 |