A contract built to probe what the msg globals actually return, endowed with 5 ETH, deployed 1 September 2015.
Historical Significance
What msg and tx actually contain, written down by measurement rather than from the documentation. Recording the same globals at construction and again during a later call is the only way to see which of them change and which are fixed, and in 2015 the documentation for several of these was thin enough that measuring was the reliable route.
Context
Deployed in the weeks after the Frontier launch, when the semantics of the msg globals were still being worked out in public.
Key Facts
Description
The contract records the data, gas, value, gas price and tx origin present when it was constructed, then exposes each one for reading afterwards. It pairs every msg global with a before and after variant, capturing msg.data, msg.gas and msg.value on entry to a call and again on exit, so a caller can see what each one reports at each point. Two send functions pay one ether to the block coinbase and to the creator. The source comments are written as open questions about what the globals mean, which places it as a deliberate experiment rather than a deployed application. A kill function was used, so the address holds no code today and this source is matched against the bytecode as archived at deployment. Deployed by Cyrus Adkisson from 0xcf684dfb8304729355b58315e8019b1aa2ad1bac with 5 ether.
Source Verified
Historian Categories
Heuristic Analysis
The following characteristics were detected through bytecode analysis and may not be accurate.
Frontier Era
The initial release of Ethereum. A bare-bones implementation for technical users.
Bytecode Overview
Verified Source Available
Source verified through compiler archaeology and exact bytecode matching.
View Verification ProofShow source code (Solidity)
// Submitted by EthereumHistory (ethereumhistory.com)
contract msgExaminer {
address creator;
address miner;
bytes contract_creation_data;
uint contract_creation_gas;
uint contract_creation_value;
uint contract_creation_tx_gasprice;
address contract_creation_tx_origin;
function msgExaminer() public
{
creator = msg.sender; // msg is a global variable
miner = 0x910561dc5921131ee5de1e9748976a4b9c8c1e80;
contract_creation_data = msg.data;
contract_creation_gas = msg.gas;
contract_creation_value = msg.value; // the endowment of this contract in wei
contract_creation_tx_gasprice = tx.gasprice;
contract_creation_tx_origin = tx.origin;
}
function getContractCreationData() constant returns (bytes) // return val should change depending on the input
{
return contract_creation_data;
}
function getContractCreationGas() constant returns (uint) // return val should change depending on the input
{
return contract_creation_gas;
}
function getContractCreationValue() constant returns (uint) // return val should change depending on the input
{
return contract_creation_value;
}
function getContractCreationTxGasprice() constant returns (uint)
{
return contract_creation_tx_gasprice;
}
function getContractCreationTxOrigin() constant returns (address)
{
return contract_creation_tx_origin;
}
bytes msg_data_before_creator_send;
bytes msg_data_after_creator_send;
uint msg_gas_before_creator_send;
uint msg_gas_after_creator_send;
uint msg_value_before_creator_send;
uint msg_value_after_creator_send;
function sendOneEtherToMiner() returns (bool success)
{
msg_gas_before_creator_send = msg.gas; // save msg values
msg_data_before_creator_send = msg.data;
msg_value_before_creator_send = msg.value;
bool returnval = miner.send(1000000000000000000); // do something gassy
msg_gas_after_creator_send = msg.gas; // save them again
msg_data_after_creator_send = msg.data;
msg_value_after_creator_send = msg.value; // did anything change? Use getters below.
return returnval;
}
function sendOneEtherToHome() returns (bool success)
{
msg_gas_before_creator_send = msg.gas; // save msg values
msg_data_before_creator_send = msg.data;
msg_value_before_creator_send = msg.value;
bool returnval = creator.send(1000000000000000000); // do something gassy
msg_gas_after_creator_send = msg.gas; // save them again
msg_data_after_creator_send = msg.data;
msg_value_after_creator_send = msg.value; // did anything change? Use getters below.
return returnval;
}
function getMsgData() constant returns (bytes) // "returns data sent with tx"? This one or the one that created the contract?
{
return msg.data;
}
function getMsgDataBefore() constant returns (bytes)
{
return msg_data_before_creator_send;
}
function getMsgDataAfter() constant returns (bytes)
{
return msg_data_after_creator_send;
}
function getMsgGas() constant returns (uint) // "remaining gas" Of what? This call or the contact?
{
return msg.gas;
}
function getMsgGasBefore() constant returns (uint)
{
return msg_gas_before_creator_send;
}
function getMsgGasAfter() constant returns (uint)
{
return msg_gas_after_creator_send;
}
function getMsgValue() constant returns (uint) // "returns amt of wei sent with the message" This call or the whole contract?
{
return msg.value;
}
function getMsgValueBefore() constant returns (uint)
{
return msg_value_before_creator_send;
}
function getMsgValueAfter() constant returns (uint)
{
return msg_value_after_creator_send;
}
/**********
Standard kill() function to recover funds
**********/
function kill() returns (bool)
{
if (msg.sender == creator)
{
suicide(creator); // kills this contract and sends remaining funds back to creator
return true;
}
else
{
return false;
}
}
}External Links
Related contracts
GetBalance
Same deployerCyrus Adkisson experimental getter (Sep 2015) exposing the ether balance of a hardcoded address via getMyBalance(). Verified byte-for-byte with soljson v0.1.1.
0x759ad4...239a87August 26, 2015Contract 0xddcd64...a08e7b
Same deployerThe greeter tutorial contract: it stores a greeting set at deployment and can be shut down by its owner.
0xddcd64...a08e7bAugust 26, 2015basicInfoGetter
Same deployerA tour of the EVM globals, carrying the constructor of the file it was copied from
0xad826c...d33547August 31, 2015Contract 0x3ea0db...b922e0
Same deployerThe basic info getter from the solidity-baby-steps tutorials, a read only window onto the block and message globals.
0x3ea0db...b922e0August 31, 2015Contract 0x8b180c...c084df
Same deployerA third deployment of the msgExaminer that records its own creation message
0x8b180c...c084dfSeptember 1, 2015Contract 0x46dce1...3086aa
Same deployerA contract built to probe what the msg globals return, endowed with 3 ETH on 1 September 2015.
0x46dce1...3086aaSeptember 1, 2015