How can you know which users are still holding your NFTs? What if someone Mints an NFT and then at some point they sell/transfer it to someone else? How would you go about updating the holders then assuming that these holders will be getting automatic rewards after a specific time-frame? (and that you only want to reward current holders at that specific time-frame)
1 Answer
In the ERC721 Smart contract, there is a function called ownerOf where you can input the tokenId and get the current owner of the NFT associated with that tokenId. You can loop through all the tokenIds and send rewards to owner of NFts by calling the ownerOf function inside loop