Skip to content
Lattice

IERC721Receiver

Git Source

Title: IERC721Receiver

Interface for contracts that want to receive ERC-721 tokens safely.

Functions

onERC721Received

Handle the receipt of an NFT.

The ERC-721 smart contract calls this function on the recipient after a safeTransfer.

function onERC721Received(address operator, address from, uint256 tokenId, bytes calldata data)
        external
        returns (bytes4);

Parameters

NameTypeDescription
operatoraddress
fromaddress
tokenIduint256
databytes

Returns

NameTypeDescription
<none>bytes4bytes4(keccak256("onERC721Received(address,address,uint256,bytes)")) to confirm receipt.