20,000 USDC
View results
Submission Details
Severity: high
Valid

Potential sandwich attack

Summary

Setting swap amountOutMinimum to 0 allows for potential sandwich attacks

Vulnerability Details

Hardcoding the amountOutMinimum value allows for potential front and back run transactions by MEV bots making the tokens trade for a lot worse than their actual value.

Impact

Trades can go south and the WETH gotten from uniswap would be a lot less than the actual trade value of the asset sold

Tools Used

Recommendations

The value should be given as a function parameter after being calculated by uniswap sdk or should be calculated on the fly by an onchain oracle. Also see https://docs.uniswap.org/contracts/v3/guides/swaps/single-swaps#swap-input-parameters

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.