I am working on random minting of ERC721 Tokens… I am using Chainlink VRF For randomisation.
The confusion I have is that how can I keep track of NFTs that have been already minted… Because VRF can generate a number(NFT ID) that has already been minted… One option is to use while loop or use an array which will be way too expensive
Any other optimised solution please???
Best Answer
something like this is a bit expensive to set up, but minting is cheap, so I think it's along the lines of what you want to do.
Rather than keeping track of what's been minted already, it keeps a set of IDs that haven't been minted and selects from that. The set gets smaller as NFTs are minted.