Beginner FriendlyFoundryNFT
100 EXP
View results
Submission Details
Severity: low
Valid

getActivePlayerIndex is returing zero ERRor

Returning 0 when a player is not active could be misleading. because if there are no players active it will still return 0th Index.

Recommendations

use two-step confirmation for example:

function getActivePlayerIndex(address player) external view returns (bool, uint256) {
for (uint256 i = 0; i < players.length; i++) {
if (players[i] == player) {
return (true, i);
}
}
revert("PuppyRaffle: Player is not active");
}

Updates

Lead Judging Commences

Hamiltonite Lead Judge almost 2 years ago
Submission Judgement Published
Validated
Assigned finding tags:

getActivePlayerIndex can say a player is both entered at slot 0 and inactive

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.