Back to Home

Contract 0x9ed1a2bc358c...4b766e2c87c0

Utility
0x9ed1a2bc358c...4b766e2c87c0
FrontierContract #107DecompiledEdit this contract
Deployed August 9, 2015 (11 years ago)Block 59,482

A commit and reveal lottery from August 2015 with a ticket price of 1 ether and rounds 106 blocks long.

Frontier Era

Historical Significance

A commit and reveal scheme on Ethereum in the second week of the public chain. Every value available inside the EVM is either known in advance or chosen by whoever produces the block, so a lottery that draws from block data can be steered by a miner; asking the players to commit to secrets and reveal them later moves the randomness to a place no single participant controls. Contemporary lotteries mostly used a block hash and were beatable because of it. This one is the harder design, attempted immediately.

Context

Deployed in August 2015, within a fortnight of Frontier going live, when there was no oracle service, no verifiable random function and no established way to get an unpredictable number into a contract. Commit and reveal was the only mechanism available that did not require trusting a third party, and it carries its own weakness: a player who dislikes the outcome can decline to reveal.

Key Facts
Deployment Block
59,482
Deployment Date
Aug 9, 2015, 04:48 PM
Code Size
1.5 KB
Gas at Deploy
440,734
Transactions by Year
20151

Description

A lottery that gathers its randomness from its own players. buyTicket takes a stake and records a ticket; submitSecret lets a player reveal a number they committed to; random() combines what has been revealed; payoutReady() reports whether the round has closed; and payout() settles it. tickets(uint256) reads back an individual entry, balance() the pot, and lastBlock() the boundary the current round runs to.

Rounds are defined by arithmetic on the block number rather than by an operator: one zero-argument function returns the block number modulo 106, so a round is 106 blocks long, about half an hour at the block times of the day. That function's name is not recoverable from the deployed code and has not been found.

The Solidity source has not been recovered. What the contract does is read from its bytecode and from the chain, not from a source file.

Its ticket price is 1 ether. A second deployment of the same code differs from this one in that constant alone.

Heuristic Analysis

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

Detected Type: Utility

Bytecode Overview

Opcodes1,524
Unique Opcodes153
Jump Instructions89
Storage Operations55

External Links

Related contracts