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:
- the balance, what
token.balanceOf(pair)says right now, and - the reserve, what the pair last recorded.
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)
- Fund. Flash-borrow 350,000 USDT from a PancakeSwap V3 pool, for a 175 USDT fee.
- Position. Buy about 43.2M LAXO through the router. The reserves move from 420K/95.3M to 770K/52.1M.
- 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. - 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.
- Harvest. Call
pair.swap(~487,495 USDT, 0)directly, with no new transfer. The pair sees 41.07M LAXO of input, checkskagainst 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
- The pool is the burn source.
super._transfer(uniswapV2Pair, DEAD, ...), sized off the sale. - A resync locks it in.
sync()turns the lower balance into the official reserve. - Nothing leaves the other side. The USDT reserve is untouched, so
kshrinks in LAXO holders’ favor. - 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
- 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
fromargument of every internal transfer or burn on pair-bound paths. - Forced resync. Something re-anchors reserves to balances: a
sync()in the token, the next swap, or the attacker calling the publicsync(). On V2 forks this is nearly always possible. Check the pool type, not just the token. - 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.
- 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
- List every balance move out of the pair. In
_transfer,_updateand every helper they call, find transfers or burns whose source is the pair:bash grep -rnE "(pair|uniswapV2Pair|lpPair|_pair)\s*,\s*(DEAD|dead|address\(0|address\(this)" src/ grep -rnE "_burn\((pair|uniswapV2Pair)|balanceOf\[(pair|uniswapV2Pair)\]\s*-=" src/ - Look for
.sync()inside token logic. A token calling its pair’ssync()is nearly a confession. A token has no legitimate reason to rewrite its pair’s reserves. Then check the order: does the seller’s input land before or after the sync?bash grep -rn "\.sync()" src/ - Find the trigger, and who can pull it. Is the burn fired by a sell, by any transfer including zero-value ones, by a timer, by a public
burn(address, uint), or by a “settle pending burns” function? If a stranger can fire it when they choose, they can position first. - Model the caps. Work through
MAX_SELL_BURN, per-transaction caps, cooldowns and exemptions, and ask whether they really boundB / y. In LAXO they didn’t. Cooldowns per address fall to fresh helper contracts. - Run a fork probe. Call
getReserves(), send a smalltransfer(pair, x), then callgetReserves()again. If the token reserve fell by more than you sent and the paired reserve didn’t move, you’ve confirmed the class. Then size the buy to maximizeB / y.
Lookalikes that are safe, and why
Almost every BNB Chain tax token burns something on a sell. Most of them aren’t this bug.
- A sender-side sell burn.
_burn(sender, fee); super._transfer(sender, pair, rest);The seller pays the burn out of their own sale. The pair’s existing balance is never touched, andswap()prices the actual input. That’s a plain tax. - Buyback and burn through the router. The treasury buys the token with USDT through
swap(), then burns it. Tokens leave the pool, but USDT enters in exchange andkholds. The price rises because someone paid for it. - Concentrated-liquidity pools. Uniswap V3 and V4 pools don’t price from
balanceOfand have nosync(). Burning from a V3 pool’s balance makes it insolvent for the last withdrawers, which is a different bug, but it doesn’t move the quoted price. - Caution: tiny scheduled pool burns. LAXO’s own hourly burn of a tiny percentage of the pair’s balance, plus
sync(), technically has every ingredient, but each firing is very small. Report it as a design flaw. It becomes critical if the rate is misconfigured, if a stuck timer lets the backlog fire all at once, or if the attacker can shrinkyfirst.
Fixes that work, and the ones that don’t
- Never touch the pair’s balance. Deflation should burn the seller’s tokens or the protocol’s own treasury, never
balanceOf[pair]. This is the only fix that fully closes the class. - If the pool must shrink, go through the pair. Use the pair’s own
swap()(a buyback) or an LPburn(), so both reserves move together andkholds. - Not a fix: removing
sync()from the token. On V2,sync()is permissionless. If the token still burns from the pair, the attacker callspair.sync()on the next line. - Not a fix: tighter per-transaction caps. Caps limit each burn, not whether the attacker can hold the token. An attacker loops smaller sells or uses many helper addresses.
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.
- Sell hook (LAXO and many siblings).
recipient == pairfires a pair-sourced burn sized off the sale, thensync(). - Accrue, then detonate (bce, March 2026, about 800K USDT). Sells don’t burn right away. They add to a global “pending burn” counter. Any later transfer, even of zero tokens, burns the whole counter from the pair and syncs. The attacker builds the charge with sells and fires it for free.
- An open burn function, no hook at all. A
burn(address account, uint256 value) externalwith no access control lets the attacker burn the pair’s balance directly and callsync(). That’s part 5 of this series (unguarded fund movers) combined with this one. skim()as the trigger (SBRToken, March 2025, about 8.5 ETH). Every transfer wiped the sender’s whole balance, which looks harmless until you notice thatpair.skim()makes the pair the sender. One skim zeroed the pair’s tokens, a 1-wei donation plussync()set the token reserve to 1 against the full WETH side, and pre-bought dust drained it. There was no sell path at all.
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:
if (from == pair) { rewardPool.transfer(to, amount / 10); }→ V1. A pair-gated payout with no limit on repetition. Check for epoch or cap guards before reporting.function settleBurn() external { _burn(pair, pendingBurn); pendingBurn = 0; IPair(pair).sync(); }→ The main pattern, accrue-then-detonate. Next question: what growspendingBurn, and can the attacker grow it first?function poke() external { reserve = Math.min(reserve, token.balanceOf(address(this))); }→ Neither. The resync is clamped downward, so it can never fold a surplus into the book, and nothing removes tokens. It’s the safe form ofgulp.
Test yourself
- A token takes 5% of every sell with
_burn(sender, fee)and never callssync(). Report it? No. The burn comes from the seller, andswap()prices the real input. This is the most common near miss. Don’t let the word “burn” trigger a report. - 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. - 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. - 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.
- 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 takesyfrom 100M to 90M, a 1.11x jump. After your buy (about 2M USDT against 50M TKN, ignoring fees), the same burn takesyfrom 50M to 40M, a 1.25x jump, applied to a 50M position. A fixed burn hits harder against a smaller reserve.
Recap
- A token removes tokens from the pair’s balance, a resync makes it official, and token holders sell into a curve whose other side nobody drained.
- The two lines:
_transfer(pair, DEAD, x)pluspair.sync(). The first question for any tax token: whose balance goes down? - The trap: V2’s
sync()is public. A token that burns from the pair is vulnerable whether or not it callssync()itself. - The triggers: sell hooks, accrue-then-detonate, open
burn(address)functions,skim()as the sender, and scheduled burns. Grep for the effect, not the trigger. - When you see one, check its siblings from the same deployer or template. Dozens of copies is a forked template, not a coincidence.