Anish-Agnihotri / MultiRaffle

NFT distribution with (1) randomized, multi-winner raffles and (2) bulk on-chain metadata generation.
GNU Affero General Public License v3.0
269 stars 52 forks source link

Potential gas war / unfairness when claiming low tokenId #4

Open ARR4N opened 3 years ago

ARR4N commented 3 years ago

https://github.com/Anish-Agnihotri/MultiRaffle/blob/55c4c4af14ab06f795b564ed42f569ea420e1d4f/src/MultiRaffle.sol#L223

What do you think about _safeMint(msg.sender, ticket[i]) instead? Currently, if there's any value in a low tokenId then there's an incentive for gas wars / people gaming the system, but if you stop tracking nftCount and instead issue the shuffled position then that's negated.

0xkowloon commented 3 years ago

If it calls _safeMint(msg.sender, ticket[i]) instead, we can even skip the subsequent randomness requests from Chainlink and drop Metadata right?

Let's say it is your typical 10,000 profile pictures project hosted on IPFS under a single URL. By using ticket[i] as the token ID, even if all the collection metadata is revealed before the raffle happens, is it safe to say that it does not matter because raffleEntries will be shuffled anyway?

pauliax commented 3 years ago

Wouldn't that cause issues with the enumeration of tokens, if there were gaps between token ids as someone can forget or intentionally never mint their NFTs?