Frontfanz Rug Pull
What happened
Frontfanz (FANX) in this record is a BEP20 token on BNB Smart Chain, listed by De.Fi as a fake of the FrontFanz project, trading against BSC-USD on PancakeSwap V2. The contract was deployed on 2023-08-16 and the supply of 200,000,000 was minted to a tokenOwner constructor argument. De.Fi Security's post of 2023-08-19 reported a liquidity removal from the fake token and estimated the deployer's profit at about $30k after funds had been added to the pool and wash trading; De.Fi's REKT listing instead records 98,302 USDT lost. The listing says liquidity of 29,990 USDT was added on Aug 17, that 128,292 USDT was removed in five transactions over two days, and that the proceeds were spread across several EOA addresses.
De.Fi lists the deployer 0x57a7D780…1793eF, a scammer address 0xbcb66b0d…97be43 and a funder address 0xE6d14f65…76fD2F. The liquidity-adding transaction is 0xa7e3a6d6…82cc70 and the removals are 0x440999be…ba9e96, 0x9703161d…8c3378, 0x92bdbafa…462649, 0xa7ed179d…281d33 and 0xc85fb532…5bfd0b.
The code itself has no function that takes USDT out of the pool; the removals depend on whoever held the LP tokens. What the code does give the owner is an external hook on every non-exempt buy, sell and transfer, which the owner can point at a contract that decides per address whether the trade goes through.
How it happened
What the code allows (the sources do not show which of these were used):
- The constructor mints the whole supply to the
tokenOwnerargument (_mint(tokenOwner, total);) and sets_tokenOwner = tokenOwner;. The deployer becomes_ownerthroughOwnable, and the same code exempts both addresses from fees (excludeFromFees(tokenOwner, true); excludeFromFees(_owner, true);). - Only that address can seed the pool: when the pair holds none of the token,
if(balanceOf(uniswapV2Pair) == 0){ require(_tokenOwner == from); }blocks every other sender from the first liquidity transfer, so the initial LP tokens go to the project side. - Every non-exempt trade calls an external contract: buys run
tllcou.addInAmount(to, amount);, sells runtllcou.addOutAmount(from, amount);and plain transfers also runtllcou.addOutAmount(from, amount);. Thetllcouaddress starts empty and is set only throughrotctvvcEooicrZeool(IUserAmounttllcou _tllcou) public onlyOwner. Its code is not in the verified source, and any revert inside it reverts the user's trade, so the owner can set a contract that blocks chosen buyers or sellers; until it is set, a call to an address with no code reverts for non-exempt trades. - Addresses added with
addOtherTokenPair(onlyOwner) bypass the whole rule set:if(_isExcludedFromVipFees[from] || _isExcludedFromVipFees[to]){ super._transfer(from, to, amount); return; }. - On buys and sells the code takes a fixed 4%:
super._transfer(from, _destroyAddress, amount.div(100).mul(4)); amount = amount.div(100).mul(96);. The holder is debited the full amount, but this is the same 4% on both sides and not owner-adjustable. changeCanSellandmaxSellToken(callable by_tokenOwner) writecanSelland_maxSell, but neither value is read anywhere in the transfer path, so they do not block sells.startTimeis never assigned, so the buy-amount reductionamount = amount.div(1000000000000000)guarded bystartTime.add(10) >= block.timestampis not reachable.rescueTokenletscontractSender(the deployer) send any ERC20 held by the token contract to itself; it does not touch pool reserves.renounceOwnershipandtransferOwnershipexist, and the current on-chainowner()read returns 0x00000000…00dead.
What was reported:
- De.Fi lists 29,990 USDT of liquidity added on Aug 17 and five liquidity removals totalling 128,292 USDT by Aug 19, with the proceeds distributed to several EOAs. De.Fi Security's own post puts the deployer profit at about $30k instead of the listing's 98,302 USDT.
Protocol details
Evidence
- report @DeDotFiSecurity incident report twitter.com
- report De.Fi Security post on fake Frontfanz token, 2023-08-19 (via fxtwitter mirror) twitter.com
- transaction bscscan.com transaction 0x4409…9e96 bscscan.com
- transaction bscscan.com transaction 0x92bd…2649 bscscan.com
- transaction bscscan.com transaction 0x9703…3378 bscscan.com
- transaction bscscan.com transaction 0xa7e3…cc70 bscscan.com
- transaction bscscan.com transaction 0xa7ed…1d33 bscscan.com
- transaction bscscan.com transaction 0xc85f…fd0b bscscan.com
- address Frontfanz (TokenM) verified source on BscScan bscscan.com
- address bscscan.com address 0x57a7…93eF bscscan.com
- address bscscan.com address 0xE6d1…fD2F bscscan.com
- address bscscan.com address 0xbcb6…be43 bscscan.com
- analysis Sourcify match for Frontfanz repo.sourcify.dev
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.