The sqrtRatioUpperX96, which is the upper price of the WETH/VULT pool, should be greater than the initialPoolPriceX96, which is the initial price of the pool. If not, the swap cannot be done because of a lack of liquidity in the price range.
Proof of Concept
The administrator of the project can initialize the ILOPool by calling initILOPool function.
To add liquidity to the WETH/VULT pool of Uniswap, it sets the upper tick and lower tick of the position(L88-104).
When the ILOPool is successfully launched, it provides liquidity into the range [sqrtRatioLowerX96, sqrtRatioUpperX96]. If the initialPoolPriceX96 is greater than the sqrtRatioUpperX96, there is no liquidity around the price initialPoolPriceX96. As a result, whitelisted users are unable to swap WETH to VULT because of a lack of liquidity.
Tools Used
Manual Review
Recommended Mitigation Steps
The initialPoolPriceX96 should be in the interval [sqrtRatioLowerX96, sqrtRatioUpperX96].
Lines of code
https://github.com/code-423n4/2024-06-vultisig/blob/0957ff9e50441cd6de6b4f6e28c7ea93f5cffa85/src/ILOManager.sol#L184-L261
Vulnerability details
Impact
The
sqrtRatioUpperX96
, which is the upper price of theWETH/VULT
pool, should be greater than theinitialPoolPriceX96
, which is the initial price of the pool. If not, the swap cannot be done because of a lack of liquidity in the price range.Proof of Concept
The administrator of the project can initialize the
ILOPool
by calling initILOPool function. To add liquidity to theWETH/VULT
pool of Uniswap, it sets the upper tick and lower tick of the position(L88-104).When the
ILOPool
is successfully launched, it provides liquidity into the range[sqrtRatioLowerX96, sqrtRatioUpperX96]
. If theinitialPoolPriceX96
is greater than thesqrtRatioUpperX96
, there is no liquidity around the priceinitialPoolPriceX96
. As a result, whitelisted users are unable to swapWETH
toVULT
because of a lack of liquidity.Tools Used
Manual Review
Recommended Mitigation Steps
The
initialPoolPriceX96
should be in the interval[sqrtRatioLowerX96, sqrtRatioUpperX96]
.Assessed type
Other