Skip to main content

ERC721 Lazy Mint

The ERC721LazyMint smart contract uses the ERC721Base base contract along with the LazyMint contract extension.

'Lazy minting' means defining the metadata of NFTs without minting it to an address. Regular 'minting' of  NFTs means actually assigning an owner to an NFT.

As a contract admin, this lets you prepare the metadata for NFTs that will be minted by an external party, without paying the gas cost for actually minting the NFTs.

Import

import "@thirdweb-dev/contracts/base/ERC721LazyMint.sol";

Available functionality

FunctionalityDescription
ERC721BaseSee the portal page for ERC721Base, here.
LazyMintPrepare the metadata for NFTs that will be minted by an external party, without paying the gas cost for actually minting the NFTs.

Implementing the Contract

Import the contract extension and make your contract inherit it.

// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

import "@thirdweb-dev/contracts/base/ERC721LazyMint.sol";

contract MyNFT is ERC721LazyMint {
constructor(
string memory _name,
string memory _symbol,
address _royaltyRecipient,
uint128 _royaltyBps
) ERC721LazyMint(_name, _symbol, _royaltyRecipient, _royaltyBps) {}
}

Unlocked Features

Once deployed, you'll be able to access the following contract extensions' features on the SDK and dashboard: