Killua
← All parts Bug Hunting Field Guide · Part 8 of 8

Pool-side burn plus sync(): the token that deletes its own pool

Killua · 13 min read

A Uniswap V2 pair assumes its token balances only change through mint, burn, swap and honest transfers. A tax token that destroys tokens held by the pair, then calls sync(), deletes one side of the pool for free. Whoever still holds the token now has a claim on the other side that nobody paid for.

This is the most common way BNB Chain tax tokens get drained. I’ve seen dozens of incidents with this exact shape, because launchpad templates copy the same “burn from the LP to pump the price” feature from token to token.

Background: balances versus reserves

A Uniswap V2 pair keeps two numbers for each token:

Prices come from reserves only. swap() enforces x · y ≥ k, using reserves as “before” and balances as “after”.

Two public functions reconcile the two. skim(to) sends any balance above the reserve to to. sync() does the opposite: it overwrites the reserves with the current balances. Both are permissionless, and neither asks why the balance changed.

A token contract can break the pair’s assumption easily, because the token contract is the balance ledger. If the token’s _transfer moves tokens out of the pair’s balance, to a dead address, a treasury or itself, the balance drops with no trade at all. Call sync() and the pair adopts the smaller number as its reserve. One side of the pool has been deleted, and the curve now prices the token much higher.

The bug in one sentence

A token routine removes tokens from the pair’s own balance with nothing leaving the other side, a resync makes the smaller balance official, and whoever holds the token sells into the shrunken curve for more of the paired asset than the pool honestly owes.

Keep one question in mind for every tax token: on this path, whose balance goes down, the sender’s or the pair’s? A sender-side burn is just a tax. A pair-side burn takes value from the LPs and gives it to the token holders.

A real case: LAXO (BNB Chain, February 2026, about 137K USDT)

LAXOToken was a USDT-paired PancakeSwap V2 tax token. At the time of the attack the pair held about 420K USDT against 95.3M LAXO. Its _transfer layered several “tokenomics” features on top of plain transfers. The sell branch is the one that matters:

uint256 maxAmount = (balanceOf[sender] * 9999) / 10000;
if (amount > maxAmount) { amount = maxAmount; } // oversized requests clamp to 99.99%

// ... buy branch elided ...
} else if (uniswapV2Pair == recipient) {                 // SELL: user -> pair
    uint256 sellFee = (amount * 500) / 10000;            // 5% to the contract
    if (sellFee > 0) { super._transfer(sender, address(this), sellFee); }

    uint256 burnAmount = amount - sellFee;               // 95% of the sale
    uint256 currentBurned = balanceOf[DEAD];
    if (currentBurned < MAX_SELL_BURN) {
        uint256 maxCanBurn = MAX_SELL_BURN - currentBurned;
        uint256 actualBurn = burnAmount > maxCanBurn ? maxCanBurn : burnAmount;
        super._transfer(uniswapV2Pair, DEAD, actualBurn); // FROM THE PAIR, not the seller
        IUniswapV2Pair(uniswapV2Pair).sync();             // makes the deletion official
    }
    // ... a fee swap that also pulls USDT out of the pair ...
    super._transfer(sender, recipient, burnAmount);       // seller's 95% lands AFTER the sync
}

Read the burn line slowly. The burn source is uniswapV2Pair, not sender. The burn is 95% of the sale, but it comes out of the pool’s inventory. Then sync() makes the pair record a LAXO reserve that’s smaller by exactly that amount. The USDT reserve doesn’t change.

The last line is the second half of the trick. The seller’s tokens reach the pair only after the sync, so they sit there as balance above the reserve, which is exactly what V2’s swap() counts as input. The attacker then calls pair.swap() directly. The sale is priced as if the pool had already lost the sale’s worth of LAXO.

The math: where 137K comes from

Here token0 is USDT and token1 is LAXO. Let x be the USDT reserve and y the LAXO reserve. A swap of Δy LAXO in pays x · Δy′ / (y + Δy′), where Δy′ = 0.9975 · Δy after PancakeSwap’s 0.25% fee.

After the attacker's 350K USDT buy:
  x = 770,327.57 USDT    y = 52,057,043.67 LAXO

Sell branch burns 41,072,653.26 LAXO from the pair, then sync():
  x = 770,327.57 USDT    y = 10,984,390.42 LAXO    (k down 78.9%, LAXO price ×4.74)

Fee swap runs, then the seller's 95% lands as unreserved balance:
  x = 643,919.14 USDT    y = 13,146,151.68 LAXO

swap() counts the seller's 41.07M LAXO as input against those reserves:
  out = 643,919.14 · (0.9975 · 41.07M) / (13.15M + 0.9975 · 41.07M) ≈ 487,495 USDT

Counterfactual: the same dump with no pool-side burn:
  out = 770,327.57 · (0.9975 · 41.07M) / (52.06M + 0.9975 · 41.07M) ≈ 339,260 USDT
  → about 10.9K USDT LOSS after repaying the 350,175 USDT flash loan

The counterfactual is the most important line. Without the burn, buying and selling straight back loses about 10.9K USDT to fees and slippage, like any honest round trip. The burn alone turns that loss into a 137K profit. The attacker didn’t trade well. The token handed them value that belonged to the LPs.

In general, if a resync removes B tokens from a reserve y:

k′ = k · (y − B) / y        p′ = p · y / (y − B)

The attacker wants B / y as large as possible. That’s why the LAXO attacker first bought about 45% of the pool’s LAXO: a bigger buy means a bigger sell, which means a bigger burn against a smaller remaining reserve.

The attack, step by step (one transaction)

  1. Fund. Flash-borrow 350,000 USDT from a PancakeSwap V3 pool, for a 175 USDT fee.
  2. Position. Buy about 43.2M LAXO through the router. The reserves move from 420K/95.3M to 770K/52.1M.
  3. Detonate. Call transfer(pair, balanceOf(pair)). That’s more than the attacker owns, so the 99.99% cap clamps it to their full balance. The sell branch burns about 41.07M LAXO from the pair and syncs. The LAXO reserve drops from 52.06M to 10.98M, and the USDT reserve stays at 770K.
  4. Side effects. Still inside the same transfer, the contract sells its accrued fee tokens through the pair. Then the attacker’s 41.07M LAXO lands as balance that isn’t in the reserve.
  5. Harvest. Call pair.swap(~487,495 USDT, 0) directly, with no new transfer. The pair sees 41.07M LAXO of input, checks k against the shrunken reserves and pays out. Repay 350,175 USDT and keep about 137,320 USDT. The LPs absorb the loss.

Why it worked: four facts

  1. The pool is the burn source. super._transfer(uniswapV2Pair, DEAD, ...), sized off the sale.
  2. A resync locks it in. sync() turns the lower balance into the official reserve.
  3. Nothing leaves the other side. The USDT reserve is untouched, so k shrinks in LAXO holders’ favor.
  4. The attacker holds the burned token. They bought before the burn, and their own sale lands after the sync, priced against the shrunken reserve.

Remove any one and the attack stops paying, except fact 2. On Uniswap V2, sync() is public, so the attacker can always supply it themselves. Removing the sync() call from the token is not a fix.

The four ingredients

  1. Pool-side burn. A token routine destroys or moves tokens held by the pair, and the amount scales with something the attacker controls: sale size, an accrued counter or a configured rate. To find it, check the from argument of every internal transfer or burn on pair-bound paths.
  2. Forced resync. Something re-anchors reserves to balances: a sync() in the token, the next swap, or the attacker calling the public sync(). On V2 forks this is nearly always possible. Check the pool type, not just the token.
  3. Uncompensated deletion. Nothing flows out on the paired side. Does the paired reserve change in the same step? If only one side moves, it’s uncompensated.
  4. Attacker positioned. The attacker can hold the token through the burn and sell afterwards. This is almost always true, since anyone can buy. Check whether caps let you keep it.

How to hunt for it

Lookalikes that are safe, and why

Almost every BNB Chain tax token burns something on a sell. Most of them aren’t this bug.

Fixes that work, and the ones that don’t

The same bug in other clothes

The trigger varies a lot, and the two-line core doesn’t. A grep that only looks for sell hooks will miss most of these.

Variant drills: same machinery, different bug

Two related patterns use the same skim/sync machinery but break something different. Mixing them up means writing the wrong root cause.

V1: transfers from the pair trigger a mint or payout (H2O, BNB Chain). Nothing is deleted from the pool. Instead, the token mints or pays a bonus whenever the pair is the sender, and skim() lets anyone make the pair the sender, for free, as often as they like:

function transfer(address to, uint256 amount) public virtual override returns (bool) {
    address owner = msg.sender;
    _spendAllowance(owner, to, 0);
    _transfer(owner, to, amount);
    if (pair == msg.sender) {      // pair.skim(to) satisfies this
        _calulate(to, amount);     // mints side tokens and pays a reserve bonus
    }
    return true;
}

The attack transfers to the pair, calls skim(self), repeats dozens of times in one transaction, then dumps. The giveaway is a hook that branches on from == pair or msg.sender == pair and does more than tax.

V2: the record drifts below real custody, then a public resync folds it in (Ocean BPool, Polygon). This is the opposite direction. Real custody rises above the book, because a join path pulls in tokens it never records. A public upward resync (gulp) then folds the surplus into pricing, and fee-free exits pay it out. The token is innocent here.

function gulp(address token) external _lock_ {   // no access control
    require(_records[token].bound, "ERR_NOT_BOUND");
    _records[token].balance = IERC20(token).balanceOf(address(this)); // upward, unclamped
}

The giveaway is a record field assigned from balanceOf(address(this)) in a public function, with no min() clamp. With a swap fee above zero the round trip loses money, so gulp alone isn’t a finding.

Classify these snippets:

Test yourself

  1. A token takes 5% of every sell with _burn(sender, fee) and never calls sync(). Report it? No. The burn comes from the seller, and swap() prices the real input. This is the most common near miss. Don’t let the word “burn” trigger a report.
  2. A token burns 30% of each sale from the pair but never calls sync(). The developer says “no sync, no bug.” Agree? No. sync() is public on V2, so the attacker calls it on the next line.
  3. The sell hook burns from the pair, syncs, and in the same branch sends the pair an equal value of USDT. Exploitable? Probably not, if the amounts match. But check the order. If sync() runs before the USDT lands, the reserve is one-sided at that moment, and a same-call swap can price against it.
  4. How is this the mirror image of part 3 (donation attacks)? Same root, opposite sign. In both, a balance changes outside the protocol’s accounting, and something reads the raw balance as truth. In part 3 the attacker adds tokens. Here the token removes the pair’s tokens.
  5. A pool holds 1M USDT and 100M TKN. A public function burns a fixed 10M TKN from the pair, plus sync(). You can buy first. How does buying 50M TKN change your payoff? It multiplies the price jump. Untouched, the burn takes y from 100M to 90M, a 1.11x jump. After your buy (about 2M USDT against 50M TKN, ignoring fees), the same burn takes y from 50M to 40M, a 1.25x jump, applied to a 50M position. A fixed burn hits harder against a smaller reserve.

Recap