IERC721Receiver.sol 987 B

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