code-423n4 / 2021-09-wildcredit-findings

0 stars 0 forks source link

UniswapV3Helper: Redundant pool initialization #64

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Handle

hickuphh3

Vulnerability details

Impact

In getUserTokenAmount(), I presume that the pool is initialized for testing / development purposes. However, it was not commented out / removed, and becomes unused in the function.

Redundant

IUniswapV3Pool pool =
IUniswapV3Pool(
  PoolAddress.computeAddress(
    positionManager.factory(),
    PoolAddress.PoolKey({
      token0: token0,
      token1: token1,
      fee: fee
    })
  )
);

// (, int24 currentTick, , , , , ) = pool.slot0();

Recommended Mitigation Steps

Remove or uncomment the lines mentioned above.