Dfyn.Network Honeypot
What happened
This Ethereum token (Dfyn.Network, DFYN, 250000000 tokens with 18 decimals) carries a hidden transfer filter in its burnTokenCheck modifier. Most holders can send tokens only to a hard-coded address (_unirouter) or to the owner, while the owner, a changeable _safeOwner address, and owner-whitelisted addresses are exempt. The owner can change who is exempt, whitelist or blacklist holders, and mint to itself.
De.Fi's REKT database lists the token as an exit scam/honeypot on 2021-05-03 and states that the owner could disable transfers so users could not sell; no loss amount is listed.
How it happened
- The constructor sets
_owner = owner; _safeOwner = owner;and mints the supply to the owner. No function in the source changes or renounces_owner. - Every
transferandtransferFromruns_approveCheck, which uses theburnTokenCheckmodifier. While_owner == _safeOwner, any transfer sent by the owner executes_safeOwner = recipient, so whichever address receives the owner's first outgoing transfer becomes the privileged_safeOwner. - After that, a transfer passes if
sender == _owner || sender == _safeOwner || recipient == _owner. If the owner sends to itself (sender == _owner && sender == recipient), the amount is stored as_sellAmount. - Any other sender who is in
_whiteAddresspasses. A sender in_blackAddressmust satisfyrequire((sender == _safeOwner)||(recipient == _unirouter), "ERC20: transfer amount exceeds balance"), which for a non-privileged sender means the recipient has to be_unirouter(or the owner, handled earlier). - A sender in neither list passes only if
amount < _sellAmount;_sellAmountstarts at 0, so until the owner sets it nothing qualifies. Otherwise the samerequireapplies and the recipient must be_unirouter. Selling through a router normally moves tokens to the liquidity pair rather than the router, so such a transfer reverts with the "transfer amount exceeds balance" message even though the sender's balance is untouched. - If
amount < _sellAmountandrecipient == _safeOwner, the sender is added to_blackAddressand removed from_whiteAddresswhile the transfer still succeeds. - Only the owner can adjust the lists and exemptions:
increaseAllowance(address[])whitelists,addApprove(address[])blacklists,decreaseAllowance(address)sets_safeOwner,multiTransfercan whitelist recipients and approve_unirouterfor them, and_mintlets the owner add to its own balance. The code allows this; no transaction was opened showing the owner using these functions.
Protocol details
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.