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

Profits earned can be lost due to swapping conditions

Summary

Selling profits earned can be lost due to incorrect swap params passed to Swap Router.
The parameters are set have no slippage protection, so any MEV bot could see this transaction, aggressively sandwich attack it.

Vulnerability Details

In the swapping params, the minimum output amount(amountOutMinimum) is configured as 0. This basically means, in exchange for swapping for ERC20 token, the caller is agreeing to receive no tokens at all if such circumstances prevail.
This is not a production setup and should be restricted.

Also, the price Limit(sqrtPriceLimitX96) is also configured as 0 is defined the price limit for the swap to go through. Incase the price falls below the specified price, the swap does not happen.
This is not a production setup.

Impact

ERC20 tokens will be lost in the swapping which is not the intention of the protocol.

Tools Used

Manual Review

Recommendations

Add these two param as parameter of the function, so that caller has the ability to measure and take the risk of loosing the profits generated.

Support

FAQs

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