DEFIX Honeypot
What happened
DEFIX (DFX) is a BNB Smart Chain token whose transferFrom records the first recipient it sees in a variable called newun and from then on rejects every transfer to that address with "please wait". If that first recipient is the liquidity pair, which is what happens when liquidity is added through a router that pulls tokens with transferFrom, nobody can sell into the pair afterward. The owner alone can change newun.
De.Fi's REKT database lists DFX as an exit scam/honeypot dated 2021-05-05 and says the owner could restrict selling.
How it happened
- The constructor sets
symbol = "DFX",name = "DEFIX",decimals = 9and_totalSupply = 100000000000000000(1e8 tokens), all credited to the deployer, who is alsoowner. - The
newunaddress starts empty. The firsttransferFromcall runsif(from != address(0) && newun == address(0)) newun = to;, so the recipient of that call is stored asnewun, whoever it is. A router adding liquidity pulls tokens into the pair withtransferFrom, so that call would setnewunto the pair. - After that,
transferFromtakes theelsebranch:else require(to != newun, "please wait");, andtransferhasrequire(to != newun, "please wait");. Any transfer whose recipient isnewunreverts. A sell is a transfer of tokens to the pair, so withnewunequal to the pair every sell reverts, for holders and for the owner alike (the owner has no exemption). - Buys are unaffected, because tokens move out of the pair rather than into it, so holders can acquire the token but not sell it back.
transfernewun(address _newun)isonlyOwner. Settingnewunto an address nobody uses lifts the block; setting it toaddress(0)re-arms the capture so the nexttransferFromrecipient becomes the blocked address. The contract also hasclearCNDAO(), which sends the contract's BNB balance to the owner.- The code shows what is possible. No transaction was opened to show who the first
transferFromrecipient was or whether the owner changednewun. The same pattern was described for BSC tokens in April 2021 in a third-party write-up on a "stealthy LP block".
Protocol details
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.