function getActivePlayerIndex return 0 if address hasn't been found in the player address list.
However, it's not safe if players[0] has been occupied with an address.
maybe try returning -1 instead.
function getActivePlayerIndex(address player) external view returns (int256) {
for (uint256 i = 0; i < players.length; i++) {
if (players[i] == player) {
return i;
}
}
return -1;
}
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.