# ZS: destory_pair_amount burns reserves to drain pool

ZS token's destory_pair_amount() burns pair reserves, letting attacker manipulate ZS/BUSDT pool pricing and drain ~$14K via flash loan.

- Payout: Real-world hack
- Severity: high
- Program: ZS
- Analysis by: DeFiHackLabs
- Disclosed: 2023-10-08
- Write-up quality: 6/10
- Original: https://github.com/SunWeb3Sec/DeFiHackLabs/blob/main/src/test/2023-10/ZS_exp.sol
- Library page: https://bugbountylibrary.com/r/dhl%3A20231008-zs
- Tags: area:web3 domain:web3 impact:funds-loss kind:incident platform:defihacklabs sev:high tech:evm tech:solidity vuln:business-logic vuln:flash-loan vuln:oracle-manipulation

**Target:** BEP-20 token ZS and its PancakeSwap ZS/BUSDT pair
**Root cause:** The public destory_pair_amount() function burns the ZS balance held by the ZS/BUSDT pair, desynchronizing reserves so the attacker can swap at a manipulated price.
**Steps:**
1. Deploy AttackContract with 0.1 BNB; constructor swaps BNB->BUSDT->ZS, seeds ZS/BUSDT pair with 1 BUSDT and 1e18 ZS, calls `ZS_BUSDT.sync()`
2. Compute ZSAmountOut = pair ZS balance - `ZS.Burnamount()` - 1; get required BUSDT via `PancakeRouter.getAmountsIn`
3. Flash borrow BUSDT from BUSDT/USDC v3 pool via `BUSDT_USDC.flash(...)`
4. In `pancakeV3FlashCallback`: swap BUSDT->ZS on ZS/BUSDT pair via `ZS_BUSDT.swap(amountsOut[1],0,...)`
5. Call `ZS.destory_pair_amount()` to burn pair's ZS reserves
6. Swap ZS->BUSDT back on the now-desynced pair via `ZS_BUSDT.swap(0, amountsOut[1], ...)`
7. Repay flash loan + fee, transfer remaining BUSDT to exploiter
**Exploitation:** Attacker flash-borrows BUSDT, buys ZS to inflate pair ZS reserves, calls destory_pair_amount() to burn those reserves, then sells ZS back at the manipulated price, repaying the flash loan and keeping ~$14K profit.
**Insight:** Public burn/destroy functions that touch AMM pair balances let you desync reserves mid-swap; check any token function that reads or mutates pair-held balances for price-manipulation primitives.

