Back to Home

MessagingContract v2

other
0x18991fc52465...5beb2ddfff72
FrontierContract #37Source Verified
Deployed August 8, 2015 (10 years ago)Block 53,212

An upgraded on-chain messaging contract with per-address message tracking and delete functionality, from the same Frontier developer who built the simpler Messa

Key Facts

Deployment Block
53,212
Deployment Date
Aug 8, 2015, 11:41 AM
Code Size
1.5 KB
Gas at Deploy
432,685
Transactions by Year
20154

Description

An upgraded messaging contract deployed at block 53,212 (August 2015) on Ethereum Frontier. This version adds per-address message tracking via a hashes mapping and a messages lookup, plus the ability to delete messages. Users call sendMessage(address, string) to store a message, indexed by sha3 hash with the timestamp recorded. Each recipient gets their own list of message hashes. Same deployer (0x8674c218) as the simpler MessagingContract at rank 36, the Ponzi at rank 33, and the verified MessageStore at rank 27.

Source Verified

SolidityNear-exact bytecode match
Compiler: soljson

near_exact_match: reconstructed source produces 1557b runtime (target 1543b = 99.1% match) with soljson v0.3.1 no-opt. All 6 selectors confirmed via openchain.xyz. 14-byte diff likely from delete implementation variant.

Heuristic Analysis

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

Detected Type: other

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

Opcodes1,562
Unique Opcodes125
Jump Instructions67
Storage Operations39

Verified Source Available

This contract has verified source code.

Show source code (Solidity)
contract Messaging {
    mapping(bytes32 => string) messageContents;
    mapping(bytes32 => uint) messageTime;
    mapping(address => bytes32[]) public hashes;
    mapping(address => mapping(bytes32 => bool)) public messages;

    function sendMessage(address to, string content) {
        bytes32 h = sha3(msg.sender, to, content);
        messageContents[h] = content;
        messageTime[h] = block.timestamp;
        hashes[to].push(h);
    }

    function getMessageContents(bytes32 hash) constant returns (string) {
        return messageContents[hash];
    }

    function getMessageTime(bytes32 hash) constant returns (uint) {
        return messageTime[hash];
    }

    function deleteMessage(bytes32 hash) {
        delete messageContents[hash];
        delete messageTime[hash];
    }
}

External Links