The Fomo3D play loop reduced to its shortest form: execute deploys a child that buys once, withdraws once, and selfdestructs to the caller.
Historical Significance
Compared with the looping variants of the same idea, this one buys exactly once per transaction. That is the version you write when the game is late in its round and the point is to be last rather than to be biggest. The whole thing exists for a single block of a single game, and the child's lifetime is measured in instructions rather than blocks.
Key Facts
Description
Two contracts, neither with any storage. execute takes the game address and an affiliate code and forwards the whole incoming value into a freshly deployed child.
The child does everything in its constructor. It calls buyXid on the game with the value it received, naming the affiliate code and team zero, then calls withdraw to pull back whatever was credited, then selfdestructs to the transaction origin. Both calls are raw, with the selectors written as bytes4 literals and the results ignored, so a rejected buy does not stop the withdraw and a failed withdraw does not stop the destruction.
Selfdestructing to tx.origin rather than to a stored owner is what makes the contract reusable by anyone: whoever sent the transaction gets the proceeds, so the same deployed bot serves every player.
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 Player {
constructor(address _game, uint256 _affCode) public payable {
_game.call.value(msg.value)(bytes4(0x8f38f309), _affCode, 0);
_game.call(bytes4(0x3ccfd60b));
selfdestruct(tx.origin);
}
}
contract Bot {
function execute(address _game, uint256 _affCode) public payable {
(new Player).value(msg.value)(_game, _affCode);
}
}