IERC721Basic.sol 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. pragma solidity ^0.4.24;
  2. import "../../introspection/IERC165.sol";
  3. /**
  4. * @title ERC721 Non-Fungible Token Standard basic interface
  5. * @dev see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
  6. */
  7. contract IERC721Basic is IERC165 {
  8. bytes4 internal constant InterfaceId_ERC721 = 0x80ac58cd;
  9. /*
  10. * 0x80ac58cd ===
  11. * bytes4(keccak256('balanceOf(address)')) ^
  12. * bytes4(keccak256('ownerOf(uint256)')) ^
  13. * bytes4(keccak256('approve(address,uint256)')) ^
  14. * bytes4(keccak256('getApproved(uint256)')) ^
  15. * bytes4(keccak256('setApprovalForAll(address,bool)')) ^
  16. * bytes4(keccak256('isApprovedForAll(address,address)')) ^
  17. * bytes4(keccak256('transferFrom(address,address,uint256)')) ^
  18. * bytes4(keccak256('safeTransferFrom(address,address,uint256)')) ^
  19. * bytes4(keccak256('safeTransferFrom(address,address,uint256,bytes)'))
  20. */
  21. bytes4 internal constant InterfaceId_ERC721Enumerable = 0x780e9d63;
  22. /**
  23. * 0x780e9d63 ===
  24. * bytes4(keccak256('totalSupply()')) ^
  25. * bytes4(keccak256('tokenOfOwnerByIndex(address,uint256)')) ^
  26. * bytes4(keccak256('tokenByIndex(uint256)'))
  27. */
  28. bytes4 internal constant InterfaceId_ERC721Metadata = 0x5b5e139f;
  29. /**
  30. * 0x5b5e139f ===
  31. * bytes4(keccak256('name()')) ^
  32. * bytes4(keccak256('symbol()')) ^
  33. * bytes4(keccak256('tokenURI(uint256)'))
  34. */
  35. event Transfer(
  36. address indexed from,
  37. address indexed to,
  38. uint256 indexed tokenId
  39. );
  40. event Approval(
  41. address indexed owner,
  42. address indexed approved,
  43. uint256 indexed tokenId
  44. );
  45. event ApprovalForAll(
  46. address indexed owner,
  47. address indexed operator,
  48. bool approved
  49. );
  50. function balanceOf(address _owner) public view returns (uint256 _balance);
  51. function ownerOf(uint256 _tokenId) public view returns (address _owner);
  52. function approve(address _to, uint256 _tokenId) public;
  53. function getApproved(uint256 _tokenId)
  54. public view returns (address _operator);
  55. function setApprovalForAll(address _operator, bool _approved) public;
  56. function isApprovedForAll(address _owner, address _operator)
  57. public view returns (bool);
  58. function transferFrom(address _from, address _to, uint256 _tokenId) public;
  59. function safeTransferFrom(address _from, address _to, uint256 _tokenId)
  60. public;
  61. function safeTransferFrom(
  62. address _from,
  63. address _to,
  64. uint256 _tokenId,
  65. bytes _data
  66. )
  67. public;
  68. }