Last active
April 10, 2022 20:28
-
-
Save ilamanov/9ff74f97f646f342d2c2af86c45e1a93 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pragma solidity ^0.5.0; | |
| function totalSupply() public view returns (uint256) { | |
| return _allTokens.length; | |
| } | |
| function tokenByIndex(uint256 index) public view returns (uint256) { | |
| require(index < totalSupply(), "ERC721Enumerable: global index out of bounds"); | |
| return _allTokens[index]; | |
| } | |
| function tokenOfOwnerByIndex(address owner, uint256 index) public view returns (uint256) { | |
| require(index < balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); | |
| return _ownedTokens[owner][index]; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment