You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SolidlyV3AMO.sol::boostPrice() will round up the price in some cases
Summary
SolidlyV3AMO.sol::boostPrice() has wrongly implemented division logic, which in some cases could harshly round up the actual price.
Root Cause
In SolidlyV3AMO.sol:352 the division is implemented incorrectly, so when the price of boost is less than 1 the function will return 1
because of rounding.
boostPrice() will return 1 even if the price of boost is less than 1.
PoC
No response
Mitigation
Change the code line so it multiplies by Q96 ** 2 first and then divides by sqrtPriceX96 ** 2
The text was updated successfully, but these errors were encountered:
sherlock-admin2
changed the title
Shiny Tin Halibut - SolidlyV3AMO.sol::boostPrice() will round up the price in some cases
durov - SolidlyV3AMO.sol::boostPrice() will round up the price in some cases
Oct 30, 2024
durov
Medium
SolidlyV3AMO.sol::boostPrice() will round up the price in some cases
Summary
SolidlyV3AMO.sol::boostPrice()
has wrongly implemented division logic, which in some cases could harshly round up the actual price.Root Cause
In
SolidlyV3AMO.sol:352
the division is implemented incorrectly, so when the price of boost is less than 1 the function will return 1because of rounding.
https://github.com/sherlock-audit/2024-10-axion/blob/main/liquidity-amo/contracts/SolidlyV3AMO.sol#L343-L355
Internal pre-conditions
External pre-conditions
None
Attack Path
No response
Impact
boostPrice()
will return 1 even if the price of boost is less than 1.PoC
No response
Mitigation
Change the code line so it multiplies by
Q96 ** 2
first and then divides bysqrtPriceX96 ** 2
The text was updated successfully, but these errors were encountered: