Back to Home

Lottery

Lottery / Gambling
0xf6bf0ee51fe0...2e9241ec3b5c
FrontierContract #59Source VerifiedEdit this contract
Deployed August 8, 2015 (11 years ago)Block 54,913

The first draft of the EarlyLottery commit-reveal lottery, deployed on 8 August 2015 a few hours before its rewrite.

Frontier EraVerified Source

Historical Significance

The earliest of the commit-reveal lottery drafts by 0xfd2605a2bf58fdbb90db1da55df61628b47f9e8c, deployed on 8 August 2015 and replaced by a shorter rewrite the same evening. Play runs on an 88 block cycle. buyTicket(bytes32) accepts a hash commitment during the first 40 blocks of the cycle and credits the ether sent with it. submitSecret(uint64) reveals the preimage between blocks 48 and 68. payout() fires once block.number modulo 88 passes 68 and at least 68 blocks have elapsed since the last draw, and sends the pot minus 25000 times tx.gasprice. What sets this draft apart is random(): it xors the revealed secrets together and then folds the result down toward the ticket count by repeated division by 65536, with two separate modulo escapes on the way out. The rewrite deployed hours later throws that away for a single modulo. Both drafts share the same fatal reveal bug, an out of bounds write to secrets[secrets.length] that always throws. Source recovered by exact bytecode match: solc v0.1.1+commit.6ff4cd6 with the optimizer on reproduces all 1096 bytes of the creation transaction.

Context

Deployed 8 August 2015, the second day of the Ethereum Frontier network.

Key Facts
Deployment Block
54,913
Deployment Date
Aug 8, 2015, 07:30 PM
Code Size
1.1 KB
Gas at Deploy
326,142
Transactions by Year
201524
20181
202664

Description

The earliest of the commit-reveal lottery drafts by 0xfd2605a2bf58fdbb90db1da55df61628b47f9e8c, deployed on 8 August 2015 and replaced by a shorter rewrite the same evening. Play runs on an 88 block cycle. buyTicket(bytes32) accepts a hash commitment during the first 40 blocks of the cycle and credits the ether sent with it. submitSecret(uint64) reveals the preimage between blocks 48 and 68. payout() fires once block.number modulo 88 passes 68 and at least 68 blocks have elapsed since the last draw, and sends the pot minus 25000 times tx.gasprice. What sets this draft apart is random(): it xors the revealed secrets together and then folds the result down toward the ticket count by repeated division by 65536, with two separate modulo escapes on the way out. The rewrite deployed hours later throws that away for a single modulo. Both drafts share the same fatal reveal bug, an out of bounds write to secrets[secrets.length] that always throws. Source recovered by exact bytecode match: solc v0.1.1+commit.6ff4cd6 with the optimizer on reproduces all 1096 bytes of the creation transaction.

Source Verified

SolidityNear-exact bytecode match
Compiler: v0.1.5+

1073 bytes. Source reconstructed: commit-reveal lottery by same developer as EarlyLottery (0x7af6af3d). 5 functions: submitSecret(bytes32), random(), payout(), payoutReady(), buyTicket(bytes32). Correct size match and all selectors confirmed with v0.1.5 optimizer ON. 935 diffs in optimizer layout -- exact compiler snapshot not found. 0.824 ETH remains locked since Aug 8 2015.

Historian Categories

Lottery / Gambling
Heuristic Analysis

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

Detected Type: Lottery / Gambling

Bytecode Overview

Opcodes1,096
Unique Opcodes131
Jump Instructions68
Storage Operations34

External Links

Related contracts