SafeCow Honeypot
What happened
SafeCow (SAFEcow) is a BNB Smart Chain token whose transfer path reverts any transfer sent to an address the owner has flagged in PanCakeSwapReciever. The owner can flag an address at any time with setPanCakeSwapReciever, which is not covered by the canWhitelist switch that renounceWhitelist turns off. Once a trading-pair address is flagged, a sell to it reverts with "Error: Can not sell this token" and the holder's balance is left untouched.
De.Fi's REKT database lists the token as an Exit Scam/Honeypot. The code shows what the owner can do; the verified source does not show whether or when an address was flagged.
How it happened
- The owner deploys
SafeCowand receives the full supply:_transferTO(msg.sender, 75000000e18). - The owner can call
setPanCakeSwapReciever(address _recipient, bool _feeless), guarded only byonlyOwner. Unlike the feeless whitelist setters, it does not checkcanWhitelist, sorenounceWhitelist()does not switch it off. - Every transfer runs
_transfer, which callscalculateFeesBeforeSend(sender, recipient, amount). That function containsif(PanCakeSwapReciever[recipient]){ revert("Error: Can not sell this token"); }. - If the recipient of a transfer is a flagged address, the whole call reverts, including the earlier
_balances[sender] = _balances[sender].sub(...)line. A holder sending tokens to a flagged pair address therefore cannot sell, while transfers to unflagged addresses go through with no fee, because the function otherwise returns(amount, 0). - The check looks only at the recipient, so it applies to every sender, including the owner, and the owner can undo it for an address by calling
setPanCakeSwapRecieveragain withfalse.
Protocol details
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.