Slippage protection is ineffective in the swap()
function. minimumAmountOut
can be zero and this means no slippage protection.
The Swap()
function in SmartVaultV3.sol
use calculateMinimumAmountOut()
function to calculate the minimumAmountOut
value:
This function calculate the minimum amount of an output token that needs to be received in a token swap operation. The problem is that this function is designed to safeguard the vault's collateralization ratio, not to protect against market slippage. It can return a zero value and so the swap()
function remains without slippage protection.
Without slippage, If the price of the tokens changes significantly during the swap, it could result in a large slippage, causing users to lose a significant amount of funds.
Visual Studio Code
It would be better to pass the minimumAmountOut
value as a parameter in the swap()
function
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.