Back to Home

Roulette

Game
0x5fe5b7546d16...de1fc825a4fd
FrontierContract #149Source VerifiedEdit this contract
Deployed August 10, 2015 (10 years ago)Block 66,126

An early Ethereum roulette contract from August 2015, notable for a critical randomness vulnerability: its 'private' seed is hardcoded to 1 in the constructor.

Frontier EraVerified Source

Historical Significance

Roulette is one of the earliest documented examples of the blockchain randomness vulnerability on Ethereum — a bug class that would go on to drain millions of dollars from gambling contracts over subsequent years. The contract's author believed that a "private" variable initialized to a hardcoded constant was unpredictable, when in reality all Ethereum state is public. This contract is an artifact of the pre-audit era, when developers were still learning the security implications of programming on a transparent, deterministic blockchain.

Context

In August 2015, Ethereum had been live for less than two weeks. There were no smart contract auditors, no established security best practices, and no public vulnerability databases for Solidity. Developers deploying contracts learned through experimentation. The assumption that private variables are hidden — a reasonable intuition from traditional programming — proved incorrect on a public blockchain. The exploitation of randomness and storage privacy bugs would become one of the defining security themes of early Ethereum.

Key Facts
Deployment Block
66,126
Deployment Date
Aug 10, 2015, 11:26 PM
Code Size
2.3 KB
Gas at Deploy
761,357
Transactions by Year
2015446
20174
20182
20191
20201
20212
20222
20232
202514
202610

Description

Roulette is one of the earliest gambling contracts on Ethereum mainnet, deployed at block 66,126 on August 10, 2015 — 11 days after genesis. Created by address 0xa14cf6cec1c6aae4b608458f6e14692863a937aa, it implements a roulette-style betting game where players wager between 1 and 10 ETH on a number.

The contract maintains a Casino struct holding the house address, balance, and betting limits. Players call betOnNumber(uint number) to place a bet; a random number is generated using an internal seed and compared to determine the outcome. Winnings are sent directly to the player's address.

The contract's source code includes a comment claiming that the privSeed used for random number generation is difficult to guess because it is "nowhere visible." However, privSeed is initialized to 1 in the constructor — a hardcoded, publicly known value. Anyone reading the contract source can predict every outcome. This is an early example of the "bad randomness" vulnerability class that would later be systematically exploited across many Ethereum gambling contracts.

The minimum bet is 1 ETH and the maximum is 10 ETH.

Source Verified

Etherscan verified
Heuristic Analysis

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

Detected Type: Game
Contains SELFDESTRUCT opcode

Bytecode Overview

Opcodes2,375
Unique Opcodes159
Jump Instructions138
Storage Operations59

External Links