Dipex Rug Pull
What happened
DIPEX (DPX) is an Ethereum token deployed on 31 December 2020 at 0xbce67604…c73e14 by 0xbed03cf8…1acb0b. Its transfer code only lets tokens move from the owner, from one owner-chosen tradeAddress, or from wallets the owner has whitelisted; every other holder's transfer and sale fails, because the sale-limit values it checks are all zero and the contract has no function to set them. The owner-only approveAndCall does not approve anything: it overwrites a chosen wallet's balance with any amount, without changing totalSupply, and whitelists that wallet to sell.
De.Fi's REKT database says the deployer added the initial liquidity (0x0277b502…b74edc) and locked it (0x6eead116…365254). On 9 January 2021 the deployer called approveAndCall for 0x658c862c…75e414 (0x5b6f330b…2462ff), and twelve minutes later that wallet sold DPX into the Uniswap pool for about 23.30 ETH (0x954e5fbc…e0b4d4). Locking the LP tokens did not protect buyers, because the pool's ETH could be drained by selling tokens created this way.
How it happened
- The constructor mints the whole supply to the deployer and stores it as the private
owner; the contract has no function to change or renounceowner. transferFrom(whichtransferalso uses) callsensure, which passes only if_from == owner || _to == owner || _from == tradeAddress || canSale[_from]; otherwise it requirescondition(_from, _value).conditionstarts withif(_saleNum == 0 && _minSale == 0 && _maxSale == 0) return false;. The three values are private, default to zero and are never set anywhere, so every ordinary holder's transfer or sale reverts. Holders can only send tokens to the owner.transferownership(address addr)does not transfer ownership; it setstradeAddress, the one extra address (such as the pair) allowed to send tokens freely, which is what lets buys go through.approveAndCall(spender, addedValue)is owner-only and runsbalanceOf[spender] = addedValue*(10**uint256(decimals))andcanSale[spender]=true, so the owner can give any wallet an arbitrary balance thattotalSupplydoes not show, and let that wallet sell.- On 9 January 2021 at 22:56 UTC the deployer called
approveAndCallfor 0x658c862c…75e414; at 23:08 UTC that wallet swapped DPX for about 23.30 ETH through the Uniswap router, taking ETH out of the pool that holders could not sell into.
Protocol details
Evidence
- report @CaptainJackAPE incident report twitter.com
- transaction DIPEX contract creation transaction etherscan.io
- transaction Etherscan: DPX approveAndCall transaction 0x5b6f330b...ff etherscan.io
- transaction Etherscan: DPX to ETH swap 0x954e5fbc...d4 etherscan.io
- transaction etherscan.io transaction 0x0277…4edc etherscan.io
- transaction etherscan.io transaction 0x6eea…5254 etherscan.io
- address DIPEX (DPX) verified contract code on Etherscan etherscan.io
- analysis Web Archive web.archive.org
- analysis Sourcify match for 0xbce67604c08c4839980c32485657f63211c73e14 on Ethereum repo.sourcify.dev
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.