Unidark Rug Pull

Reported loss $30K
Ethereum
Rugpull

What happened

Unidark (DARK) is a small ERC20 token whose contract had a built-in airdrop and an ETH token sale, both configured by the owner. ETH paid into the sale stays in the token contract, and the owner-only function clearETH() sends the contract's entire ETH balance to the caller with no limit, delay or vesting. On 2020-10-08 the deployer called clearETH() and withdrew 85.1 ETH from the token contract in transaction 0xfa04a396…bda75a.

De.Fi's REKT database lists the project as an exit scam / rug pull, lists the loss as 29,887 USD, and says the team spread fabricated Vitalik Buterin statements on Telegram to build trust, that buyers contacted Binance's technical support, and that the deployer's address was frozen on the exchange.

How it happened

  1. The constructor mints the whole supply of 2**10 * 10**uint(decimals) (1,024 DARK) to the deployer, who is also owner. startAirdrop(...) and startSale(...) are onlyOwner, so the owner chooses the block window, price and cap of the airdrop and the sale.
  2. In tokenSale, a buyer sends ETH (uint256 _eth = msg.value;) and receives tokens debited from the contract's own balance (balances[address(this)] = balances[address(this)].sub(_tkns);). The ETH remains in the token contract, and the empty payable function() external payable { } in Unidark_ERC20 also lets it receive plain ETH transfers.
  3. The contract exposes one function that moves that ETH out: function clearETH() public onlyOwner() { address payable _owner = msg.sender; _owner.transfer(address(this).balance); }. It pays the whole balance to the owner, and nothing in the code limits when or how much.
  4. On 2020-10-08 the deployer called clearETH() from 0x2522B89D…79D0D0; Etherscan shows 85.10 ETH moved to that address and the transaction succeeded.
  5. Per De.Fi's REKT database listing, buyers then contacted Binance's technical support and the deployer's address was frozen on the exchange.

Protocol details

Classification Other
Protocol Type Exit Scam/Rugpull
Affected asset / contract DARK

Build your security review skills

Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.