PigMOON Honeypot
What happened
PigMOON is a BEP20 token on BNB Smart Chain whose transfer and transferFrom functions refuse any transfer to a stored address called newun, with the revert message "please wait". newun is filled automatically by the first transferFrom call and the owner can reassign it with transfernewun. If newun ends up holding the liquidity pair's address, holders can still receive tokens from the pair but cannot send them back to it, which blocks selling.
De.Fi's REKT database lists the token as an exit scam/honeypot dated 2021-04-15 and describes the owner as able to disable the transfer function so users could not sell. The contract was deployed on 2021-04-15 with a supply of 1,000,000,000,000,000 tokens (18 decimals) minted to the deployer, 0x2748017F…7f6e1F, who is also the on-chain owner.
How it happened
- The constructor mints the whole supply to the deployer:
balances[owner] = _totalSupply;with_totalSupply = 1000000000000000000000000000000000. transferFrombegins withif(from != address(0) && newun == address(0)) newun = to;. Whilenewunis unset, the firsttransferFromwhose sender is non-zero writes its recipient intonewun. A liquidity add through a router is atransferFrominto the pair, so the pair can end up stored there; the code does not name the pair, and the linked write-up describes this capture of the pool address.- Once
newunis set, every latertransferFromtakes theelse require(to != newun, "please wait");branch, andtransferrunsrequire(to != newun, "please wait");. A router sell moves tokens withtransferFrom(holder, pair, amount), so with the pair stored innewunit reverts, while a buy (the pair callingtransferto the buyer) does not touch the check. - The owner can change the blocked address at any time with
function transfernewun(address _newun) public onlyOwner. Pointing it at an unused address lifts the block for everyone; setting it to the zero address makes the nexttransferFromcapture a new recipient. Ownership has no renounce function, onlytransferOwnershipandacceptOwnership. PigMOON.clearCNDAO()sends the contract's own BNB balance to the owner. This is separate from the token block, and the code does not show that any BNB was ever sent to the contract.
What the code allows is shown above. De.Fi's REKT database lists the token as a honeypot; no transaction opened for this draft shows the owner calling transfernewun or any holder's failed sell.
Protocol details
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.