MEGAMOON Honeypot
What happened
De.Fi's REKT database lists MEGAMOON on BNB Smart Chain as an Exit Scam/Honeypot, saying the contract owner could disable the transfer function, which restricted users in selling their tokens. In the verified source, transferFrom stores the recipient of its first call in a variable named newun. After that, every transfer or transferFrom whose recipient is newun reverts with the message "please wait", and the owner can overwrite newun at any time through transfernewun.
The code does not show which address newun captured.
How it happened
- The constructor mints the whole supply to the deployer (
balances[owner] = _totalSupply;).newunstarts as the zero address. - The first
transferFromwherefromis not the zero address runsif(from != address(0) && newun == address(0)) newun = to;, so the recipient of that call is stored asnewunand the transfer itself goes through. A write-up of the same code pattern on other tokens describes this first call as the liquidity add, which makesnewunthe pool address; the MEGAMOON code alone does not show who the recipient was. - Every later
transferFromtakes the other branch,else require(to != newun, "please wait");, andtransferstarts withrequire(to != newun, "please wait");. A transfer intonewunreverts, so nothing is debited from the sender's balance and the tokens cannot reach that address. Neither function exempts the owner. - The owner controls the block through
function transfernewun(address _newun) public onlyOwner { newun = _newun; }. Pointingnewunat an address that is never used lifts the block; pointing it at a chosen address blocks that address; setting it to the zero address re-arms the capture, so the recipient of the nexttransferFrombecomesnewun. - What the code allows is separate from what happened. De.Fi's REKT database lists the token as an Exit Scam/Honeypot; the proof link it gives could not be opened here, so no transaction showing the block in use or the owner changing
newunwas checked.
Protocol details
Evidence
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.