Nested for loop on line 86 in PuppyRaffle.sol [inefficient code]
enterRaffle function is currently using a nested for loop to check if the address is a duplicate. See below (line 85-91 in PuppyRaffle.sol):
// Check for duplicates
for (uint256 i = 0; i < players.length - 1; i++) {
for (uint256 j = i + 1; j < players.length; j++) {
require(players[i] != players[j], "PuppyRaffle: Duplicate player");
}
}
emit RaffleEnter(newPlayers);
ineffiency, unecessary gas cost.
Manual inspection
Use a mapping to see if an address is already a participant.
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.