The 'PuppyRaffle::enterRaffle' function has no checks if the address being entered into the raffle is the zero address(0). This can result in the address(0) winning the raffle
Because there are no verifications or checks of the specific addresses being entered into the raffle, the zero address(0) can be entered. With address(0) in the players list, it could potentially win the raffle once selectWinner is called.
The address(0) would not be able to be entered through the enterRaffle function if another player has already refunded from the raffle. This is because it would be considered a duplicate address.
This test returns as true. Proving that the zero address could be entered into the raffle through the enterRaffle function. This could result in the zero address winning the raffle.
[PASS] testAddressZeroCanEnterRaffle() (gas: 46758)
-Foundry
It would be suggested in the enterRaffle function to check if address(0) is being entered into the raffle. If it is, then revert with a custom error.
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.