Skip to content
Business logic Audit finding Intermediate

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.

WatchPug Follow

Originally disclosed on Code4rena

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);
}

sarangparikh22 (Sushi) confirmed

The original report as published on Code4rena, by WatchPug. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

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.

More by WatchPug

View all

197 more disclosed reports, best first.

More from Sushi Trident contest phase 2

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.