Submitted by SBSecurity, also found by DadeKuma, ZanyBonzy, aldarion, peanuts, 0xhashiman, Tricko, and Q7
When operations need to calculate the Superposition positions fee growth, it uses a similar function implemented byuniswap v3.
However, according to this known issue,Uniswap/v3-core#573, the contract implicitly relies on underflow/overflow when calculating the fee growth if underflow is prevented, some operations that depend on fee growth will revert.
It can be observed that the current implementation oftick::get_fee_growth_insidedoes not allow underflow/overflow to happen when calculatingfee_growth_inside_0andfee_growth_inside_1 because the contract uses checked math with additional overflow/underflow checks; which will perform subtraction that returnsnoneinstead of wrapping around on underflow in tick.rs.
Especially the last lines where we have fee_growth_global_0 - fee_growth_below_0 - fee_growth_above_0 and fee_growth_global_1 - fee_growth_below_1 - fee_growth_above_1.
In case either one of the calculation underflows we will receive Error::FeeGrowthSubTick instead of being wrapped and continue working.
Uniswap allows such underflows to happen because PositionLibrary works with Solidity version < 0.8. Otherwise, this will impact crucial operations that rely on this call, such as liquidation, and will revert unexpectedly. This behavior is quite often, especially for pools that use lower fees.
Furthermore, one of the Main Invariants in the README mentioned that Superposition should follow the UniswapV3 math faithfully, which is not the case here, violating the invariant.
https://github.com/code-423n4/2024-08-superposition?tab=readme-ov-file#main-invariants
H-04 from Particle Leverage AMM.
Use unsafe/unchecked math when calculating the fee growths.
Under/Overflow
af-afk (Superposition) confirmed 
0xsomeone (judge) commented:
