The refund function can be exploited by a Reentrancy attack and drain all the ETH from the Raffle.
The refund function resets the players[playerIndex] AFTER it sends ether to the msg.sender. This opens up a reentrancy attack vector. Assuming msg.sender a smart contract and has entered the raffle and knows it's index within the players array. The contract can use a recieve function that calls refund it is allowed to reenter the function and receive extra ether. They can repeat this until they have drain the raffle of all ether.
Loss of all ether locked in the PuppyRaffle contract
Manual Review
Use the Checks, Effects, Interactions flow with functions that send ether. For this function move the players[playerIndex] = address(0); before the line payable(msg.sender).sendValue(entranceFee);
reentrancy in refund() function
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.