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

In Fees.sol - hardcoded address of ISwapRouter

Summary

Hardcoding addresses the way it is done in Fees.sol is not a good practice.

Vulnerability Details

The Uniswap v3 router is hardcoded:

ISwapRouter public constant swapRouter =
ISwapRouter(0xE592427A0AEce92De3Edee1F18E0157C05861564);

This could lead to problems because:

  • The router might be deployed on another address on another chain

  • For some reason, Uniswap may deploy the router to some other address - making improvements on it, a bug gets discovered in the current contract, etc

Both of those cases will lead to the contract not working correctly.

Impact

Fees.sol will not work if the address of the router changes or is deployed on another address on a different chain.

Tools Used

Manual review

Recommendations

Pass the address of the SwapRouter in the constructor and/or create functionality for changing it, accessible only by the governance.

Support

FAQs

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

Give us feedback!