MirrorFinance Honeypot
What happened
MirrorFinance (MIRROR) is a BNB Smart Chain token whose _transfer calls calculateFeesBeforeSend, which reverts with "Error: Can not sell this token" whenever the recipient is flagged in the PanCakeSwapReciever mapping. Only the owner can flag an address, through setPanCakeSwapReciever, so flagging the liquidity pair makes every transfer into the pair revert, including holder sales. De.Fi's REKT database lists the token as an exit scam/honeypot, stating that the contract owner could disable the transfer function, which restricted users in selling their tokens.
How it happened
- The constructor mints 1,250,000,000 tokens (
_transferTO(msg.sender, 1250000000e18)) to the deployer, who is the initial_owner. setPanCakeSwapReciever(address _recipient, bool _feeless)isonlyOwnerand writesPanCakeSwapReciever[_recipient] = _feeless;. Unlike the whitelist setters, it has nocanWhitelistcondition, sorenounceWhitelist()does not disable it.- Every
transferandtransferFromruns_transfer, which callscalculateFeesBeforeSend(sender, recipient, amount). - That function contains
if(PanCakeSwapReciever[recipient]){ revert("Error: Can not sell this token"); }, so any transfer to a flagged address reverts and the sender's balance is left unchanged. - If the owner flags the liquidity pair, a holder selling through a router, which transfers tokens to the pair, hits the revert. Transfers out of the pair, such as purchases, are not affected by this check.
- The fee code is inert:
calculateFeesBeforeSendreturns(amount, 0), andseTxFeeonly changestxFee, which_transferdoes not read. The owner can unset a flag with the same setter and can also callrenounceOwnership(); the source does not show whether any address was flagged.
Protocol details
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.