MIAU Honeypot
What happened
MIAU (MIAU) is a BEP-20 token on BNB Chain whose transferFrom, the function a PancakeSwap router uses to take tokens from a seller, passes through a contextHandler modifier that only the owner is exempt from. For everyone else, a transfer reverts if the seller's balance is at or above _maxTrxLimit, and reverts in every case once the owner turns on swapAndLiquifyEnabled. Both switches are owner-only with no bounds, so the owner can block every holder's sale at any time while plain transfer calls, which buyers receive from the pair, keep working.
The contract also contains a renounceOwnership that does not remove the owner and a burnTokens that credits new tokens to the owner. De.Fi's REKT database lists the token as an exit scam/honeypot.
How it happened
- The constructor credits the full supply of 100,000,000,000,000
MIAUto the deployer and sets_maxTrxLimit = 50000 * 10**15, which with 8 decimals is 500,000,000,000MIAU. - Buys work because the pair sends tokens with
transfer, which has no restriction. - A sale goes through
transferFrom, guarded bycontextHandler: for anyfrom != owner, it requiresfrom == ownerwhenswapAndLiquifyEnabledis true, and otherwise requiresbalances[from] < _maxTrxLimit. - The owner can call
setSwapAndLiquifyEnabled(true)orsetMaxTrxLimit(0), either of which makes every non-ownertransferFromrevert withOrder ContextHandler, while the owner's own sales are exempt. renounceOwnership(address)only writes a separatecurrentOwnervariable, leaving theownerchecked byonlyOwnerunchanged, andburnTokensadds tokens to the owner's balance instead of removing them.
Protocol details
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.