If one of the players refunded, the raffle cannot start, it reverts during transfer of funds to the winner, so entrance fees may be frozen in the protocol.
If 4 players entered, one of them refunded, it means there are only three active players and address(0) (which is also an issue), so it doesn't revert on the check that there must be at least 4 players to select a winner (function selectWinner()).
The test:
It reverts with "PuppyRaffle: Failed to send prize pool to winner"
Impact is considered high, the contract will stop working, it won't be able to select winner, or collect fees, because there are active players (address(0) at least won't ever leave that beautiful raffle!), but players can refund as well.
Foundry
Actually delete players from an array of players and not replace them with address(0). In function refund() Replace players[playerIndex] = address(0); with:
Here is the test, which shows that this is working:
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.