The Standard

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

Fixed fee level is used when swap tokens on Uniswap

Summary

Fixed fee level is used when swap tokens on SwapRouter

Vulnerability Details

In SmartVaultV3::swap() is used to swap tokens for tokens from liquidations, when constructs ISwapRouter.ExactInputSingleParams, a fixed fee 3000 (0.3%) level is used:
https://github.com/Cyfrin/2023-12-the-standard/blob/main/contracts/SmartVaultV3.sol#L221

However, not all pools in Uniswap or on other Dexes are created with fee level being 3000, for example, fee level of XMON / ETH (0x59b4bb1f5d943cf71a10df63f6b743ee4a4489ee) on Mainnet is 10000 (1%), fee level of WETH / BOB (0x1a54ae9f662b463f8d432482975c17e51518b50d) on Optimism is 500 (0.05%).

Impact

Using fixed fee level when swap tokens may lead to some fee tokens being locked in contract.

Tools Used

Manual Review

Recommendations

Passing fee level to SmartVaultV3::swap() function as parameter.

Updates

Lead Judging Commences

hrishibhat Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

fixed-uni-fee

hrishibhat Lead Judge over 1 year 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.