0

Lets say I want to mint 1000 NFT's same image but their name is numbered 1-1000. Is it better to set a max supply of 1000, or to run the mint function 1000 times?

1 Answer 1

0

It depends on the Standard you are using.

With ERC721 tokens a batch mint is not possible (so you would have to call the mint(...) function 1000 times), however if your contract uses the ERC1155 standard, you can use the function _mintBatch(address to, uint256[] ids, uint256[] amounts, bytes data). You can read more about the function here.

Note though that the function is an internal function, so you have to expose it by wrapping it in a custom function, and probably add some custom logic to when the caller is allowed to batch mint.

Also this answer assumes that you are using @openzeppelin/contracts for a safe implementation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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