View all of the NFTs from the collection by implementing the totalSupply
function on your ERC721(A) contract.
info
This extension is an interface and requires all of the functions to be implemented
This is an example smart contract demonstrating how to inherit from this extension and override the functions to add (optional) custom functionality.
The ERC721A contract comes with a totalSupply
function that returns the total number of NFTs that have been minted in the collection (including tokens that have been burned).
This means you can already view the total supply of NFTs in the collection by implementing the ERC721A
contract.
You can optionally override the functionality of this function as outlined below:
FAQs
ERC721 is a standard for representing ownership of non-fungible tokens, that is, where each token is unique. ERC721 is a more complex standard than ERC20, with multiple optional extensions, and is split across a number of contracts.
Which is better ERC-721 or ERC1155? ›
ERC-721 is popular for creating NFTs, enabling the representation of unique digital assets such as artwork, collectibles, and in-game items. ERC-1155 provides flexibility by supporting multiple token types in a single contract, making it suitable for complex token ecosystems like gaming platforms.
How to create ERC-721 contract? ›
Let's proceed with the contract deployment process in the order below.
- Step 1 : Access the Remix and Create a file.
- Step 2 : Write ERC-721 Contract.
- Step 3 : Move to SOLIDITY COMPILER tap, Set the version, and Compile.
- Step 4 : Set DEPLOY & RUN TRANSACTIONS.
- Step 5 : Set Gas fee and Sign at MetaMask.
What is the difference between ERC20 and ERC-721? ›
The key difference between ERC20 and ERC721 tokens lies in their fungibility. ERC20 tokens are fungible and represent a uniform asset, while ERC721 tokens are non-fungible and symbolize a set of unique assets.
What are the disadvantages of ERC-721? ›
One of its key features, 'indivisibility,' has a downside. The incapacity to divide into smaller units becomes impractical in scenarios where fractional or partial ownership of certain projects is desired. Minting and transfer of each ERC-721 token needs a separate transaction, which leads to higher transaction fees.
What is total supply ERC-721? ›
The ERC721A contract comes with a totalSupply function that returns the total number of NFTs that have been minted in the collection (including tokens that have been burned). This means you can already view the total supply of NFTs in the collection by implementing the ERC721A contract.
How do I know if my contract is ERC-721 or ERC1155? ›
According to EIPs, ERC721 and ERC1155 will implements EIP165. Therefore, we can use the supportsInterface of EIP165 to check whether the contract is ERC721 or ERC1155. The interface id for ERC1155 is 0xd9b67a26 , while the interface of ERC721 is 0x80ac58cd .
Is ERC-721 free? ›
ERC-721 is a free, open standard that describes how to build non-fungible or unique tokens on the Ethereum blockchain. While most tokens are fungible (every token is the same as every other token), ERC-721 tokens are all unique.
What are the benefits of ERC-721? ›
ERC-721 tokens provide a secure and transparent way to prove ownership of unique assets. Their flexibility allows creators to add extra features. They work seamlessly on various platforms, ensuring transparent and protected digital ownership, and this sets the stage for innovative applications.
What is an example of ERC-721? ›
The ERC-721 token smart contract demonstrates how to create and transfer non-fungible tokens. Non-fungible tokens represent ownership over digital or physical assets. Example assets are artworks, houses, tickets, etc. Non-fungible tokens are distinguishable and we can track the ownership of each one separately.
ERC-721 Functions
ownerOf: This function returns the address of the owner of a specific token. Each ERC721 token is unique, represented by an ID. This function allows users or applications to determine the owner of the token based on its unique ID.
Can ERC-721 be fractionalized? ›
By definition, an ERC721 cannot be replicated as each token is completely unique. In order to fractionalize an NFT, a smart contract can be designed to generate a series of ERC20 tokens which are then linked to the specific ERC721 token.
Should I use ERC-721 or 1155? ›
Finally, ERC-721 has limited functionality, as it only supports the creation and management of non-fungible tokens. On the other hand, ERC-1155 supports the creation and management of both fungible and non-fungible tokens, making it more versatile and flexible for a wider range of use cases.
What are the disadvantages of ERC20? ›
Despite their numerous advantages, ERC-20 tokens are not without their risks and drawbacks: Security vulnerabilities: Malicious actors can exploit vulnerabilities in ERC20 smart contracts, leading to security breaches and token theft.
Why is ERC20 so expensive? ›
The main reason for the high fees of Bitcoin miners is the organic market. Bitcoin block size is 1MB, which means that miners can only confirm 1MB of exchange value for each square (like clockwork). This is why the excavator fees on ERC-20 are so high. How do I avoid ERC20 fees?
What are the ERC721 standard methods? ›
The ERC-721 standard consists of a set of functions that developers can implement in their smart contracts to create, transfer, and manage NFTs. These functions allow for the creation of unique tokens with their own metadata, making them distinguishable from one another.
What is the ERC standard? ›
ERC Token standards hold guidelines for developing smart contracts and dApps. It aids in creating, managing, and exchanging tokens on the Ethereum blockchain. ERC standards illustrate a set of rules, regulations, and protocols that a token creator must follow to work with the Ethereum network.
What is the ERC20 standard contract? ›
ERC20 is a community-proposed standard for smart contracts and tokens associated with them. The standard allows users to transfer tokens and be re-used by any other Ethereum application. It also makes it easier for them to be approved because the standardized elements must all be present.
What is ERC-721 and ERC1155 standards? ›
ERC-721 is a non-fungible token that represents unique assets such as virtual real estate, collectibles, and rare items, whereas ERC-1155 is a multi-fungible token that can be used to represent multiple assets in a single token.