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

The `Fees` contract don't approve the `swapRouter` contract

Summary

The Fees contract don't approve the swapRouter contract

Vulnerability Details

The sellProfits function always revert because the swapRouter contract don't have allowance

Impact

The tokens received by Fees contract will be stuck forever

Recommendations

Approve the swapRouter contract before exactInputSingle call:

@@ -27,6 +27,8 @@ contract Fees {
require(_profits != WETH, "not allowed");
uint256 amount = IERC20(_profits).balanceOf(address(this));
+ IERC20(_profits).approve(address(swapRouter), amount);
+
ISwapRouter.ExactInputSingleParams memory params = ISwapRouter
.ExactInputSingleParams({
tokenIn: _profits,

Support

FAQs

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