MOONSUN Honeypot
What happened
MOONSUN is a BNB Smart Chain token whose transferFrom records the recipient of the first call as newun and from then on reverts any transfer or transferFrom sent to that address with please wait. If that first call was the initial liquidity addition, newun is the liquidity pair, so selling tokens into the pool fails. The owner can change newun at any time with transfernewun.
De.Fi's REKT database lists MOONSUN as an Exit Scam/Honeypot dated 2021-04-10 and says the owner could disable the transfer function, which restricted users in selling their tokens.
How it happened
- The constructor assigns the full supply of 1000000000000000000000000000000000 raw units (10^15 tokens at 18 decimals) to
owner, whichOwnedsets to the deployer. - The first
transferFrommade whilenewunis unset skips the check and stores its recipient:if(from != address(0) && newun == address(0)) newun = to;. The code does not show who made that call or who the recipient was. - From then on every
transferFromrunselse require(to != newun, "please wait");and everytransferrunsrequire(to != newun, "please wait");. Nothing exempts the owner or any other address, so any transfer intonewunreverts, including a router sale that pays tokens to a pair stored there. - Transfers to any other address, and transfers out of
newun, are not restricted by this code. function transfernewun(address _newun) public onlyOwnerlets the owner overwritenewun. Setting it toaddress(0)re-arms the capture for the nexttransferFrom; pointing it at an address nobody uses lifts the block. There is no renounce function in the source.
Protocol details
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.