SafeDream Honeypot
What happened
SafeDream (BNB Chain contract 0xaee4e249…3583c4) is a BEP-20 token whose transfer and transferFrom both refuse to deliver tokens to one stored address, newun. transferFrom fills newun with the recipient of the first call made while it is empty, so a router liquidity deposit would record the trading pair, and from then on a router sell, which delivers the holder's tokens to the pair, reverts with "please wait". Only the owner can overwrite newun, through transfernewun.
De.Fi's REKT database lists the token as an Exit Scam/Honeypot, stating that the contract owner could disable the transfer function, which restricted users in selling their tokens; no sell transaction, pool address or loss figure was opened to confirm what happened on-chain, and the verified source ends with a comment reading that the tokens were generated for testing purposes.
How it happened
newunis declared asaddress public newun;and is not assigned in the constructor, so it starts as the zero address. The constructor mints the whole supply, 10^33 base units (10^15 tokens at 18 decimals), to the deployer withbalances[owner] = _totalSupply;.- In
transferFrom, the first call with a non-zerofromwhilenewunis empty runsif(from != address(0) && newun == address(0)) newun = to;. That branch stores the recipient and skips therequire. If this call is the router moving tokens into a new pool,newunbecomes the pool address. - Every later call hits
else require(to != newun, "please wait");intransferFrom, andtransferhasrequire(to != newun, "please wait");. A sell through a router moves the holder's tokens to the pool withtransferFrom, soto == newunand the call reverts beforebalances[from] = balances[from].sub(tokens);runs; the holder's balance is unchanged and the tokens simply cannot be sold into that pool. - A purchase delivers tokens from the pool to the buyer, so
tois the buyer, notnewun, and the transfer succeeds. Buying works while selling to the pool does not. - The check has no exemption for any sender, owner included. The
onlyOwnerfunctiontransfernewun(address _newun)can setnewunto any address: pointing it at an unused address lifts the block, while setting it to the zero address re-arms the capture so the nexttransferFromrecipient becomes the blocked address. The contract has norenounceOwnership; ownership can only be handed to another address throughtransferOwnershipandacceptOwnership. The source does not show whether or when these functions were called.
Protocol details
Evidence
- report @Token_Sniffer incident report twitter.com
- address SafeDream token verified source on BscScan bscscan.com
- analysis Sourcify repository entry for the contract repo.sourcify.dev
- analysis De.Fi REKT database listing for SafeDream (Exit Scam/Honeypot, 2021-09-09) de.fi
- analysis Scam explained: BSC stealthy LP block (cryptot3ddybear blog) cryptot3ddybear.gitlab.io
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.