The VaultCDepositController::withdraw contains the logic to withdraw tokens from the vault and send them to the staking pool. It handles the logic flaw for several scenarios:
The withdrawal amount (toWithdraw) is greater than the vault's current deposits (deposits).
The withdrawal amount is less than the vault's deposits and the withdrawal would leave less than the minimum deposits in the vault.
Normal withdrawal (default case).
In the first scenario, the contract fails to check if the minDeposits is enough after the withdrawal. Leaving the vault under the minimum.
Scenario:
toWithdraw = 50
deposits = 30
minDeposits = 20
The system enters the first if statement: toWithdraw = 50 > deposits = 30 returns true.
The system proceeds with the withdrawal of the all amount of the deposit (vault.withdraw(deposits)) leaving the vault empty and under the requested minimum deposit.
The minimum amount of deposits that a vault can hold is determined by the Chainlink staking contract. Vaults cannot have less than this minimum balance.
Manual review
Modify the first case in the withdrawal logic as follows:
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.