In one transaction:
To mint one item, use _mint(...)
.
To mint up to 20 items, use _mint(...)
in a for-loop.
To mint up to 500 items, use the "ghost minting" technique. Please see the Area NFT contract for an open source example of that. Note this is an advanced technique that will surely require customization based on your application.
To mint enough tokens to track ownership of nanobots a few micron in size and in aggregate totaling half the size of Earth, use the "lazy array" technique. Please see the Su Squares contract for an open source example of that. This is only possible at the time of contract deployment.
The _safeMint(...)
function makes the recipient of a token, if it's a contract, get a onERC721Received(...)
call. This functionality is not required by the standard and you may have some specific reason you want to use that.