Ninja Gaiden Rug Pull
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:
Ownablesets the owner to zero in its constructor (address msgSender = address(0); _owner = msgSender;), so thefrom != owner() && to != owner()check is true for every real transfer.uniswapV2Pairis never assigned, so the pair-specific buy and sell branches never run,_buyCountstays 0, andtaxAmountis always the 2% initial buy tax.- Any transfer with a non-zero
taxAmountenters the blockif(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. taxAmountis 0 at that point, sotaxAmount -= taxDiscountonly succeeds when the externalbalanceOf(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.- When it succeeds the transfer moves the full
amountwith no tax (_balances[to]=_balances[to].add(amount.sub(taxAmount));withtaxAmount0), so the advertised 1% to 4% tax never applies. - 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):
- 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.
- 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
Evidence
- report Cyvers Alerts post listing BUGMAN, GAIDEN, RAI and TAIZO rug pulls (via fxtwitter) twitter.com
- transaction etherscan.io transaction 0x7686…d9b7 etherscan.io
- address Etherscan verified source for 0xF66853febb2562D9F0d1f2d76CEf4aeCb0af282E etherscan.io
- address etherscan.io address 0x8d9e…0010 etherscan.io
- address etherscan.io address 0x9fE7…1250 etherscan.io
- address etherscan.io address 0xB8B1…216B etherscan.io
- analysis Sourcify exact match for 0xF66853febb2562D9F0d1f2d76CEf4aeCb0af282E repo.sourcify.dev
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.