Title: Inconsistent Handling of Token Order in Uniswap Pool Validation,`ZivoeSwapper::handle_validation_0502b1c5` assetIn should be token0 when zeroForOne_0 is true #716
Title: Inconsistent Handling of Token Order in Uniswap Pool Validation,ZivoeSwapper::handle_validation_0502b1c5 assetIn should be token0 when zeroForOne_0 is true
Low/Info issue submitted by recursiveEth
Summary
The functions handle_validation_e449022e and handle_validation_0502b1c5 within the ZivoeSwapper contract inconsistently handle the order of tokens in Uniswap pool validations. This inconsistency can lead to incorrect token order assumptions and potential failures in token swap operations.
Vulnerability Detail
In handle_validation_0502b1c5, when zeroForOne_0 is true, the validation assumes that assetIn corresponds to token1() of the UniswapV2 pool. However, in handle_validation_e449022e, the correct token order is used, with assetIn corresponding to token0() when zeroForOne_0 is true
Impact
he inconsistency in handling token order can result in erroneous assumptions about the token pair order in Uniswap pools. This can lead to failed swap operations, loss of funds
Title: Inconsistent Handling of Token Order in Uniswap Pool Validation,
ZivoeSwapper::handle_validation_0502b1c5
assetIn should be token0 when zeroForOne_0 is trueLow/Info issue submitted by recursiveEth
Summary
The functions handle_validation_e449022e and handle_validation_0502b1c5 within the ZivoeSwapper contract inconsistently handle the order of tokens in Uniswap pool validations. This inconsistency can lead to incorrect token order assumptions and potential failures in token swap operations.
Vulnerability Detail
In handle_validation_0502b1c5, when zeroForOne_0 is true, the validation assumes that assetIn corresponds to token1() of the UniswapV2 pool. However, in handle_validation_e449022e, the correct token order is used, with assetIn corresponding to token0() when zeroForOne_0 is true
Impact
he inconsistency in handling token order can result in erroneous assumptions about the token pair order in Uniswap pools. This can lead to failed swap operations, loss of funds
Code Snippet
https://github.com/sherlock-audit/2024-03-zivoe/blob/main/zivoe-core-foundry/src/lockers/Utility/ZivoeSwapper.sol#L133
Tool used
Manual Review
Recommendation
Ensure that the handling of token order in Uniswap pool validations is consistent across different functions within the contract.