MarsHistory Honeypot
What happened
MarsHistory is a BNB Smart Chain token whose transfer and transferFrom functions refuse any transfer to the address stored in a variable called newun. transferFrom fills newun automatically with the recipient of the first call made while it is empty, and the owner can also overwrite it with transfernewun. If the first recipient is the liquidity pool, as the blog post describes for this pattern, every later sale through a router, which calls transferFrom with the pool as recipient, reverts with "please wait".
De.Fi's REKT database lists the token as an exit scam/honeypot where the owner could disable the transfer function, which restricted users from selling.
How it happened
newunstarts as the zero address.transferFromrunsif(from != address(0) && newun == address(0)) newun = to;, so the first call with a non-zerofromstores its recipient asnewunand is not blocked.- A liquidity addition through a router moves tokens into the pool with
transferFrom, so in that flow the pool address is what gets stored. The code does not name the pool; this step follows the cited blog post and was not checked on chain. - From then on
transferFromtakes theelse require(to != newun, "please wait");branch, andtransferrunsrequire(to != newun, "please wait");. No sender is exempt, the owner included. - A holder selling through a router has the router call
transferFrom(holder, pool, amount). Withnewunequal to the pool this reverts beforebalances[from]is debited, so the sale cannot complete. Buying is unaffected by these lines because tokens leave the pool, and the check only tests the recipient. transfernewun(address _newun) public onlyOwnerlets the owner replacenewunwith any address. Pointing it at an unused address lifts the block; setting it to the zero address re-arms capture on the nexttransferFromwhosefromis non-zero. No renounce function exists, onlytransferOwnershipandacceptOwnership.- The code shows what the contract permits. It does not show whether sales actually failed, when
newunwas set or changed, or how much value holders lost.
Protocol details
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.