ConcentratedLiquidityPool.burn() Wrong implementation
The burn function in the ConcentratedLiquidityPool contract incorrectly updates reserves by subtracting only the fees instead of the full burned amounts, causing reserves to be larger than actual balances. This can break essential functions like swap and mint.
Submitted by WatchPug
The reserves should be updated once LP tokens are burned to match the actual total bento shares hold by the pool.
However, the current implementation only updated reserves with the fees subtracted.
Makes the reserve0 and reserve1 smaller than the current balance0 and balance1.
Impact
As a result, many essential features of the contract will malfunction, includes swap() and mint().
Recommended Mitigation Steps
ConcentratedLiquidityPool.sol#L263 L267 Change:
unchecked {
reserve0 -= uint128(amount0fees);
reserve1 -= uint128(amount1fees);
}
to:
unchecked {
reserve0 -= uint128(amount0);
reserve1 -= uint128(amount1);
}
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The burn function subtracts only the fee amounts from reserves instead of the full burned amounts.
Impact
Many essential features of the contract, including swap() and mint(), will malfunction.
What the attacker needed
None
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When you remove money from a shared pool, the pool's record of how much it holds must be updated to match reality. Here, the code only subtracted a small fee instead of the full amount removed, so the record became wrong. This could stop people from swapping or adding funds.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.