Description:Description\
In the TokenPrices::univ3Price.sol the function's uses UniswapV3.slot0 to get the value of sqrtPriceX96 which it use to perform the swap, however the sqrtPriceX96 gotten from Uniswap.slot0 is the most recent data point and can be manipulated easily via MEV bots & Flashloans⚡️ with sandwich attacks can cause lose of funds when interact with the Uniswap.swap function.
Attack Scenario\
An Attacker can Simply manipulate the sqrtPriceX96 and if the Uniswap.swap function is called with the sqrtPriceX96 the token will be bought at a higher price, and The Attacker would back run the transaction to sell thereby making gain but causing loss to whoever called those functions.
Recommended Mitigation Steps\
Use The TWAP to get the value of sqrtPriceX96.
Github username: @hunter-w3b Twitter username: hunter_w3b Submission hash (on-chain): 0x3c89e4bc9a1dd40615ea10cd4e069cca84d92f7001f10f6da4a96ba7e61b7691 Severity: medium
Description: Description\ In the
TokenPrices::univ3Price.sol
the function's uses UniswapV3.slot0 to get the value ofsqrtPriceX96
which it use to perform the swap, however thesqrtPriceX96
gotten from Uniswap.slot0 is the most recent data point and can be manipulated easily via MEV bots & Flashloans⚡️ with sandwich attacks can cause lose of funds when interact with the Uniswap.swap function.Attack Scenario\ An Attacker can Simply manipulate the sqrtPriceX96 and if the Uniswap.swap function is called with the sqrtPriceX96 the token will be bought at a higher price, and The Attacker would back run the transaction to sell thereby making gain but causing loss to whoever called those functions.
Recommended Mitigation Steps\ Use The TWAP to get the value of sqrtPriceX96.