Nft
Inherits: ERC721Enumerable, INft
Extensions to ECR-721 to support an image contract and owner enumeration.
State Variables
_nextTokenId
uint256 private _nextTokenId = 1;
Functions
constructor
constructor(string memory __name, string memory __symbol) ERC721(__name, __symbol);
_mint
Internal function to mint a new NFT and assign it to the specified address.
function _mint(address to) internal returns (uint256 tokenId);
Parameters
Name
Type
Description
to
address
The address to which the NFT will be minted.
Returns
Name
Type
Description
tokenId
uint256
The ID of the newly minted NFT.
onlyTokenIdAuthorizedUser
Modifier to restrict access to functions to the owner of a specific NFT by its tokenId.
modifier onlyTokenIdAuthorizedUser(uint256 tokenId);
tokenOfOwnerByIndexExists
Check if an NFT exists for a given owner and index.
function tokenOfOwnerByIndexExists(address ownerToCheck, uint256 index) public view returns (bool exists);
tokenIdsOfOwner
List of tokenIds by owner.
function tokenIdsOfOwner(address owner) public view returns (uint256[] memory tokenIds);
checkAuthorized
Check if the caller has access to a specific NFT by tokenId.
function checkAuthorized(address spender, uint256 tokenId) public view returns (address owner);
_update
function _update(address to, uint256 tokenId, address auth) internal override(ERC721Enumerable) returns (address);
_increaseBalance
function _increaseBalance(address account, uint128 value) internal override(ERC721Enumerable);
name
function name() public view virtual override(INft, ERC721) returns (string memory);
symbol
function symbol() public view virtual override(INft, ERC721) returns (string memory);
supportsInterface
function supportsInterface(bytes4 interfaceId) public view override(ERC721Enumerable, IERC165) returns (bool);
tokenURI
function tokenURI(uint256 tokenId) public view virtual override(INft, ERC721) returns (string memory);
Last updated