Skip to main content

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​

NameTypeDescription
_0uint256undefined

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​

NameTypeDescription
_indexuint256ID of a token.

Returns​

NameTypeDescription
_0uint256undefined

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​

NameTypeDescription
_amountuint256The number of NFTs to lazy mint.
_baseURIForTokensstringThe base URI for the 'n' number of NFTs being lazy minted, where the metadata for each of those NFTs is ${baseURIForTokens}/${tokenId}.
_databytesAdditional bytes data to be used at the discretion of the consumer of the contract.

Returns​

NameTypeDescription
batchIduint256A 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​

NameTypeDescription
startTokenId indexeduint256undefined
endTokenIduint256undefined
baseURIstringundefined
encryptedBaseURIbytesundefined