Skip to content
Business logic Audit finding Intermediate

Burning does not update reserves

The burn function in the ConcentratedLiquidityPool contract sends out tokens but only reduces the reserves by the fee amounts, not the full token amounts. This leaves the pool's recorded reserves higher than its actual balance, causing subsequent mint and swap operations to fail or require users to pay extra tokens.

cmichel Follow

Originally disclosed on Code4rena

Submitted by cmichel, also found by 0xsanson, broccoli, and pauliax

The ConcentratedLiquidityPool.burn function sends out amount0/amount1 tokens but only updates the reserves by decreasing it by the fees of these amounts.

unchecked {
    // @audit decreases by fees only, not by amount0/amount1
    reserve0 -= uint128(amount0fees);
    reserve1 -= uint128(amount1fees);
}

This leads to the pool having wrong reserves after any burn action. The pool’s balance will be much lower than the reserve variables.

Impact

As the pool’s actual balance will be much lower than the reserve variables, minting and swaping will not work correctly either. This is because of the amount0Actual + reserve0 <= _balance(token0) check in mint using a much higher reserve0 amount than the actual balance (already including the transferred assets from the user). An LP provider will have to make up for the missing reserve decrease from burn and pay more tokens.

The same holds true for swap which performs the same check in _updateReserves.

The pool essentially becomes unusable after a burn as LPs / traders need to pay more tokens.

Recommended Mitigation Steps

The reserve should be decreased by what is transferred out. In burn’s case this is amount0 / amount1.

sarangparikh22 (Sushi) confirmed

The original report as published on Code4rena, by cmichel. 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

Likely, the burn function incorrectly subtracts only the fee amounts from the reserves instead of the full token amounts transferred out.

Impact

The pool's actual balance becomes much lower than the reserve variables, causing mint and swap to fail or require users to pay more tokens, making the pool essentially unusable after a burn.

What the attacker needed

None

The fix

The reserve should be decreased by the full amount transferred out, i.e., amount0 and amount1, not just the fees.

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.

In a liquidity pool, reserves track how many tokens the pool holds. When someone withdraws tokens (burns), the pool should reduce its recorded reserves by the amount withdrawn. Here, it only reduced them by the small fee portion, so the recorded reserves stayed too high. Later, when someone tries to add or swap tokens, the pool thinks it has more than it really does, so the checks fail and the pool becomes unusable.

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 cmichel

View all

196 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.