IERC721Receiver.sol 866 B

123456789101112131415161718192021
  1. // SPDX-License-Identifier: MIT
  2. pragma solidity >=0.6.0 <0.8.0;
  3. /**
  4. * @title ERC721 token receiver interface
  5. * @dev Interface for any contract that wants to support safeTransfers
  6. * from ERC721 asset contracts.
  7. */
  8. interface IERC721Receiver {
  9. /**
  10. * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
  11. * by `operator` from `from`, this function is called.
  12. *
  13. * It must return its Solidity selector to confirm the token transfer.
  14. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
  15. *
  16. * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
  17. */
  18. function onERC721Received(address operator, address from, uint256 tokenId, bytes calldata data) external returns (bytes4);
  19. }