A third deployment of the msgExaminer that records its own creation message
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
Frontier era deployment by Cyrus Adkisson, from his Solidity teaching repository.
Key Facts
Description
Byte for byte identical to 0x46dce1955e40d23a6ed0b745b517ae08aa3086aa and 0xba575c0c66ec866a308dcd4cb3dbd3a83d78733f. It saves msg.data, msg.gas, msg.value, tx.gasprice and tx.origin at construction time and again around a send, so the two sets can be compared. Deployed 24 August 2015 and later destroyed.
Source Verified
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 contract_creation_data;
}
function getContractCreationGas() constant returns (uint) // returned 732117 for me. Must be the gas expended
{ // the creation of this contract. msg.gas should be msg.gasExpended
return contract_creation_gas;
}
function getContractCreationValue() constant returns (uint) // returns the original endowment of the contract
{ // set at creation time with "value: <someweivalue>"
return contract_creation_value; // this is now the "balance" of the contract
}
function getContractCreationTxGasprice() constant returns (uint) // returned 50000000000 for me. Must be the gasprice
{ // the sender is willing to pay. msg.gasPrice should be msg.gasLimit
return contract_creation_tx_gasprice;
}
function getContractCreationTxOrigin() constant returns (address) // returned my coinbase address.
{ // Not sure if a chain of transactions would return the same.
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 getMsgDataBefore() constant returns (bytes)
{
return msg_data_before_creator_send;
}
function getMsgDataAfter() constant returns (bytes)
{
return msg_data_after_creator_send;
}
function getMsgGasBefore() constant returns (uint)
{
return msg_gas_before_creator_send;
}
function getMsgGasAfter() constant returns (uint)
{
return msg_gas_after_creator_send;
}
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 0xba575c...78733f
Same deployerA contract built to probe what the msg globals actually return, endowed with 5 ETH, deployed 1 September 2015.
0xba575c...78733fSeptember 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