BNBpay Rug Pull
What happened
BNBpay is a BEP-20 token on BNB Chain (100M supply credited to the deployer) that trades on PancakeSwap against BUSD. De.Fi's REKT database lists it as an exit scam on 2023-09-21 with 53,973 USD taken by the deployer: it says the deployer removed liquidity from the LP pool, moved the proceeds to another EOA address and then deposited them into Tornado Cash.
The verified source shows why holders were exposed even before any liquidity removal. Ordinary holders could only sell through the pair or router if a gate in _canTransfer passed, and the owner holds two setters that can make it fail for everyone. Transfers between ordinary wallets are always refused, the owner can add to the supply without limit, and a privileged master address has a permanent unlimited allowance over the pair's own tokens. The code shows what the contract allows; the transactions below are the ones De.Fi's listing names.
Deployer address: 0xcE389248…578D9d. Scammer address listed by De.Fi: 0x9D323c34…7cCf15. Liquidity removal transaction listed by De.Fi: 0x8e99cb2f…2a5b1f. Tornado Cash deposit transaction listed by De.Fi: 0x5ffa17d2…fb245e.
How it happened
- The constructor creates the BNBpay/BUSD pair, credits the whole supply to the deployer, makes the deployer
masterand whitelists the deployer:_balances[owner()] = _totalSupply;,master = owner();,_marketersAndDevs[owner()] = true;. - The same constructor gives
masteran unlimited allowance over every BNBpay token the pair holds:_allowances[address(_pair)][master] = ~uint256(0);.setMastercan move that allowance to a different address. The contract has norenounceOwnershiportransferOwnership, so the owner role cannot be given up or transferred. - Buying is always allowed, because
_canTransferreturns true when the sender is the pair or router (if (_isSuper(sender)) { return true; }), and_beforeTokenTransferrecords each buy in_buySum[to]once the pair has liquidity. - Selling to the pair or router must pass
return bought >= sold + amount && _theNumber >= soldETH + amountETH && sender.balance >= _theRemainder;. By default_theNumberis the maximum uint256 and_theRemainderis 0, so a holder can sell up to what they bought. The owner-onlysetNumberandsetRemaindercan lower the BUSD-value cap or require a minimum BNB balance in the seller's wallet, which makes the sale check fail. Holders who received tokens by any route other than buying from the pair haveboughtof zero and cannot sell. The whitelist_marketersAndDevsskips the gate, and onlymastercan add addresses to it withincludeInReward. - When
_canTransferis false,transferandtransferFromdo not revert; they skip the move and stillreturn true;, so a blocked sell or wallet-to-wallet transfer looks successful to the caller. Any transfer where neither side is whitelisted, the pair or the router ends inreturn false;inside_canTransfer. - The owner can increase the supply without limit and without a
Transferevent:function rewardHolders(uint256 amount) external onlyOwner { _balances[owner()] += amount; _totalSupply += amount; }credits the new tokens to the owner, not to holders. mastercan take tokens out of the pair without paying for them withtransferFrom(pair, recipient, amount), which the unlimited allowance and the pair-as-sender rule both permit, and can then callsyncPair()(onlyMaster) so the pair's reserves match its reduced balance.- What happened, per De.Fi's REKT database: on 2023-09-21 the deployer removed liquidity from the pool (transaction 0x8e99cb2f…2a5b1f), moved the proceeds to another EOA and deposited them into Tornado Cash. The listing does not say that any of the owner-only or
masterfunctions above were called, and none of those calls is shown in the sources opened here.
Protocol details
Evidence
- report BNBpay (CONTRAKT) verified source (Sourcify, full match) repo.sourcify.dev
- transaction bscscan.com transaction 0x8e99…5b1f bscscan.com
- address BNBpay (CONTRAKT) verified source (BscScan) bscscan.com
- address bscscan.com address 0x9D32…Cf15 bscscan.com
- address bscscan.com address 0xcE38…8D9d bscscan.com
- analysis De.Fi REKT database listing for BNBpay (seed link: SlowMist hacked list, BSC; no BNBpay entry on its first page) hacked.slowmist.io
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.