Rao Token Honeypot

Reported loss Not disclosed
Ethereum
Honeypot

What happened

Rao Token (RAO) is an Ethereum token deployed on 12 April 2021 at 0x9d72bcfb…842cd7. Every transfer and transferFrom calls ensure, which only lets a transfer through if it comes from or goes to the owner, comes from an owner-chosen tradeAddress, or comes from an owner-approved canSale address. Every other transfer must pass condition, which always returns false because its three limits (_saleNum, _minSale, _maxSale) start at zero and no function can set them.

An ordinary buyer can therefore receive tokens but cannot sell or move them, except to the owner. The owner can also overwrite any address's balance through an owner-only function misnamed approveAndCall. De.Fi's REKT database lists Rao Token as an exit scam/honeypot, stating that the contract owner could disable the transfer function and so stop users from selling.

How it happened

  1. The constructor records the deployer as the private owner and credits it with the whole supply. The contract has no function that changes owner.
  2. transfer forwards to transferFrom, which runs require(ensure(_from, _to, _value)) before moving any balance.
  3. ensure returns true only if _from == owner || _to == owner || _from == tradeAddress || canSale[_from]; otherwise it requires condition(_from, _value).
  4. condition returns false when _saleNum, _minSale and _maxSale are all zero. None of the three has a setter, so a holder outside the allow-list cannot send tokens to the trading pair or anyone else except the owner.
  5. The owner picks tradeAddress with transferownership(addr), a name that suggests an ownership change but only sets the address whose outgoing transfers are always allowed, such as a trading pair for buys.
  6. The owner can call approveAndCall(spender, addedValue) to overwrite balanceOf[spender] with addedValue whole tokens, without changing totalSupply, and to add spender to canSale.

Protocol details

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

Build your security review skills

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