Space Godzilla Hack
What happened
SpaceGodzilla, a token on BNB Smart Chain, was drained through its own liquidity-adding function in a flash-loan attack on July 13, 2022 (Numen reports it as July 14). The attacker made about 25,378 USD in stablecoins (other estimates put it above $26K) and, according to Numen, swapped the profit to BNB and sent it through Tornado Cash.
The token contract had a swapAndLiquifyStepv1() function that took the USDT and SpaceGodzilla the contract held and added both to its PancakeSwap pair as liquidity. Anyone could call it. Numen identifies it as the root cause: the function added liquidity while the pool's ratio was badly unbalanced. The attacker skewed the pool with borrowed funds, called the function to put the contract's own tokens into the skewed pool, then traded back at a profit.
**Block data**
- Exploiter:
0x00a62eb08868ec6feb23465f61aa963b89e57e57 - Exploit contracts:
0x3d817ea746edd02c088c4df47c0ece0bd28dcd72,0x05ad60d9a2f1aa30ba0cdbaf1e0a0a145fbea16f - Exploit transactions:
0x7f183df11f1a0225b5eb5bb2296b5dc51c0f3570e8cc15f0754de8e6f8b4cca4,0x67ba949a3fa10bea9ab78b6bb0866bef81370c269debcbae920692bc2081bdeb - Transfer of about $25K to another contract:
0xa74e446aaf0b34a34a4193bda036820944ededbf4d151dcf9757294480c13f4e
How it happened
- The attacker took flash loans from 16 pools, raising about 2.95 million USDT.
- It called the token's public
swapTokensForOther()function, then swapped 2,952,797.73 USDT for about 71.56 trillion SpaceGodzilla in the PancakeSwap pair. This pushed the SpaceGodzilla price up and left the pool heavily unbalanced. - It called the public
swapAndLiquifyStepv1(), which added the contract's own 30,395.26 USDT and 22,634,745,200 SpaceGodzilla to the unbalanced pool. - It sold the 71.56 trillion SpaceGodzilla back to the pair for 2,978,176.48 USDT.
- It repaid the flash loans and kept about 25,378.78 USDT, which Numen says was converted to BNB and moved through Tornado Cash.
Protocol details
Evidence
- report Report dexscreener.com
- transaction bscscan.com transaction 0x67ba…bdeb bscscan.com
- transaction bscscan.com transaction 0x7f18…cca4 bscscan.com
- transaction bscscan.com transaction 0xa74e…3f4e bscscan.com
- address bscscan.com address 0x00a6…7e57 bscscan.com
- address bscscan.com address 0x05ad…a16f bscscan.com
- address bscscan.com address 0x3d81…cd72 bscscan.com
- code DeFiHackLabs SpaceGodzilla_exp.sol proof of concept github.com
- code DeFiHackLabs past/2022 README: 20220713 SpaceGodzilla - Flashloans & Price Manipulation github.com
- analysis DeFiLlama defillama.com
- analysis SpaceGodzilla Attack Event Analysis (Numen Cyber Labs) numencyber.com
- analysis www.youtube.com page watch youtube.com
Understand the attack patterns
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.