SafeGate Honeypot
What happened
SafeGate (SAFEGATE) is a BNB Chain token deployed on 26 March 2021 at 0xf118267a…b37d56 by 0x09aAF4dc…05D9DE, which still holds ownership. Every transfer passes through calculateFeesBeforeSend, which reverts with "Error: Can not sell this token" whenever the recipient is flagged in the PanCakeSwapReciever mapping, and only the owner can set that flag with setPanCakeSwapReciever. Once the PancakeSwap pair is flagged, every sale, which sends tokens into the pair, fails, while buys, which send tokens out of the pair, still work.
The contract advertises a fee system and a whitelist lock (seTxFee, renounceWhitelist), but the fee is never charged and the lock does not cover the sell flag. De.Fi's REKT database lists SafeGate as an exit scam/honeypot.
How it happened
- The constructor hard-codes
SafeERC20("SafeGate", "SAFEGATE")and credits 95,000,000 SAFEGATE to the deployer through_transferTO, which also makes the deployerfeeDistributor. The deployer becomesowner(). _transferdebits the sender, then callscalculateFeesBeforeSend(sender, recipient, amount). That function runsif(PanCakeSwapReciever[recipient]){ revert("Error: Can not sell this token"); }and otherwise returns(amount, 0), so the whole transfer reverts for a flagged recipient.setPanCakeSwapReciever(address _recipient, bool _feeless)isonlyOwnerand writes that flag with no other check. Flagging the PancakeSwap pair blocks every token transfer into it, fromtransferor from the router'stransferFrom, so no holder can sell. Buys are transfers out of the pair and are not affected.renounceWhitelist()only setscanWhitelist = false, whichsetFeelessSenderandsetFeelessRecievercheck;setPanCakeSwapRecieverdoes not check it, so the sell flag stays under owner control.seTxFeestorestxFee, but the fee calculation never reads it.- The owner can clear the flag again at any time.
renounceOwnershipexists; calling it would freeze the flags at their current values.
Protocol details
Evidence
- report Token Sniffer post 1386163504470659074 (seed link) twitter.com
- transaction SafeGate contract creation transaction bscscan.com
- address SafeGate (SAFEGATE) verified contract code on BscScan bscscan.com
- analysis Sourcify exact match for 0xf118267a454afb02523e67e3f845c59ea5b37d56 on BNB Chain repo.sourcify.dev
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.