MultiRaffle icon indicating copy to clipboard operation
MultiRaffle copied to clipboard

Potential gas war / unfairness when claiming low tokenId

Open ARR4N opened this issue 2 years ago • 2 comments

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.

ARR4N avatar Oct 14 '21 13:10 ARR4N

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?

0xkowloon avatar Oct 16 '21 21:10 0xkowloon

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?

pauliax avatar Oct 30 '21 08:10 pauliax