ERC721A Smart Contract Module in Bunzz

The ERC721A module is a modification of the ERC721 NFT standard that adds internal modifications to heavily optimize serialized batch minting while keeping all of the external functions that an ERC721 would use allowing a third party application to interact with them interchangeably.

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

With the the ERC721A module, users:

  • Can mint multiple NFTs in a single transaction.
  • Assumes that an owner cannot have more than 2⁶⁴ — 1 (max value of uint64) of supply.
  • Assumes serials are sequentially minted starting at _startTokenId() (defaults to 0, e.g. 0, 1, 2, 3..)

How to Use

The goal of ERC721A is to provide a fully compliant implementation of IERC721 with significant gas savings for minting multiple NFTs in a single transaction.

Once installed, you can use the contracts in the library by importing them:

pragma solidity ^0.8.4; // Minimum solidity version is 0.8.4

contract ERC721ATest is ERC721A {
constructor() ERC721A("ERC721ATest", "Test") {}

function mint(uint256 quantity) external payable {
// `_mint`'s second argument now takes in a `quantity`, not a `tokenId`.
_mint(msg.sender, quantity);
}
}

Functions

#WRITE

  • transferOwnership
  • renounceOwnership
  • approve
  • safeTransferFrom
  • safeTransferFrom
  • setApprovalForAll
  • transferFrom

#READ

  • getApproved
  • ownerOf
  • supportsInterface
  • symbol
  • tokenURI
  • totalSupply
  • balanceOf
  • isApprovedForAll
  • name
  • owner

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

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: