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

Hardcoded UniswapV3Router won't work in some chains

Summary

The code specifies a hardcoded address what in some chains may totally not work.
As notice at blockscan, not all the addresses in those chains are UniswapV3Router, therefore, a hardcoded address won't be compatible with these chains.

In example, in Celo chain, UniswapV3Router it's located at 0x5615CDAb10dc425a742d643d949a7F474C01abc4 and not at 0xE592427A0AEce92De3Edee1F18E0157C05861564. In avalanche this address it's an EOA.

Vulnerability Details

Hardcoded addresses can lead to different wrong behaviors.

/// uniswap v3 router
ISwapRouter public constant swapRouter =
ISwapRouter(0xE592427A0AEce92De3Edee1F18E0157C05861564); //@audit hardcoded address of univ3 it's i.e an EOA in avalanche

Impact

Some chains will not work with this address value, they might be EOAs or different smart contracts

Tools Used

Manual

Recommendations

Make the variable immutable and assign it at constructor time

Support

FAQs

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