Summary
ManagedLeveragedVault.sol::deposit() doesn't have slippage control for the shares minted.
Vulnerability Detail
The deposit function is as follows:
function deposit(uint256 assets, address receiver, AddCollParams calldata params)
public
notPaused
nonReentrant
returns (uint256 shares)
{
BoycoVaultStorage storage b$ = _getBoycoVaultStorage();
shares = _deposit(assets, receiver);
IERC20(asset()).forceApprove(address(b$.collVault), assets);
uint256 collVaultShares = b$.collVault.deposit(assets, address(this));
if (collVaultShares < params.minSharesOut) revert VaultSlippage(params.minSharesOut, collVaultShares);
_addColl(collVaultShares, params.upperHint, params.lowerHint);
}Note that there is no slippage control on the shares amount minted, whose ratio may change depending on several protocol actions or price updates. There is slippage control for the collVaultShares, but this may still mean a lower amount of shares as they are not 100% related.
Impact
User takes slippage losses.
Code Snippet
Tool Used
Manual Review
Recommendation
Add slippage control to shares.