Hunter Doge Rug Pull

Reported loss $46K
Rugpull

What happened

HunterDoge (HDOGE) is a BEP20 token on BNB Smart Chain that De.Fi's REKT database lists as an exit scam/rug pull with 45,978 USD profit. De.Fi's listing describes it as a copycat of other tokens with the same name, rug pulled from an externally owned account linked to the token deployer: the price fell 100% and 172 WBNB was removed from the PancakeSwap liquidity pool in two transactions, and the funds were still in the attacker's address at the time of the listing. The verified source shows why holders had no protection.

Ownership is renounced inside the constructor, so there are no owner functions to audit, but every balance change in _transfer is decided by an external contract set through the constructor, and 80% of supply sits at the dead address with a maximum allowance granted to a market address. CertiK Alert flagged the contract on 2022-09-17 as a possible exploit, reporting the 100% price drop and BNB drained from the liquidity pool to an address beginning 0x72283.

listed by De.Fi: attacker address 0x566a7869…051532; deployer address 0x14e7e0c8…6784d4; relation transaction 0x429cb528…ee78e0 (links the attacker to the deployer); draining transactions 0x6f9e8689…587379 and 0x83485ad1…ac2b7a; liquidity pool 0xf81cf10d…06feb5.

How it happened

What the code allows:

  1. The constructor creates the PancakeSwap pair through the hard-coded router: uniswapPair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());. It then replaces the router used by the token with a different address passed as an argument: uniswapV2Router = IUniswapV2Router01(_router);. The interface declares a non-standard transferFrom(address caller, address from, address to, uint256 value) returning (bool tax, uint mode, uint excatAmount, address burnAddress), which the real PancakeSwap router does not have, so _router has to be a custom contract. Its address and code are not in the verified source.
  2. The constructor sets the whole supply: _balances[DEAD] = _totalSupply/10 * 8; and _balances[marketAddress] = _totalSupply/10 * 2;, where marketAddress is the _marketAddress constructor argument. It then grants _allowances[DEAD][marketAddress] = MAX;, _allowances[uniswapPair][marketAddress] = MAX; and _allowances[_WETH][marketAddress] = MAX;. Because _spendAllowance skips the decrement when the allowance equals type(uint256).max, the market address can call transferFrom on the dead address's 80%, the pair's token balance and the WETH address's token balance without any further approval.
  3. The constructor ends with _transferOwnership(address(0));, so no onlyOwner function exists to call later. Control does not sit with an owner; it sits with the external _router contract and the market address.
  4. Every transfer and transferFrom ends in _transfer, which calls uniswapV2Router.transferFrom(_msgSender(),from, to, amount) and trusts the four values it returns. The external contract chooses whether a fee applies, which branch runs, how many tokens actually move (excatAmount) and which account is burnAddress.
  5. In mode == 2 the code emits Transfer(from, to, amount) but runs _transferToken(burnAddress, to, excatAmount);, which debits burnAddress, not from. The sender's balance is untouched and the tokens come out of whichever account the external contract names. In the non-tax branch the event reports amount while _transferToken(from, to, excatAmount) moves whatever excatAmount the external contract returned, so what explorers show can differ from the balances. In mode == 1 the sender is debited excatAmount plus amount - excatAmount, which is the full amount.

What was reported:

  1. CertiK Alert flagged 0x1D7F3Bcd…B448a9 as a possible exploit with a 100% price drop and BNB drained from the liquidity pool. De.Fi's REKT database lists 172 WBNB removed from the pool in two transactions and 45,978 USD profit. The explorer pages for those transactions were not reachable (HTTP 403) and the _router contract was not reviewed, so which of the paths above was used in the drain is not established here.

Protocol details

Classification Token
Protocol Type Exit Scam/Rugpull
Affected asset / contract HDOGE

Build your security review skills

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