Back to Home

Gamble

Game
0x9455c968229c...f26cf72f874b
FrontierContract #1,437Exact Bytecode MatchEdit this contract

Bytecode verified via sibling

This contract shares identical runtime bytecode with Gamble (0x6103747d...) which has been verified through compiler archaeology.

Deployed September 21, 2015 (10 years ago)Block 268,446

A 106-byte coin-flip: send ether and, if the block timestamp is odd, the contract tries to send back double. If it is even, you lose the stake.

Frontier EraVerified Source

Historical Significance

A compact example of the two mistakes that defined early on-chain gambling. Block timestamp is set by the miner within a tolerance, so the coin flip is not random and is influenced by the party best placed to bet on it. And because the unchecked send fails when the house is empty, the game is only fair while somebody keeps it funded. Both patterns were later formalised as standard audit findings, but in 2015 they were still being discovered by deploying them.

Context

Deployed 2015-09-21 by 0x7d2bf6751846b59f2b73be89b8980b9637d840e3. Six byte-identical copies of this runtime exist, deployed by four distinct addresses between 2015-08-19 and 2015-09-21. Most now hold a zero balance, so a winning flip against them would pay nothing. Source recovered by exact runtime bytecode match and verified on Sourcify.

Key Facts
Deployment Block
268,446
Deployment Date
Sep 21, 2015, 02:43 PM
Code Size
124.0 B
Gas at Deploy
50,173

Description

The contract has no named functions at all. Everything happens in the fallback, so a plain ether transfer is the bet. It reads block.timestamp and takes it modulo 2. On an even timestamp it returns immediately and keeps the ether. On an odd timestamp it calls msg.sender.send(2 * value), attempting to pay double the amount just received. The return value of send is not checked, which matters because the payout can only succeed if the contract already holds at least as much ether as the incoming bet. An unfunded copy silently keeps the stake even on a winning flip.

Source Verified

SolidityExact bytecode match(124 bytes)
Compiler: v0.1.3+
Heuristic Analysis

The following characteristics were detected through bytecode analysis and may not be accurate.

Detected Type: Game

Bytecode Overview

Opcodes124
Unique Opcodes40
Jump Instructions8
Storage Operations0

External Links

Related contracts