If this base token is ERC777 (extension of ERC20), we can call the addToPool()
function to add funds to the pool and reenter the function to continous update our token balance while only sending the amount passed as an argument to the function.
ERC777 has hooks that allow you to reenter a function. Since the docs weren't clear if ERC777 is allowed or not is must be mentioned that the contract is vulnerable to loss of funds if ERC777 were used.
A malicious attacker could drain the entire contract while only depositing 1 wei of tokens.
Manual review.
Either add a non reentrant modifier to the deposit
function or use the CEI patter by calling updateBalance
after the token transfer.
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.