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

UniswapV3 router address is hardcoded

Summary

The uniswapV3 router address is hardcoded. May not work on other EVM-compatible chains like Avalanche.

Vulnerability Details

It is possible that the project might deploy on other EVM chains other than Optimism as was revealed in the Discord channel. Then, hardcoding the router address to 0xE592427A0AEce92De3Edee1F18E0157C05861564 becomes a problem because this address is an EOA on Avalanche mainnet. Hence, the swap would not take place when using this address. It is also not recommended to hardcode such things. They should be passed from the constructor.

Such an issue was judged as Medium in a previous contest - https://solodit.xyz/issues/m-05-swap_router-in-autopxgmxsol-is-hardcoded-and-not-compatible-on-avalanche-code4rena-redacted-cartel-redacted-cartel-contest-git

Impact

The swap will not happen in different EVM-compatible chains due to the hardcoded router address.

Tools Used

Manual review

Recommendations

Pass the router address through the constructor.

Support

FAQs

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