The 'PuppyRaffle::refund' function does not follow the CEI 'Checks-Effects-Interactions' design pattern. This can lead to risk of funds or reentrancy attacks.
Because refund sends the player their entrance fee before removing them from the players array, this is susceptible to a reentrancy attack. However, send does have a gas limit of 2300 units, this should prevent a reentrancy attack from happening because there would not be enough gas to recursively call back into the function to exploit the funds.
Unlikely, but potential loss of funds due to reentrancy attack. Regardless of the gas limit of send, this function should follow the CEI design pattern.
-Foundry
To follow the CEI design pattern, these two lines should be swapped. The players array should be updated before sending any value back to the player.
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.