SunDoge Inu Honeypot
What happened
SunDoge Inu (SDOGE) is an Ethereum token contract deployed on 2021-06-02 by 0x52B5D576…603644 in transaction 0xe0a2cc40…f14820. De.Fi's REKT database lists it as an Exit Scam/Honeypot, noting that the contract owner could disable the transfer function, which restricted users in selling their tokens. In the verified source, every transfer and transferFrom runs a burnTokenCheck modifier: in the default state a holder who is not whitelisted can only send tokens to the hard-coded router address _unirouter (or to _owner), so a sale into a liquidity pair reverts, while owner-only functions can whitelist or blacklist addresses and re-point _safeOwner.
The code shows what the owner can do; no transaction showing these functions being called was opened for this entry.
How it happened
- The constructor stores
_ownerand_safeOwneras the same address and mintsinitialSupply*(10**18)to_owner._mintstayspublicand owner-only, so the owner can add to its own balance later. - Both
transferandtransferFromcall_approveCheck, which runs theburnTokenCheckmodifier before moving balances. - The modifier first checks
if (_owner == _safeOwner && sender == _owner){_safeOwner = recipient;_;}: while the two are equal, the owner's first outgoing transfer re-points_safeOwnerto its recipient (a pair, if that transfer funds one). After that, any transfer wheresender == _owner || sender == _safeOwner || recipient == _ownerpasses unconditionally, and an owner self-transfer sets_sellAmount = amount. - A whitelisted sender (
_whiteAddress[sender] == true) passes. A blacklisted sender hitsrequire((sender == _safeOwner)||(recipient == _unirouter), "ERC20: transfer amount exceeds balance"), so it can only send to_unirouter(_safeOwnerwas already handled above). - Any other sender with
_sellAmountat its default of 0 failsamount < _sellAmountand reaches the samerequire. A router sale callstransferFrom(holder, pair, amount), where the recipient is the pair, not_unirouter, so it reverts. Moving tokens to_unirouteror_ownerstill works. - If
_sellAmountis set above 0, a non-listed sender withamount < _sellAmountpasses, and whenrecipient == _safeOwnerthat sender is moved to_blackAddress(_blackAddress[sender] = true), after which only sends to_unirouterpass. - Owner-only functions manage the lists:
increaseAllowance(address[])whitelists,addApprove(address[])blacklists,decreaseAllowance(address safeOwner)replaces_safeOwner, andmultiTransferwhitelists the firstapprovecountreceivers and approves_unirouterfor the maximum allowance. There is no function that changes_owner. - What the code allows is separate from what happened: De.Fi's REKT database lists the token as a honeypot, but no transaction showing the owner calling these functions or a failed sale was opened.
Protocol details
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.