Posting here as a question, but also added to Feature Requests as it would be really nice to have functionality built-in.
(request here Whitelist via the MongoDB or similar and a hook/check?)
How would one go about setting up a whitelist for NFT mint (or ERC20 claim) with Moralis?
We know which wallet is logged in if they’ve authenticated with Moralis.
We can add address to the MongoDB I think, by outputting them to JSON and importing?
Next though would be how to check the connected user’s address is in the whitelist, and record how many mints they want / are allowed.
This was we can also avoid the trick where a user mints, moves NFTs out of wallet, and can continue to mint (as many contracts look to check current balance of the NFTs in question in a wallet, rather than keep track of how many have been minted by a wallet, reason being most users can get a solidity contract to check balance but can’t set up a database and queries in conjunction with a mint button so they do it the easy way and leave the whitelist open to abuse)/
So I think it’s theoretically possible. But looking for advice on the steps to do it. How do you query a custom range of data (the whitelisted addresses imported into Mongo) at mint time?