The documentation specifies that duplicate entrants are not permitted in the raffle. However, the enterRaffle function does not currently prevent the same address from entering multiple times.
The code snippet provided checks for duplicate entries by comparing each player with the next one in the players array. This method fails to detect duplicates if the same address is not adjacent in the list, particularly when comparing the first and last entrants.
Allowing duplicate players can lead to an unfair advantage and disrupt the intended fairness of the raffle game.
Manual Review
The current method of duplicate checking is insufficient as it only checks for consecutive duplicate players. Instead, a mapping should be used to keep track of which addresses have already entered:
So fix something like this.
Root cause: bad RNG Impact: manipulate winner
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.