Potential Underdeposit in VaultControllerStrategy
In the _depositToVaults function of the VaultControllerStrategy contract, there exists a potential scenario where a vault could end up with less than the minimum required deposits (_minDeposits). This occurs due to an incomplete check before depositing funds into a vault.
The issue arises when all of the following conditions are met:
The current deposits in the vault (deposits) are less than the minimum required (_minDeposits).
The amount that can be deposited (canDeposit = _maxDeposits - deposits) is less than the difference between the minimum required and current deposits (_minDeposits - deposits).
The amount to be deposited (toDeposit) is greater than canDeposit.
Under these conditions, the function will deposit canDeposit amount into the vault. However, this may not be sufficient to reach _minDeposits, leaving the vault underfunded. This could potentially violate the minimum deposit requirements set by the Chainlink staking contract.
vscode
Add an additional check to ensure that the actual deposit amount will bring the vault's total deposits to at least _minDeposits:
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.