Omniscia Euler Finance Audit

SwapHandlerUniAutoRouter Code Style Findings

SwapHandlerUniAutoRouter Code Style Findings

SHA-01C: Variable Naming Ambiguity

Description:

The contract relies on three separate Uniswap implementations (UniswapRouter02, UniswapRouterV2, and UniswapRouterV3) with no clear distinction as to what UniswapRouter02 relates in comparison to UniswapRouterV2.

Example:

contracts/swapHandlers/SwapHandlerUniAutoRouter.sol
11constructor(address uniSwapRouter02_, address uniSwapRouterV2, address uniSwapRouterV3) SwapHandlerCombinedBase(uniSwapRouterV2, uniSwapRouterV3) {
12 uniSwapRouter02 = uniSwapRouter02_;
13}

Recommendation:

We advise this distinction to be made clear by renaming the uniswapRouter02 variable throughout the test-suites, vendor artefacts, and the contract code itself as it is currently ambiguous and increases the chances of human error.

Alleviation:

The Euler Finance team stated that while the variable naming is not ideal, it is in-line with the naming conventions utilized throughout the Uniswap repositories and as such will be kept in place. Given that the purpose of the naming convention is not to deviate from the standard (i.e. the original implementations), we consider this exhibit nullified.