RapidSwap Honeypot

Reported loss Not disclosed
BNB Chain
Honeypot

What happened

RapidSwap is a BEP-20 token on BNB Smart Chain deployed from 0x2988c04f…EDdCF4. De.Fi's REKT database lists it as an exit scam/honeypot, stating that the contract owner could disable the transfer function and so restrict users from selling. In the verified source, a hidden address variable newun is filled by the first transferFrom call and from then on no transfer or transferFrom can send tokens to it.

A blog analysis of this code pattern explains that when newun ends up as the liquidity pool, selling back to BNB is blocked.

How it happened

  1. The constructor mints the whole supply to the deployer: _totalSupply = 100000000000000000000000000; and balances[owner] = _totalSupply;. A public variable address public newun; starts at the zero address.
  2. In transferFrom, the first call made while newun is unset runs if(from != address(0) && newun == address(0)) newun = to;. That call is not checked against anything, and it records its recipient to in newun. The blog post describes this as the first add-liquidity transaction, so that newun becomes the pool; the supplied code does not itself say which address was recorded.
  3. After that, every transferFrom takes the else branch: else require(to != newun, "please wait");. The plain transfer function has the same check on every call: require(to != newun, "please wait");. Neither function exempts the owner or any other sender.
  4. A swap of tokens for BNB sends the tokens to the pool. If the pool is newun, that transfer reverts with "please wait", so holders cannot sell. Transfers to any other address, and transfers out of newun, are not blocked by these checks.
  5. The owner can change the target with transfernewun(address _newun) public onlyOwner. Setting it to the zero address makes the next transferFrom capture its recipient again, so the block comes back; pointing it at an address that never receives tokens lifts the block. The owner can also run clearCNDAO() (onlyOwner), which sends the contract's own BNB balance to the caller.

The code allows this behaviour. The sources opened show no transaction proving which address newun held or when the owner changed it, so what actually happened to holders rests on De.Fi's listing.

Protocol details

Classification Token
Protocol Type Exit Scam/Honeypot
Affected asset / contract RapidSwap

Build your security review skills

Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.