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
boostPrice() may overflow for SolidlyV3AMO, and related features would brick, e.g. mintSellFarm(), unfarmBuyBurn().
PoC
N/A
Mitigation
Use FullMath (like UniswapV3).
The text was updated successfully, but these errors were encountered:
sherlock-admin2
changed the title
Fast Lemonade Hawk - SolidlyV3AMO boostPrice() may overflow.
pkqs90 - SolidlyV3AMO boostPrice() may overflow.
Oct 30, 2024
pkqs90
Medium
SolidlyV3AMO
boostPrice()
may overflow.Summary
SolidlyV3AMO
boostPrice()
may overflow.Root Cause
In the first if-branch, the price is calculated by
(10 ** (boostDecimals - usdDecimals + PRICE_DECIMALS) * sqrtPriceX96 ** 2) / Q96 ** 2
.Since boostDecimals - usdDecimals == 12, in an extreme case if boost/USD is larger than 1e8, this would overflow. Because
1e8 * 1e12 * 2**192 > 2**256
Internal pre-conditions
N/A
External pre-conditions
N/A
Attack Path
N/A
Impact
boostPrice()
may overflow for SolidlyV3AMO, and related features would brick, e.g.mintSellFarm()
,unfarmBuyBurn()
.PoC
N/A
Mitigation
Use FullMath (like UniswapV3).
The text was updated successfully, but these errors were encountered: