The SmartVaultV3::swap()
is used to swap collateral in the vault to allow the adjustment of risk. In the swap function the SmartVaultV3::calculateMinimumAmountOut()
is called, user can swap any tokens that are not whitelisted as collateral for the vault if the collateralValueMinusSwapValue
is more than requiredCollateralValue
.
The SmartVaultV3::calculateMinimumAmountOut()
is used to check if the collateral in the vault is in excess, which means that the amount of collateral is higher than the threshold of collateral.
However in the SmartVaultV3::calculateMinimumAmountOut()
, user swap amountOutMinimum
will be set to 0, which invites sandwich attacks.
This is similar to my other report, but the vulnerability is different thus a different report.
Swaps will be sandwiched causing a loss of funds for users you withdraw their rewards.
Manual Review
Allow the caller pass a minAmountOut parameter to the function, which checks that the final output in tokens is not too low.
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.