In certain cases, the winner could be zero address.
Imagine a situation a user, say ABC enters the raffle, and is in 10th index position. But after some time, ABC changed the mind and went to get the refund using the function with the same name, which makes the players[10] = address(0)
. Now if someone calls the function selectWinner(...)
and the winnerIndex
is calculated as 10, then winner
will be address(0)
. And there is no check for zero address done as well.
Loss of funds to zero address.
Manual Review
Either checking if the index found has a non zero address, or using a modified version of the internal function _isActivePlayer(...)
which takes the index and returns true
if the index is a non-zero address.
Funds are locked to no one. If someone gets the refund issue, they also got this issue. IMPACT: High Likelihood: High
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.