ERC721Enumerable
View all of the NFTs owned by a specific wallet address by implementing the IERC721Enumerable
interface.
Base Contracts Implementing This Feature
No base contracts implement this functionality by default.
Unlocked Features
By implementing ERC721Enumerable
, you unlock the following features in the SDK and dashboard:
SDK Usage | Description |
---|---|
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/ERC721A.sol";
import "@thirdweb-dev/contracts/eip/interface/IERC721Enumerable.sol";
contract Contract is ERC721A, IERC721Enumerable {
constructor(
string memory _name,
string memory _symbol
)
ERC721A(
_name,
_symbol
)
{}
function tokenByIndex(uint256 _index) external view override returns (uint256) {
// Your custom implementation here
}
function tokenOfOwnerByIndex(address _owner, uint256 _index) external view override returns (uint256) {
// Your custom implementation here
}
}