Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Mastering Blockchain Programming with Solidity

You're reading from  Mastering Blockchain Programming with Solidity

Product type Book
Published in Aug 2019
Publisher Packt
ISBN-13 9781839218262
Pages 486 pages
Edition 1st Edition
Languages
Concepts
Author (1):
Jitendra Chittoda Jitendra Chittoda
Profile icon Jitendra Chittoda

Table of Contents (21) Chapters

Preface 1. Section 1: Getting Started with Blockchain, Ethereum, and Solidity
2. Introduction to Blockchain 3. Getting Started with Solidity 4. Control Structures and Contracts 5. Section 2: Deep Dive into Development Tools
6. Learning MetaMask and Remix 7. Using Ganache and the Truffle Framework 8. Taking Advantage of Code Quality Tools 9. Section 3: Mastering ERC Standards and Libraries
10. ERC20 Token Standard 11. ERC721 Non-Fungible Token Standard 12. Deep Dive into the OpenZeppelin Library 13. Using Multisig Wallets 14. Upgradable Contracts Using ZeppelinOS 15. Building Your Own Token 16. Section 4: Design Patterns and Best Practices
17. Solidity Design Patterns 18. Tips, Tricks, and Security Best Practices 19. Assessments 20. Other Books You May Enjoy

The ERC721 enumerable

The ERC721Enumerable interface is an optional interface for adding more features to the ERC721 NFT.

The interface defines the following view functions:

  • totalSupply(): The function returns the total number of NFTs issued by the contract that are not burned. Also, each token has a valid owner address that is not address(0).
  • tokenByIndex(): The function returns the tokenId of an NFT that is stored at the provided index.
  • tokenOfOwnerByIndex(): The function returns the tokenId of an NFT that is stored at a particular index of the owner's list of tokens.

Let's look at the ERC721Enumerable interface code:

interface ERC721Enumerable is ERC721 {
function totalSupply() external view returns (uint256);
function tokenByIndex(uint256 _index) external view returns (uint256);
function tokenOfOwnerByIndex(address _owner, uint256 _index...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}