Back to Home

MessagingContract v3

Unclassified
0xd51ead1daa49...6780966130ef
FrontierContract #45Source VerifiedEdit this contract
Deployed August 8, 2015 (11 years ago)Block 54,304

The 8 August 2015 messaging contract whose sendMessage always reverts, indexing a hash array that is never lengthened.

Frontier EraVerified Source

Historical Significance

An onchain messaging contract deployed on 8 August 2015 by 0x8674c218f0351a62c3ba78c34fd2182a93da94e2, the version where sendMessage tries to index the recipient's hash list. It reads the nonce, casts it to bytes32 as the message key, advances the nonce, writes Message(uint64(now), contents) into mapping (address => mapping (bytes32 => Message)) messages under the recipient's address, and then assigns hashes[to][n] = hash. That last line is the flaw: hashes[to] is never lengthened, so the index is always past the end of the array and the whole call reverts. Twenty five minutes later the author deployed the same contract with that line deleted. Recipients read their mail with getMessageTime and getMessageContents, both keyed on msg.sender, and deleteMessage clears a message and zeroes its entry in the caller's hash list. Source recovered by exact bytecode match: solc v0.1.1+commit.6ff4cd6 with the optimizer on reproduces all 1430 bytes of the creation transaction.

Context

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

Key Facts
Deployment Block
54,304
Deployment Date
Aug 8, 2015, 04:39 PM
Code Size
1.4 KB
Gas at Deploy
397,668
Transactions by Year
20155

Description

An onchain messaging contract deployed on 8 August 2015 by 0x8674c218f0351a62c3ba78c34fd2182a93da94e2, the version where sendMessage tries to index the recipient's hash list. It reads the nonce, casts it to bytes32 as the message key, advances the nonce, writes Message(uint64(now), contents) into mapping (address => mapping (bytes32 => Message)) messages under the recipient's address, and then assigns hashes[to][n] = hash. That last line is the flaw: hashes[to] is never lengthened, so the index is always past the end of the array and the whole call reverts. Twenty five minutes later the author deployed the same contract with that line deleted. Recipients read their mail with getMessageTime and getMessageContents, both keyed on msg.sender, and deleteMessage clears a message and zeroes its entry in the caller's hash list. Source recovered by exact bytecode match: solc v0.1.1+commit.6ff4cd6 with the optimizer on reproduces all 1430 bytes of the creation transaction.

Source Verified

SolidityNear-exact bytecode match
Compiler: soljson

near_exact_match: reconstructed source with nonce-based sha3 hashing. All selectors confirmed via openchain.xyz (including affed0e0=nonce()).

Heuristic Analysis

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

Detected Type: Unclassified

Bytecode Overview

Opcodes1,430
Unique Opcodes104
Jump Instructions65
Storage Operations38

External Links

Related contracts