Cezar Hard Fork Rug Pull
What happened
Cezar Hard Fork (Cezar) is a BEP-20 token on PancakeSwap whose code lets the owner mint without limit and lets the owner switch off selling for everyone except whitelisted addresses. The code analysis here covers the contract at 0x71C349EE…a135e9 on BNB Chain. Its owner-only rewardHolders function adds any amount to the owner's balance and to _totalSupply, and sells by ordinary holders only pass _canTransfer if the holder bought at least as many tokens through the pair or router as they are selling and two owner-set values (_theNumber, _theRemainder) allow it.
De.Fi's REKT database lists two copycat Cesar tokens with related deployers, says both were rugged, that rewardHolders() was used to mint an unlimited amount to the contract owner and drain the pools, and that the funds accumulated in one EOA address reached 1,212 BNB (398,748 USD at the time) and were then sent through Tornado Cash. PeckShield's alert of 2022-11-16 says $Cezar had dropped 99% and that about 1k BNB (~$276,650) had been transferred to Tornado Cash from the scammers; the alert cites token address 0x33951cd5…8cd315, which is not the contract analysed here and is presumably the other copycat. Addresses from the De.Fi listing: deployers 0xdb783c18…a83b83 and 0x4925b8e1…da8726, accumulation address 0x2bb4edcf…f7c119, example drain transaction 0x48181309…e7381f.
The code described below shows what the owner can do, not which calls were made.
How it happened
- The constructor mints the entire 100,000,000 supply to the deployer, makes the deployer the whitelisted
master, and givesmasteran unlimited allowance over the pair's token balance:_balances[owner()] = _totalSupply;,_marketersAndDevs[owner()] = true;,_allowances[address(_pair)][master] = ~uint256(0);. rewardHoldersis the only function that raises supply and has no cap:function rewardHolders(uint256 amount) external onlyOwner { _balances[owner()] += amount; _totalSupply += amount; }. The owner can therefore create any quantity of new tokens in its own wallet.- The owner is whitelisted, so its sales to the pair pass
_canTransferunconditionally (if (_marketersAndDevs[sender] || _marketersAndDevs[recipient]) { return true; }). Newly minted tokens can be sold into the pool against the BNB that holders paid in. - Ordinary holders face the sell gate
return bought >= sold + amount && _theNumber >= soldETH + amountETH && sender.balance >= _theRemainder;._theNumberstarts at the maximum uint256 and_theRemainderat 0, but the owner can change both withsetNumberandsetRemainder, for example to a_theRemainderabove any holder's BNB balance, which makes every non-whitelisted sale fail. - A failed check does not revert:
transferandtransferFromwrap the move inif (_canTransfer(...))and returntrueeither way, so the holder's call looks successful while no tokens move. Wallet-to-wallet transfers between non-whitelisted addresses fail the same way, because_canTransferends inreturn false;. mastercan also pull tokens straight out of the pair via its standing allowance and callsyncPair()(function syncPair() external onlyMaster { _pair.sync(); }), and the owner can reassignmasterwithsetMaster. De.Fi's REKT database lists the owner-side tokens as used to drain the pools, with the BNB moving through one accumulation address to Tornado Cash.
Protocol details
Evidence
- report @PeckShieldAlert incident report twitter.com
- report PeckShieldAlert tweet 1592708485724372992 (via fxtwitter) x.com
- transaction bscscan.com transaction 0x4818…381f bscscan.com
- address Cezar Hard Fork (Cezar) verified contract source, BscScan bscscan.com
- address bscscan.com address 0x2bb4…c119 bscscan.com
- address bscscan.com address 0x4925…8726 bscscan.com
- address bscscan.com address 0xdb78…3b83 bscscan.com
- analysis Sourcify match, chain 56, 0x71C349EEcc025F1B618f7674aD5Efcb9Dda135e9 repo.sourcify.dev
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.