Dopex Governance Token Honeypot
What happened
Dopex Governance Token (DOPEX) is an Ethereum token deployed on 11 April 2021 at 0xa2b5c6d8…85ec0f. Every transfer and transferFrom runs through a burnTokenCheck modifier that only lets tokens move freely when the owner, a second owner-set address called _safeOwner, or an owner whitelist is involved. Any other holder's transfer, including a sale into the Uniswap pair, reverts with a fake "transfer amount exceeds balance" error unless it is below an owner-set _sellAmount threshold that starts at zero, and a transfer below that threshold sent to the _safeOwner address puts the sender on a blacklist.
The owner can also mint without limit, and its mint function credits the owner's balance while emitting Transfer events that show tokens going to other addresses. De.Fi's REKT database lists DOPEX as an exit scam/honeypot, stating that holders were restricted from selling.
How it happened
- The constructor sets
_ownerand_safeOwnerto a constructor-supplied address and calls_mint20 times._mintrequiresmsg.sender == _owner, so the owner must be the deployer, and each call adds to_balances[_owner]while emittingTransfer(address(0), account, amount)for five other addresses. - The owner's first outgoing transfer (while
_owner == _safeOwner) sets_safeOwnerto that recipient, and the owner can later change it with the misnameddecreaseAllowance(address safeOwner). burnTokenChecklets a transfer through if the sender is_owneror_safeOwner, the recipient is_owner, or the sender is whitelisted. A blacklisted sender can only send to_unirouter.- For every other sender, the transfer passes only if
amount < _sellAmount; otherwise it hitsrequire((sender == _safeOwner)||(recipient == _unirouter), "ERC20: transfer amount exceeds balance"). A router sale sends tokens to the pair, not the router, so it reverts._sellAmountis 0 until the owner sends tokens to itself, which sets it to that amount. - If a holder's transfer below
_sellAmountgoes to_safeOwner, the modifier sets_blackAddress[sender] = true, so later sales fail. - The owner manages the lists with the misnamed
increaseAllowance(address[])(whitelist) andaddApprove(address[])(blacklist), andmultiTransfersends tokens while whitelisting recipients and approving the Uniswap router for them. The public_mintlets the owner add any amount to its own balance.
Protocol details
Evidence
- report De.Fi REKT database listing for DOPEX (proof link: Token Sniffer X post 1374999601485291522) twitter.com
- transaction Dopex Governance Token contract creation transaction etherscan.io
- address Dopex Governance Token verified contract code on Etherscan etherscan.io
- analysis Sourcify exact match for 0xa2b5c6d877ae7eb964e5e7c79f721d1c0085ec0f on Ethereum repo.sourcify.dev
- analysis Dopex Governance Token (DOPEX) token tracker on Etherscan etherscan.io
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.