IERC721Receiver
contract IERC721Receiver
Interface for any contract that wants to support safeTransfers from ERC721 asset contracts.
Source: token/ERC721/IERC721Receiver.sol
Index
Reference
Functions
onERC721Received
abstract function onERC721Received(address operator, address from, uint256 tokenId, bytes data) public returns (bytes4)
The ERC721 smart contract calls this function on the recipient after a `safeTransfer`. This function MUST return the function selector, otherwise the caller will revert the transaction. The selector to be returned can be obtained as `this.onERC721Received.selector`. This function MAY throw to revert and reject the transfer. Note: the ERC721 contract address is always the message sender., Handle the receipt of an NFT.
- Parameters:
operator
- The address which called `safeTransferFrom` functionfrom
- The address which previously owned the tokentokenId
- The NFT identifier which is being transferreddata
- Additional data with no specified format- Returns:
- `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`