Iron Mars Honeypot
What happened
Iron Mars (IMARS) on BNB Smart Chain, contract 0xb8323e38…9de103, wraps transfer and transferFrom in middleware that reverts any transfer whose recipient equals the stored prevOwner address. prevOwner is empty at deployment and is filled by the first transferFrom call, with whatever recipient that call has, so if that call supplies liquidity to a trading pair, later sells into the pair revert. The owner-only setTrustedOwner(false) switches the middleware off, and transferOwnership repoints prevOwner instead of changing the owner.
De.Fi's REKT database lists the token as an exit scam/honeypot and says the contract owner could disable the transfer function, which restricted users from selling.
How it happened
- The
Ownableconstructor sets_ownerto the deployer andtrustedOwner = true, which turns the transfer middleware on.prevOwneris empty. transferFromcarriestransferFromMiddleware(sender, recipient, trustedOwner). WhiletrustedOwneris true, the first call with a non-zerofromrunsif(from != address(0) && prevOwner == address(0)) prevOwner = to;and records the recipient. The modifier then continues and the tokens move. If that call is the liquidity add,prevOwneris the pair.- After that,
transferFromtakes the other branch:else require(to != prevOwner, "Order TransferFromMiddleware");, andtransfercarriesrequire(to != prevOwner, "Handling Request");. A sell through a router is atransferFrom(holder, pair, amount). The modifier reverts before_transferruns, so the holder's balance is not debited and the tokens stay in the wallet. - Transfers to any other recipient still work, for example a pair paying out to a buyer.
- The owner controls the block.
setTrustedOwner(bool _trustedOwner) onlyOwnercan settrustedOwnerto false, which skips both checks.transferOwnership(address newOwner)only runsprevOwner = newOwner;, so it repoints the blocked address: the zero address re-arms the capture at the nexttransferFrom, an unused address lifts the block.renounceOwnershipsets_ownerto the zero address but does not touchtrustedOwnerorprevOwner. - Separately, the owner-only
forceLiquiditySync(uint256 _amount)credits_amountto the owner and raises_totalSupply, so the supply is not fixed. - What happened: De.Fi's REKT database lists the token as an exit scam/honeypot dated 2021-06-01. No opened source shows the value of
prevOwner, any failed sell, any use of the owner functions, or any loss figure.
Protocol details
Evidence
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.