The Standard

The Standard
DeFiHardhat
20,000 USDC
View results
Submission Details
Severity: medium
Valid

SmartVaultV3: swap fee is fixed amount

Summary

when you look at swap function you will see on the first link of function you are calculation swapFee but in you go down where you create params for external functions call you will found that you did used the swapFee which we calculation earlier.

Vulnerability Details

Wrong fee or fixed value on fee ,this fee either be equal to swapFee or it will be fixed like 3000 or maybe need setFee functions

ISwapRouter.ExactInputSingleParams memory params = ISwapRouter.ExactInputSingleParams({
tokenIn: inToken,
tokenOut: getSwapAddressFor(_outToken),
// because this contract is no upgradabel it will be more difficult to change fee in future
fee: 3000, // @audit-info this fee not be equal to swapFee or it will be fixed like 3000 or maybe need set fee functions
recipient: address(this),
deadline: block.timestamp,
amountIn: _amount - swapFee,
amountOutMinimum: minimumAmountOut,
sqrtPriceLimitX96: 0
});

Impact

charge wrong fee.

Tools Used

Manual review.

Recommendations

Used swapFee with you calculate earliar or if it like cont value then create proper setter and getter

Updates

Lead Judging Commences

hrishibhat Lead Judge almost 2 years ago
Submission Judgement Published
Validated
Assigned finding tags:

fixed-uni-fee

hrishibhat Lead Judge almost 2 years ago
Submission Judgement Published
Validated
Assigned finding tags:

hardcoded-fee

Support

FAQs

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

Give us feedback!