LazyMint
The LazyMint
is a contract extension for any base NFT contract. It lets you 'lazy mint' any number of NFTs at once. Here, 'lazy mint' means defining the metadata for particular tokenIds of your NFT contract, without actually minting a non-zero balance of NFTs of those tokenIds.
Methods
getBaseURICount
function getBaseURICount() external view returns (uint256)
Returns the count of batches of NFTs.
Each batch of tokens has an in ID and an associated baseURI
. See {batchIds}.
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | undefined |
getBatchIdAtIndex
function getBatchIdAtIndex(uint256 _index) external view returns (uint256)
Returns the ID for the batch of tokens the given tokenId belongs to.
See {getBaseURICount}.
Parameters
Name | Type | Description |
---|---|---|
_index | uint256 | ID of a token. |
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | undefined |
lazyMint
function lazyMint(uint256 _amount, string _baseURIForTokens, bytes _data) external nonpayable returns (uint256 batchId)
Lets an authorized address lazy mint a given amount of NFTs.
Parameters
Name | Type | Description |
---|---|---|
_amount | uint256 | The number of NFTs to lazy mint. |
_baseURIForTokens | string | The base URI for the 'n' number of NFTs being lazy minted, where the metadata for each of those NFTs is ${baseURIForTokens}/${tokenId} . |
_data | bytes | Additional bytes data to be used at the discretion of the consumer of the contract. |
Returns
Name | Type | Description |
---|---|---|
batchId | uint256 | A unique integer identifier for the batch of NFTs lazy minted together. |
Events
TokensLazyMinted
event TokensLazyMinted(uint256 indexed startTokenId, uint256 endTokenId, string baseURI, bytes encryptedBaseURI)
Parameters
Name | Type | Description |
---|---|---|
startTokenId indexed | uint256 | undefined |
endTokenId | uint256 | undefined |
baseURI | string | undefined |
encryptedBaseURI | bytes | undefined |