Gandalf The Grey Rug Pull

Reported loss $266K
Rugpull

What happened

Gandalf The Grey (GAN) is an ERC-20 token deployed on Ethereum on 21 July 2023 at 0xf419707b…510319 by 0xb221582A…fC7DE8. Its constructor sets owner() to the zero address, so it looks renounced, but it also stores a hidden address passed at deployment, 0xb418fdfb…9367f5. That address can freeze any holder through a function named Approve (capital A), and anyone can call a public addLiquidity to credit it with unlimited GAN without changing the reported supply or emitting a Transfer event.

On 22 July 2023 at 04:24 UTC, the deployer removed its Uniswap V3 position, taking 141.04 ETH and about 2.1 billion GAN in transaction 0x19e96c9c…9aac0b. De.Fi put the loss at about $270,000 (266,238 USD in its database), said the deployer's wallet had been funded through Tornado Cash, and reported that the funds moved on through EOAs, with part distributed via CoinTool, to 0x9c5f9de4…96cbeb.

How it happened

  1. The Ownable constructor calls _setOwner(address(0)), so owner() returns the zero address from deployment. No GAN function uses onlyOwner, so the renounced-looking owner says nothing about who controls the token.
  2. The GAN constructor stores the token_ argument as _info.tokenAddr; Sourcify's constructor arguments show it is 0xb418fdfb…9367f5. The deployer receives the 6,666,000,000 GAN supply.
  3. Approve(address spender, uint256 amount) lets only that hidden address set _dex[spender] = spender. On every transfer, _balanceBeforeTrans subtracts the whole _totalSupply from a flagged sender's balance, which underflows and reverts, so a flagged holder can neither sell nor move tokens.
  4. addLiquidity(address spender, uint256 amount) is public. When spender is the hidden address it runs _balances[spender] += total with total = amount and subtracts nothing from the caller, crediting any amount to the hidden address without updating _totalSupply or emitting Transfer.
  5. On 22 July 2023 the deployer called multicall on the Uniswap V3 Positions NFT contract, withdrawing 141.04 WETH, received as ETH, and about 2.1 billion GAN from the GAN pool to its own address.

Protocol details

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

Build your security review skills

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