ERC1155Enumerable
View all of the NFTs in the collection and all the NFTs owned by a specific wallet address by implementing the IERC1155Enumerable
interface.
Base Contracts Implementing This Feature
Unlocked Features
By implementing the ERC1155Enumerable contract, you unlock the following features in the SDK and dashboard:
SDK Usage | Description |
---|---|
Get All NFTs | Load the metadata of all the minted NFTs in this contract. |
View Owned NFTs | View all the NFTs a wallet address owns from this collection at this point in time. |
Implementing It Yourself
This section is meant for advanced users who want to write the functionality from scratch.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@thirdweb-dev/contracts/eip/ERC1155.sol";
import "@thirdweb-dev/contracts/eip/interface/IERC1155Enumerable.sol";
contract Contract is ERC1155, IERC1155Enumerable {
constructor(
string memory _name,
string memory _symbol
)
ERC1155(
_name,
_symbol
)
{}
function nextTokenIdToMint() external override view returns (uint256) {
// Your custom implementation here
}
}