LOW-8: The enterRaffle function shall check for zero-address to prevent apparently invalid input
The entryRaffle function currently does not do a check whether there is a zero-address in the input array.
Potentially making the selectWinner function draw an invalid address, impact on user experience, decreasing the value of the contract and raffle as such
Static analysis
Adding an "if" statement to the for-loop adding players to the players array.
function enterRaffle(address[] memory newPlayers) public payable {
[...]
for (uint256 i = 0; i < newPlayers.length; i++) {
if (newPlayers[i] == address(0) {
revert("PuppyRaffle: Zero-address cannot participate in the raffle");
}
players.push(newPlayers[i]);
}
[...]
}
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.