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

Missing approve of _profits tokens before the swap is being executed

Summary

Before a swap is executed, tokens must be approved to be transferred by the router. Otherwise the swap will fail.

Impact

sellProfits() won't work as expected.

Tools Used

Manual Review

Recommendations

Add this line before the exactInputSingle() call:

IERC20(_profits).approve(address(swapRouter), 0);
IERC20(_profits).approve(address(swapRouter), amount);

Support

FAQs

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