IERC721TokenReceiver

Git Source

Functions

onERC721Received

Handle the receipt of an NFT

The ERC721 smart contract calls this function on the recipient after a transfer. This function MAY throw to revert and reject the transfer. Return of other than the magic value MUST result in the transaction being reverted. Note: the contract address is always the message sender.

function onERC721Received(address _operator, address _from, uint256 _tokenId, bytes calldata _data)
    external
    returns (bytes4);

Parameters

NameTypeDescription
_operatoraddressThe address which called safeTransferFrom function
_fromaddressThe address which previously owned the token
_tokenIduint256The NFT identifier which is being transferred
_databytesAdditional data with no specified format

Returns

NameTypeDescription
<none>bytes4bytes4(keccak256("onERC721Received(address,address,uint256,bytes)")) unless throwing