German Shepherd Honeypot
What happened
German Shepherd (SHEPHERD) was an ERC-20 token on Ethereum whose transfer and transferFrom both run through a burnTokenCheck modifier. That modifier lets the owner, a designated _safeOwner address and owner-whitelisted wallets move tokens freely, but for every other holder it reverts any transfer unless the recipient is one hard-coded _unirouter address or the amount is below an owner-set _sellAmount. A holder who does send a small amount to _safeOwner is automatically blacklisted.
The revert message reads "ERC20: transfer amount exceeds balance", which hides the real reason. De.Fi's REKT database lists SHEPHERD as an exit scam/honeypot.
How it happened
- The constructor mints the whole supply to the
ownerargument and sets_safeOwner = owner. The first transfer the owner makes then runsif (_owner == _safeOwner && sender == _owner){_safeOwner = recipient;_;}, so the first recipient becomes_safeOwner. The owner can later point it anywhere withdecreaseAllowance(address safeOwner). - Transfers from
_owneror_safeOwner, or to_owner, always pass:if (sender == _owner || sender == _safeOwner || recipient == _owner). Whitelisted senders also pass. If_safeOwneris the trading pair, buys go through. - For any other holder the modifier falls through to
require((sender == _safeOwner)||(recipient == _unirouter), "ERC20: transfer amount exceeds balance");. A sell sends tokens to the pair, not to_unirouter, so it reverts even though the holder has the balance. - The one exception is
if (amount < _sellAmount)._sellAmountstarts at0and can only be changed by the owner sending tokens to itself (if (sender == _owner && sender == recipient){_sellAmount = amount;}). A holder who sends a sub-threshold amount to_safeOwneris then marked_blackAddress[sender] = true, after which every later transfer hits the samerequire. - Owner-only functions with misleading names manage these lists:
increaseAllowance(address[])whitelists,addApprove(address[])blacklists, andmultiTransfersends tokens while whitelisting recipients and approving_unirouterfor them._mintispublicand owner-gated with no cap, and there is no function to change or renounce_owner.
Protocol details
Evidence
- report @Token_Sniffer incident report twitter.com
- transaction Etherscan deployment transaction for SHEPHERD etherscan.io
- address Etherscan verified contract code, German Shepherd (SHEPHERD) 0x28faf2746d74b947b2a09ceff1aed5a46dd6298d etherscan.io
- analysis Sourcify repository, Coin.sol for chain 1 address 0x28faf2746d74b947b2a09ceff1aed5a46dd6298d repo.sourcify.dev
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.