Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

IObjectMinterHook

Git Source

Inherits: IERC165

Interface for set contracts that support minting via ObjectMinter

Functions

onObjectMint

Called by ObjectMinter after payment is collected and before minting is finalized

  • If id0 is 0, the contract must assign and return a new object ID.
  • If id0 is non-zero, the contract must validate and return the same ID. The call must return onObjectMint.selector to signal success.
function onObjectMint(address operator, address to, uint64 id0, uint256 context, bytes memory data)
    external
    returns (bytes4 selector, uint64 id);

Parameters

NameTypeDescription
operatoraddressCaller who initiated the mint (typically msg.sender)
toaddressRecipient of the minted object
id0uint64Requested object ID (0 = auto-assign)
contextuint256Packed 256-bit context for custom mint logic (see MintingContext)
databytesArbitrary input payload for extensible logic

Returns

NameTypeDescription
selectorbytes4Must return onObjectMint.selector to proceed
iduint64Final resolved object ID to be minted