Skip to content

humayunj/NFT-contract-the-hard-way

Repository files navigation

ERC-721 The Hard Way

Events

  • event Transfer(address indexed _from, address indexed _to, uint256 indexed _tokenId);
  • event Approval(address indexed _owner, address indexed _approved, uint256 indexed _tokenId);
  • event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved);

Methods

  • function balanceOf(address _owner) external view returns (uint256);

  • function ownerOf(uint256 _tokenId) external view returns (address);

  • function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes data) external payable;

  • function safeTransferFrom(address _from, address _to, uint256 _tokenId) external payable;

  • function transferFrom(address _from, address _to, uint256 _tokenId) external payable;

  • function approve(address _approved, uint256 _tokenId) external payable;

  • function setApprovalForAll(address _operator, bool _approved) external;

  • function getApproved(uint256 _tokenId) external view returns (address);

  • function isApprovedForAll(address _owner, address _operator) external view returns (bool);

  • function supportsInterface(bytes4 interfaceID) external view returns (bool); (from ERC165 – Optional)

  • function mint(address to,uint256 tokenId) external returns (uint256 tokenId); (not in specs)

ERC-721-Receiver

  • function onERC721Received(address _operator, address _from, uint256 _tokenId, bytes _data) external returns(bytes4)

Tests

Test cases can found at humayunj/ERC-721-Yul-tests

Notes

Minting is not specified in EIP, so there's no standard for it.

About

ERC-721 implementation in Yul.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published