The PuppyRaffle::enterRaffle function doesn't check if an entered address is equal to Zero Address. If the PuppyRaffle::selectWinner function chooses the Zero Address as winner, the transaction will revert.
The function PuppyRaffle::enterRaffle accepts as input an array of addresses, but it doesn't check if inside the array there is the Zero Address.
If in the PuppyRaffle::selectWinner function, address Zero is chosen as the winner, _safeMint(winner, tokenId); will revert with the error ERC721: mint to the zero address.
It is possibile to check with this test, before run the test it is necessary to edit manually the smart contract to select the Zero Address as Winner, editing the row 157 inside selectWinner function.
and run this test
The problem is not of a high level because it only occurs if the Zero address comes out as the winner. If this happens the transaction will fail and it will be enough to relaunch it (or it will be launched automatically n seconds later) and if a valid address is chosen the transaction will go to successful.
Foundry
Manual check
To fix the problem, just check that no address in the array is equal to Zero Address, and if not, do revert.
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.