IERC721Receiver.sol 1002 B

12345678910111213141516171819202122232425262728
  1. // SPDX-License-Identifier: MIT
  2. // OpenZeppelin Contracts (last updated v5.1.0-rc.1) (token/ERC721/IERC721Receiver.sol)
  3. pragma solidity ^0.8.20;
  4. /**
  5. * @title ERC-721 token receiver interface
  6. * @dev Interface for any contract that wants to support safeTransfers
  7. * from ERC-721 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
  16. * reverted.
  17. *
  18. * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
  19. */
  20. function onERC721Received(
  21. address operator,
  22. address from,
  23. uint256 tokenId,
  24. bytes calldata data
  25. ) external returns (bytes4);
  26. }