Bulk Minting NFT

In this article, i will describe solidity smart contract and nodeJS app to perform bulk minting of NFT. The discussion is applicable to Ethereum compatible blockchain.

Referring to the diagram below:

The mintManyNFT function is part of the solidity smart contract. It takes as input array of addresses, and a baseURI. It loops through the number of addresses, and for each address, it mints an unique token Id to the address and sets the tokenURI.

In the nodeJS app, it calls the mintManyNFT function, passing in the array of addresses and the tokenURI.

The full source code is available at:

Note: The solidity smart contract function is not optimised for gas. There are several ways to optimise the function.

  1. Set the base token URI only once. Do not set the token URI for each address.
  2. Do not use the ERC721URIStorage contract, use your own counter to minimise storage cost.
  3. Any more ideas?

--

--

--

Engineer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Fortmatic. Powering The BuffiDAO and 1MillionDevs Quest Experiment.

PTOY listed!

Atlantic Voyage Ape Club NFT

Introduction of ZENITH X FANS (1/4)

How Blockchain Could Revolutionize the Supply Chain

Blockchain, Shaping The Future Village

Tezos in India: 2019 in a Nutshell

How TopGoal is going to take NFT gaming to the next level; an AMA with Alexa, COO of TopGoal

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Victor Yeo

Victor Yeo

Engineer

More from Medium

Using AWS For Your NFT Whitelist API

X Years of Blockchain Development Experience Is A Losing Requirement When Hiring

Creating Loot Royale NFT Collection DApp

A low gas ERC721 smart contract with tweaks and costings