IERC721Receiver.sol 896 B

1234567891011121314151617181920212223242526
  1. // SPDX-License-Identifier: MIT
  2. pragma solidity ^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(
  19. address operator,
  20. address from,
  21. uint256 tokenId,
  22. bytes calldata data
  23. ) external returns (bytes4);
  24. }