Oraclize KrakenTicker demo (Nov 2015) that polls Kraken's ETH/XBT price every 60 seconds through an early, pre-release Oraclize API.
Key Facts
Description
One of six KrakenTicker contracts Oraclize deployed in November 2015 to demonstrate its oracle service. Every 60 seconds it asks Oraclize to fetch Kraken's public ETH/XBT ticker, stores the result in the public ETHXBT string when Oraclize calls back, and schedules the next query. It uses an early version of the usingOraclize helper that predates Oraclize's public ethereum-api repository: queries are paid with oraclize.send(getPrice) and callbacks are checked against cb_address(). The source was reconstructed and reproduces the deployed runtime byte for byte with soljson v0.1.6, optimizer on.
Source Verified
Exact runtime match, soljson v0.1.6+commit.d41f8b7c, optimizer on, fresh compiler process. Source KrakenTicker_0x4183e5e1.sol in the proof folder.
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 OraclizeI {
function query(uint timestamp, string datasource, string arg) returns (bytes32 id);
function query(uint timestamp, string datasource, string arg1, string arg2) returns (bytes32 id);
function getPrice(string datasource) returns (uint dsprice);
function cb_address() returns (address);
}
contract OraclizeAddrResolverI {
function getAddress() returns (address addr);
}
contract usingOraclize {
OraclizeI oraclize;
modifier oraclizeAPI {
OraclizeAddrResolverI OAR = OraclizeAddrResolverI(0x1d11e5eae3112dbd44f99266872ff1d07c77dce8);
oraclize = OraclizeI(OAR.getAddress());
_
}
function oraclize_query(uint timestamp, string datasource, string arg) oraclizeAPI returns (bytes32 id) {
oraclize.send(oraclize.getPrice(datasource));
oraclize.query(timestamp, datasource, arg);
}
function oraclize_query(uint timestamp, string datasource, string arg1, string arg2) oraclizeAPI returns (bytes32 id) {
oraclize.send(oraclize.getPrice(datasource));
oraclize.query(timestamp, datasource, arg1, arg2);
}
function oraclize_cbaddress() oraclizeAPI returns (address) {
return oraclize.cb_address();
}
}
contract KrakenTicker is usingOraclize {
address owner;
string public ETHXBT;
function KrakenTicker() {
owner = msg.sender;
update();
}
function __callback(bytes32 myid, string result) {
if (msg.sender != oraclize_cbaddress()) throw;
ETHXBT = result;
update();
}
function update() {
oraclize_query(60, "URL", "json(https://api.kraken.com/0/public/Ticker?pair=ETHXBT).result.XETHXXBT.c.0");
}
function kill() {
if (msg.sender == owner) suicide(msg.sender);
}
}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