The withdraw function does not reduce totalDepositAmount when funds are withdrawn. This means that once totalDepositAmount reaches maxDepositAmount, further deposits will be blocked, even if users have withdrawn tokens and the actual contract balance is lower.
Proof of Concept
If deposits reach maxDepositAmount:
And then users withdraw their tokens:
Since totalDepositAmount is not decremented, new deposits are still blocked even though the contract balance is reduced.
Users may be unable to deposit despite available contract balance.
Encourages direct transfers instead of using deposit, worsening inconsistencies.
Contract fails to reflect the true net deposit amount.
manual review
Modify the withdraw function to decrement totalDepositAmount by the withdrawn amount:
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.