0

ERC 1155 has a function called _mint: https://docs.openzeppelin.com/contracts/3.x/api/token/erc1155#ERC1155-_mint-address-uint256-uint256-bytes-

_mint(address account, uint256 id, uint256 amount, bytes data)

and it lets one create amount nfts and send them to the account. Is there an efficient way so that we can specify a million accounts to which the minted nfts are to be distributed?

Is the best way to create a for loop that goes upto a million and _mint nfts for each account? Wouldn't that cause ganache to run out of memory, and therefore will consume excessive gas on the blockchain?

0

In theory, you can call this function a million times, but that would cost a lot (like, A LOT) if used on public blockchain.

Another solution is as you described passing an array of address instead of one address. But be aware that would break the ERC1155 standard (unless there is a mint with an array of address described that I am not aware of).

But that second solution too would cost a lot of money.

I think your best shot is to try several solution and check what is the less expensive.

Personal note: Why would you mint a million times ? Are you just making a money machine ? If so, sorry not sorry, you are the cancer of blockchain.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.