The refund function is vulnerable to a reentrancy attack, as it first transfers the entranceFee and updates the state after.
The refund function looks like this:
As we can see, it sends the funds back to the msg.sender and updates the state after that, without using a reentrancy guard. This is vulnerable to a reentrancy attack and therefore allows anyone to fully drain the contract.
Complete loss of all funds
Manual Review
Use a reentrancy guard, or update the state before the transfer call.
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.