Revised Oraclize/ShapeShift test from October 2015: requests an ETH-to-BTC deposit address through the oracle when update() is called.
Historical Significance
Shows the Oraclize resolver arrangement taking its final shape in October 2015. An early form of Oraclize's StopLoss example. Source reconstructed from bytecode; exact runtime and creation match, verified on Etherscan and Sourcify.
Context
Deployed on 24 October 2015 by the Oraclize operator account, a few hours after the first version. It reads the Oraclize address from the resolver at 0x1d11e5eae3112dbd44f99266872ff1d07c77dce8, the address Oraclize's December 2015 API release also used.
Key Facts
Description
Same ShapeShift request as the earlier test: update() pays getPrice("URL") to the Oraclize connector and asks it to POST {"pair": "eth_btc", "amount": "0.2", "withdrawal": "1AAcCo21EUc1jbocjssSQDzLna9Vem2UN5"} to ShapeShift's sendamount endpoint. __callback() checks the sender against cb_address(), parses the returned hex deposit address and stores it in shapeshift_address. This revision holds the resolver address in storage and has an empty constructor, so nothing is sent until update() is called. kill() self-destructs to the caller.
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 OraclizeI {
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 _cbAddress);
}
contract OraclizeAddrResolverI {
function getAddress() returns (address _addr);
}
contract usingOraclize {
address OAR = 0x1d11e5eae3112dbd44f99266872ff1d07c77dce8;
OraclizeI oraclize = OraclizeI(OraclizeAddrResolverI(OAR).getAddress());
}
contract StopLoss is usingOraclize {
address public shapeshift_address;
function StopLoss() {
}
function __callback(bytes32 myid, string result) {
if (msg.sender != oraclize.cb_address()) throw;
bytes memory tmp = bytes(result);
uint160 ishapeshift = 0;
uint160 b1;
uint160 b2;
for (uint i=2; i<2+2*20; i+=2){
ishapeshift *= 256;
b1 = uint160(tmp[i]);
b2 = uint160(tmp[i+1]);
if ((b1 >= 97)&&(b1 <= 102)) b1 -= 87;
else if ((b1 >= 48)&&(b1 <= 57)) b1 -= 48;
if ((b2 >= 97)&&(b2 <= 102)) b2 -= 87;
else if ((b2 >= 48)&&(b2 <= 57)) b2 -= 48;
ishapeshift += (b1*16+b2);
}
shapeshift_address = address(ishapeshift);
}
function update() {
address(oraclize).send(oraclize.getPrice("URL"));
oraclize.query(0, "URL", "json(https://shapeshift.io/sendamount).success.deposit", '{"pair": "eth_btc", "amount": "0.2", "withdrawal": "1AAcCo21EUc1jbocjssSQDzLna9Vem2UN5"}');
}
function kill(){
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