ERC721 LazyMint Smart Contract Module in Bunzz

The ERC721 LazyMint module allows you to lazy-mint ERC-721 tokens, which allows any wallet to claim a lazy-minted NFT. It exposes a verifyClaim function that you can override to add your claim-restriction logic.

Lazy minting allows you to define the metadata of NFTs without minting it to an address. As a contract admin, this lets you prepare the metadata for NFTs that will be minted by other wallets, without paying the gas cost for actually minting the NFTs.

This module includes the following additions to standard ERC721 logic:

  • Lazy minting
  • Ownership of the contract, with the ability to restrict certain functions to only be called by the contract’s owner.
  • Multicall capability to perform multiple actions atomically

“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.

You can access this Module and the code here: https://bit.ly/3MdoGE2

How to Use

Import the contract and inherit from it.

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9; // should use solidity version higher than 0.8.9
import "./ERC721LazyMint.sol";
contract MyNFT is ERC721LazyMint {
constructor(
string memory _name,
string memory _symbol,
address _royaltyRecipient,
uint128 _royaltyBps
) ERC721LazyMint(_name, _symbol, _royaltyRecipient, _royaltyBps) {}
    function verifyClaim(address _claimer, uint256 _quantity) public view virtual override {
// Your custom claim restriction logic
}
}

Functions to override

The following functions have been implemented on this contract and are available to be overridden to add custom logic:

- tokenURI
- claim
- verifyClaim
- burn
- _transferTokensOnClaim

Functions

#WRITE

  • approve
  • burn
  • lazyMint
  • multicall
  • renounceOwnership
  • safeTransferFrom
  • transferOwnership
  • transferFrom
  • setApprovalForAll
  • safeTransferFrom
  • claim

#READ

  • supportsInterface
  • balanceOf
  • baseURILength
  • getApproved
  • nextTokenIdToMint
  • owner
  • ownerOf
  • symbol
  • tokenURI
  • name
  • nextTokenIdToClaim
  • isApprovedForAll
  • verifyClaim
  • batchIdAtIndex

You can access this Module and the code here: https://bit.ly/3MdoGE2

If you still haven’t signed up to Bunzz, what are you waiting for?

Sign up here https://app.bunzz.dev/signup and get your smart contracts deployed in 5 minutes through our great GUI.

Share this article: