Returning 0 when a player is not active could be misleading. because if there are no players active it will still return 0th Index.
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");
}
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.