Gandalf The Grey Rug Pull
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
- The
Ownableconstructor calls_setOwner(address(0)), soowner()returns the zero address from deployment. No GAN function usesonlyOwner, so the renounced-looking owner says nothing about who controls the token. - 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. Approve(address spender, uint256 amount)lets only that hidden address set_dex[spender] = spender. On every transfer,_balanceBeforeTranssubtracts the whole_totalSupplyfrom a flagged sender's balance, which underflows and reverts, so a flagged holder can neither sell nor move tokens.addLiquidity(address spender, uint256 amount)is public. Whenspenderis the hidden address it runs_balances[spender] += totalwithtotal = amountand subtracts nothing from the caller, crediting any amount to the hidden address without updating_totalSupplyor emittingTransfer.- On 22 July 2023 the deployer called
multicallon 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
Evidence
- report @DeDotFiSecurity incident report twitter.com
- report De.Fi Antivirus Web3: ~$270,000 $GAN Rug Pull twitter.com
- transaction GAN liquidity removal transaction etherscan.io
- transaction GAN contract creation transaction etherscan.io
- transaction etherscan.io transaction 0x4d5e…4671 etherscan.io
- transaction etherscan.io transaction 0xc2f7…656d etherscan.io
- address Gandalf (Gandalf The Grey, GAN) verified source code etherscan.io
- address etherscan.io address 0x9c5f…cbeb etherscan.io
- address etherscan.io address 0xb221…7de8 etherscan.io
- analysis Sourcify match for 0xf419707b7c8cc13fa2803e8aa57f248b20510319 on Ethereum repo.sourcify.dev
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.