# BFCToken: transfer/skim loop drains BUSDT pair

BFC token's transfer logic let attacker repeatedly transfer tokens to its own pair and skim BUSDT, draining ~$38K via flash loan.

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

**Target:** BEP-20 token and PancakeSwap V2 pair
**Root cause:** BFC token's transfer behavior combined with pair skim() allowed the attacker to inflate pair BUSDT reserves without proportional BFC cost, letting skim() extract BUSDT.
**Steps:**
1. Flash loan 400,000 BUSDT from BUSDT/WBNB pair via `swap(400_000 * 1e18, 0, address(this), swapData)`.
2. In pancakeCall, swap BUSDT to BFC and seed the BUSDT/BFC pair.
3. Loop up to 100 times: `BFC.transfer(address(BUSDT_BFC), balanceBFC)` then `BUSDT_BFC.skim(address(this))`, capping balanceBFC at `(pairBalanceBFC - 1) * 50`.
4. Swap accumulated BFC back to BUSDT.
5. Repay flash loan `(_amount0 * 1000) / 997 + 1` and swap profit to BNB.
**Exploitation:** Flash-borrowed BUSDT, seeded BFC/BUSDT pair, then looped BFC transfers plus skim() to repeatedly extract BUSDT from the pair, repaying the flash loan and keeping profit.
**Insight:** When a token's transfer logic interacts with pair skim(), test whether repeated transfer+skim cycles can drain the quote asset without proportional input cost.

