The SmartVaultV3::swap()
function is vulnerable to sandwich attacks due to a lack of slippage protection. The issue arises from the calculation of amountOutMinimum
and the default setting of sqrtPriceLimitX96
to 0.
In the calculateMinimumAmountOut()
function, when collateralValueMinusSwapValue >= requiredCollateralValue
, the return value becomes 0. This, combined with the default sqrtPriceLimitX96
of 0 in the swap()
function, exposes the vault owner to sandwich attacks.
A sandwich attack can lead to financial losses for the vault owner. The default setting of sqrtPriceLimitX96 allows potential exploitation, jeopardizing the security of the smart contract.
Manual Review.
Ensure that the amountOutMinimum in calculateMinimumAmountOut() is never set to 0.
Specify a non-zero value for the sqrtPriceLimitX96 parameter in the swap() function to establish a stop price.
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.