Due to this function's accounting referencing the contract balance directly, any unaccounted for changes to the contract balance, combined with the functions requirement for the balance to equal
totalFees, means these funds can never be withdrawn.
This function requires the contract's balance to equal the totalFees variable, updated when a winner is selected. If the contract's balance were to change and not be accounted for in totalFees, this function could not be callable.
This is achievable via a selfDestruct(address(puppyRaffle))
function on another contract. The balance of the destructed contract would be dumped onto Puppy Raffle, breaking the withdraw function.
Funds would become irretrievably locked on contract
Foundry
Manual Review
Don't reference the contract's balance in internal accounting. Replace with a variable that separately tracks contest funds.
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.