Back to Home

Random

program
0x77b7fa1bc7c2...3c93c119b6af
FrontierContract #7,759Exact Bytecode MatchEdit this contract
Deployed February 4, 2016 (10 years ago)Block 951,171

A minimal random number generator that stores a blockhash at deployment. Has a bug: the rand() function always returns 0.

Key Facts

Deployment Block
951,171
Deployment Date
Feb 4, 2016, 06:47 AM
Code Size
162.0 B
Gas at Deploy
79,867
Transactions by Year
20161

Description

A tiny contract (126 bytes runtime) deployed on Feb 4, 2016 that attempts to generate a random value by storing block.blockhash(blockNumber) at deployment time. The rand() function takes min and max parameters but ignores them entirely, simply returning the stored blockhash.

The contract has a notable bug: block.blockhash(block.number) always returns 0 in the EVM because the current block's hash is not yet available. The developer likely intended block.blockhash(block.number - 1) to get the previous block's hash. As a result, rand() always returns 0.

Uses inline state variable initializers instead of a constructor function, which produces unusually compact init code (36 bytes). The same deployer (0x5de92686587b10cD47E03B71f2E2350606fCAf14) deployed over 100 other experimental contracts during the same period.

Source Verified

SolidityExact bytecode match(162 bytes)
Compiler: soljson

Exact bytecode match (init + runtime). 36 bytes init, 126 bytes runtime. Uses inline state variable initializers, no constructor.

Heuristic Analysis

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

Detected Type: program

Frontier Era

The initial release of Ethereum. A bare-bones implementation for technical users.

Block span: 01,149,999
July 30, 2015March 14, 2016

Bytecode Overview

Opcodes162
Unique Opcodes36
Jump Instructions8
Storage Operations6

Verified Source Available

Source verified through compiler archaeology and exact bytecode matching.

View Verification Proof
Show source code (Solidity)
contract Random {
    uint blockNumber = block.number;
    bytes32 randomValue = block.blockhash(blockNumber);

    function rand(uint256 min, uint256 max) returns (bytes32) {
        return randomValue;
    }
}

External Links