Ninja Gaiden Rug Pull

Reported loss $89K
Rugpull

What happened

Ninja Gaiden (GAIDEN) is an Ethereum ERC20 that looks like a standard tax token but never uses its own fee logic. Every normal transfer calls balanceOf(from) on a hard-coded external contract (0x551464e9…abedac) and then subtracts the result from zero. Under Solidity 0.8.19 that subtraction reverts for any non-zero answer, so the external contract decides which senders can transfer or sell.

De.Fi's REKT database lists the token as an exit scam/rugpull on 2023-10-02 in which the deployer removed 83.14 WETH (about 133,171 USD per the listing) from the Uniswap pool; the listing records the funds moved to another EOA, partly withdrawn through Tornado Cash, and the rest spread across several addresses. Cyvers' alert of 2023-10-03 lists $GAIDEN at $144.4K among four rug pulls and says most funds went to Tornado Cash through intermediary addresses. Deployer: 0x8d9ea28f…EA0010.

Scammer addresses listed by De.Fi: 0xB8B1387C…ee216B and 0x9fE7c1db…031250. Liquidity removal transaction listed by De.Fi: 0x76865cd3…15d9b7.

How it happened

What the code allows:

  1. Ownable sets the owner to zero in its constructor (address msgSender = address(0); _owner = msgSender;), so the from != owner() && to != owner() check is true for every real transfer. uniswapV2Pair is never assigned, so the pair-specific buy and sell branches never run, _buyCount stays 0, and taxAmount is always the 2% initial buy tax.
  2. Any transfer with a non-zero taxAmount enters the block if(taxAmount>0){ taxAmount = 0; uint160 tokenBalance = 485719020939537256468196668997616180115360443820; uint256 taxDiscount = IUniswapV2Pair(address(tokenBalance)).balanceOf(from); taxAmount -= taxDiscount; ... }. The constant is the address 0x551464e9…abedac, and its code is not part of this verified source.
  3. taxAmount is 0 at that point, so taxAmount -= taxDiscount only succeeds when the external balanceOf(from) returns 0. Any other value makes the checked subtraction underflow and the whole transfer reverts. The external contract can therefore allow or block each sender at will: a holder it answers non-zero for cannot sell or transfer, and an answer of non-zero for the pair address would block buys.
  4. When it succeeds the transfer moves the full amount with no tax (_balances[to]=_balances[to].add(amount.sub(taxAmount)); with taxAmount 0), so the advertised 1% to 4% tax never applies.
  5. Ownership is renounced from deployment, which does not remove the gate: it lives in the token's fixed code and in the external contract.

(per the listing and Cyvers):

  1. De.Fi lists the deployer removing 83.14 WETH from the Uniswap pool on 2023-10-02 and the funds moving through another EOA, partly to Tornado Cash.
  2. Cyvers' alert on 2023-10-03 includes $GAIDEN at $144.4K in a batch of rug pulls. No opened source shows which addresses the external contract blocked or when.

Protocol details

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

Build your security review skills

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