IERC721ReceiverUpgradeable
# interface IERC721ReceiverUpgradeable
# function onERC721Received
Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} by `operator` from `from`, this function is called. It must return its Solidity selector to confirm the token transfer. If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
function onERC721Received(address operator, address from, uint256 tokenId, bytes data) external returns (bytes4);
Arguments:
Type | Internal Type | Name | Info |
---|---|---|---|
address | address | operator | 0 |
address | address | from | 1 |
uint256 | uint256 | tokenId | 2 |
bytes | bytes | data | 3 |
Returns:
Type | Internal Type | Name | Info |
---|---|---|---|
bytes4 | bytes4 | 0 | - |