PurpleGoat Honeypot

Reported loss Not disclosed
BNB Chain
Honeypot

What happened

PurpleGoat (PURPL) is a BNB Smart Chain token whose code can refuse every transfer to one chosen address. The transferFrom function stores the recipient of the first call that runs while newun is unset, and from then on reverts any transfer to that address with "please wait". On a DEX, selling means sending tokens to the liquidity pair, so if newun holds the pair's address, holders can still receive tokens on a buy but cannot sell them.

The owner can also set newun to any address through transfernewun. De.Fi's REKT database lists PURPL as an exit scam / honeypot where the contract owner could disable the transfer function, which restricted users in selling their tokens.

How it happened

  1. The contract declares address public newun; and the owner-only setter function transfernewun(address _newun) public onlyOwner { newun = _newun; }.
  2. In transferFrom, the first call made while newun is unset runs if(from != address(0) && newun == address(0)) newun = to;. That call succeeds and records its recipient as newun. A write-up of the same code pattern says this recipient is the liquidity pair when the first liquidity is added.
  3. Every later transferFrom takes the else require(to != newun, "please wait"); branch, and transfer also starts with require(to != newun, "please wait");. A transfer whose recipient is newun reverts, so no balances change.
  4. A DEX sell pulls the holder's tokens to the pair with transferFrom, so if newun is the pair the sell reverts. Buys send tokens from the pair to the buyer, whose address differs from newun, so they are not affected by this check.
  5. The owner can call transfernewun to point newun at another address. Setting it to the zero address re-arms the capture on the next transferFrom; setting it to an unused address lifts the block. The code has no renounceOwnership, only a two-step transferOwnership / acceptOwnership.

Protocol details

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

Build your security review skills

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