Skip to main content

ERC721Supply

View all of the NFTs from the collection by implementing the totalSupply function on your ERC721(A) contract.

Base Contracts Implementing This Feature

Unlocked Features

By implementing ERC721Supply, you unlock the following features in the SDK and dashboard:

SDK UsageDescription
Get All NFTsLoad the metadata of all the minted NFTs in this contract.

Implementing It Yourself

This section is meant for advanced users who want to write the functionality from scratch.

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:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@thirdweb-dev/contracts/eip/ERC721A.sol";

contract Contract is ERC721A {
constructor(
string memory _name,
string memory _symbol
)
ERC721A(
_name,
_symbol
)
{}

function totalSupply() public view override returns (uint256) {
// Your custom implementation here (overriding this function is optional)
}

}