Oraclize's ETH/BTC price ticker from October 2015: keeps Kraken's ETH/XBT price in a public string, refreshed by the oracle every 60 seconds.
Historical Significance
One of the earliest mainnet contracts to read external data through an oracle, and the earliest form of the KrakenPriceTicker example Oraclize later published. Source reconstructed from bytecode; exact runtime and creation match.
Context
Deployed on 23 October 2015 by the Oraclize operator account, before Oraclize published its API and examples on GitHub in December 2015. It uses the interface as it was before that rewrite: a connector address written directly into the contract, a query(uint256,string,string) call and a cb_address() check.
Key Facts
Description
PriceTicker stores the latest Kraken ETH/XBT price in the public string ETHXBT (initialised to "?????"). update() asks Oraclize to fetch json(https://api.kraken.com/0/public/Ticker?pair=ETHXBT).result.XETHXXBT.c.0 with a 60 second delay; __callback() accepts the answer only from the address returned by the connector's cb_address(), stores it and queues the next query. The constructor sends the first query, and kill() self-destructs the contract to the Oraclize operator account. The Oraclize connector address is hardcoded in storage.
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 Oraclize {
function query(uint timestamp, string datasource, string arg) returns (bytes32 id);
function cb_address() returns (address _cbAddress);
}
contract PriceTicker {
Oraclize oraclize = Oraclize(0xfa5186a0af28454ba31bfc7b1100880b01b2051d);
string public ETHXBT = "?????";
function PriceTicker() {
update();
}
function __callback(bytes32 myid, string result) {
if (msg.sender != oraclize.cb_address()) throw;
ETHXBT = result;
update();
}
function update() {
bytes32 myid = oraclize.query(60, "URL", "json(https://api.kraken.com/0/public/Ticker?pair=ETHXBT).result.XETHXXBT.c.0");
}
function kill() {
suicide(0x0047a8033cc6d6ca2ed5044674fd421f44884de8);
}
}External Links
Related contracts
Target
Same deployerTarget contract.
0x9e0ae8...c9428eSeptember 17, 2015GetSet
Same deployerA minimal getter/setter proxy from the Oraclize team. set() forwards calls to a hardcoded target contract, get() returns constant 255.
0x77beac...7e96c2September 17, 2015SimpleStorage
Same deployerThe storage example rewired to send a wei and return a constant
0x7aa73b...46473bSeptember 17, 2015Controller
Same deployerController contract.
0x3c9492...e332e5September 17, 2015GetSet
Same deployerA 57-byte test contract: set() stores the transaction's ether value into storage slot 0, and get() reads it back.
0xe595e8...423530September 17, 2015GetSet
Same deployerA 57-byte test contract: set() stores the transaction's ether value into storage slot 0, and get() reads it back.
0xd17e9b...03b76aSeptember 17, 2015