The current implementation sets amountOutMinimum
to 0, indicating that no tokens are expected in return for a swap. This poses a significant risk, as it allows malicious actors to exploit the transaction by sandwiching it and taking all tokens from the swap.
The function calculateMinimumAmountOut
in SmartVaultV3.sol returns 0 when still in bounds, indicating a lack of expectation to receive anything for the swap.
Setting amountOutMinimum
to 0 exposes the transaction to front-running attacks, where malicious actors can exploit the lack of a minimum requirement and take all tokens from the swap, resulting in a loss of all tokens for the original sender.
Manual review
It is highly recommended to set a meaningful and non-zero value for amountOutMinimum
to prevent front-running attacks. By specifying a minimum acceptable amount, the vulnerability to sandwich attacks can be mitigated.
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.