The usingOraclize base contract deployed on its own, with none of the application that normally inherits it.
Context
Deployed 5 December 2015, during the Frontier era.
Key Facts
Description
usingOraclize is the base contract from oraclize/ethereum-api that applications inherit to reach the Oraclize service: it holds the address resolver 0x1d11e5eae3112dbd44f99266872ff1d07c77dce8, looks the current Oraclize contract up through it before every call, and wraps oraclize_query in eight overloads plus oraclize_cbAddress, oraclize_setProof and oraclize_setNetwork. Every one of those is internal, so none of them appears in this deployment's dispatcher; what is left onchain is the parts of the base that are externally reachable and the storage slot the resolver lookup writes. The deployer put the library up by itself rather than inheriting it, so nothing calls into it.
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)
// <ORACLIZE_API>
/*
Copyright (c) 2015 Oraclize srl, Thomas Bertani
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
contract OraclizeI {
address public cbAddress;
function query(uint _timestamp, string _datasource, string _arg) returns (bytes32 _id);
function query_withGasLimit(uint _timestamp, string _datasource, string _arg, uint _gaslimit) returns (bytes32 _id);
function query2(uint _timestamp, string _datasource, string _arg1, string _arg2) returns (bytes32 _id);
function query2_withGasLimit(uint _timestamp, string _datasource, string _arg1, string _arg2, uint _gaslimit) returns (bytes32 _id);
function getPrice(string _datasource) returns (uint _dsprice);
function getPrice(string _datasource, uint gaslimit) returns (uint _dsprice);
function useCoupon(string _coupon);
function setProofType(byte _proofType);
}
contract OraclizeAddrResolverI {
function getAddress() returns (address _addr);
}
contract usingOraclize {
uint constant day = 60*60*24;
uint constant week = 60*60*24*7;
uint constant month = 60*60*24*30;
byte constant proofType_NONE = 0x00;
byte constant proofType_TLSNotary = 0x10;
byte constant proofStorage_IPFS = 0x01;
OraclizeI oraclize;
modifier oraclizeAPI {
OraclizeAddrResolverI OAR = OraclizeAddrResolverI(0x1d11e5eae3112dbd44f99266872ff1d07c77dce8);
oraclize = OraclizeI(OAR.getAddress());
_
}
modifier coupon(string code){
OraclizeAddrResolverI OAR = OraclizeAddrResolverI(0x1d11e5eae3112dbd44f99266872ff1d07c77dce8);
oraclize = OraclizeI(OAR.getAddress());
oraclize.useCoupon(code);
_
}
function oraclize_query(string datasource, string arg) oraclizeAPI internal returns (bytes32 id){
return oraclize.query.value(oraclize.getPrice(datasource))(0, datasource, arg);
}
function oraclize_query(uint timestamp, string datasource, string arg) oraclizeAPI internal returns (bytes32 id){
return oraclize.query.value(oraclize.getPrice(datasource))(timestamp, datasource, arg);
}
function oraclize_query(uint timestamp, string datasource, string arg, uint gaslimit) oraclizeAPI internal returns (bytes32 id){
return oraclize.query_withGasLimit.value(oraclize.getPrice(datasource, gaslimit))(timestamp, datasource, arg, gaslimit);
}
function oraclize_query(string datasource, string arg, uint gaslimit) oraclizeAPI internal returns (bytes32 id){
return oraclize.query_withGasLimit.value(oraclize.getPrice(datasource, gaslimit))(0, datasource, arg, gaslimit);
}
function oraclize_query(string datasource, string arg1, string arg2) oraclizeAPI internal returns (bytes32 id){
return oraclize.query2.value(oraclize.getPrice(datasource))(0, datasource, arg1, arg2);
}
function oraclize_query(uint timestamp, string datasource, string arg1, string arg2) oraclizeAPI internal returns (bytes32 id){
return oraclize.query2.value(oraclize.getPrice(datasource))(timestamp, datasource, arg1, arg2);
}
function oraclize_query(uint timestamp, string datasource, string arg1, string arg2, uint gaslimit) oraclizeAPI internal returns (bytes32 id){
return oraclize.query2_withGasLimit.value(oraclize.getPrice(datasource, gaslimit))(timestamp, datasource, arg1, arg2, gaslimit);
}
function oraclize_query(string datasource, string arg1, string arg2, uint gaslimit) oraclizeAPI internal returns (bytes32 id){
return oraclize.query2_withGasLimit.value(oraclize.getPrice(datasource, gaslimit))(0, datasource, arg1, arg2, gaslimit);
}
function oraclize_cbAddress() oraclizeAPI internal returns (address){
return oraclize.cbAddress();
}
function oraclize_setProof(byte proofP) oraclizeAPI {
return oraclize.setProofType(proofP);
}
function parseAddr(string _a) internal returns (address){
bytes memory tmp = bytes(_a);
uint160 iaddr = 0;
uint160 b1;
uint160 b2;
for (uint i=2; i<2+2*20; i+=2){
iaddr *= 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;
iaddr += (b1*16+b2);
}
return address(iaddr);
}
function strCompare(string _a, string _b) internal returns (int) {
bytes memory a = bytes(_a);
bytes memory b = bytes(_b);
uint minLength = a.length;
if (b.length < minLength) minLength = b.length;
for (uint i = 0; i < minLength; i ++)
if (a[i] < b[i])
return -1;
else if (a[i] > b[i])
return 1;
if (a.length < b.length)
return -1;
else if (a.length > b.length)
return 1;
else
return 0;
}
function indexOf(string _haystack, string _needle) internal returns (int)
{
bytes memory h = bytes(_haystack);
bytes memory n = bytes(_needle);
if(h.length < 1 || n.length < 1 || (n.length > h.length))
return -1;
else if(h.length > (2**128 -1))
return -1;
else
{
uint subindex = 0;
for (uint i = 0; i < h.length; i ++)
{
if (h[i] == n[0])
{
subindex = 1;
while(subindex < n.length && (i + subindex) < h.length && h[i + subindex] == n[subindex])
{
subindex++;
}
if(subindex == n.length)
return int(i);
}
}
return -1;
}
}
function strConcat(string _a, string _b) internal returns (string) {
bytes memory ba = bytes(_a);
bytes memory bb = bytes(_b);
bytes memory bc = " ";
uint k = 0;
for (uint i = 0; i < ba.length; i ++){
bc[k] = ba[i];
k++;
}
for (i = 0; i < bb.length; i ++){
bc[k] = bb[i];
k++;
}
for (i = k; i < bc.length; i ++){
bc[i] = 0;
}
return string(bc);
}
// parseInt
function parseInt(string _a) internal returns (uint) {
bytes memory bresult = bytes(_a);
uint mint = 0;
for (uint i=0; i<bresult.length; i++){
if ((bresult[i] >= 48)&&(bresult[i] <= 57)){
mint *= 10;
mint += uint(bresult[i]) - 48;
} else break;
}
return mint;
}
// parseInt(parseFloat*10^_b)
function parseInt(string _a, uint _b) internal returns (uint) {
bytes memory bresult = bytes(_a);
uint mint = 0;
bool decimals = false;
for (uint i=0; i<bresult.length; i++){
if ((bresult[i] >= 48)&&(bresult[i] <= 57)){
if (decimals){
if (_b == 0) break;
else _b--;
}
mint *= 10;
mint += uint(bresult[i]) - 48;
} else if (bresult[i] == 46) decimals = true;
}
return mint;
}
}
// </ORACLIZE_API>External Links
Related contracts
Frontier Difficulty Oracle
Same eraWorld's earliest known on-chain prediction-market resolution oracle, deployed August 12, 2015 — resolves bets on Ethereum mining difficulty.
0x33ca8b...5cb10dAugust 12, 2015datafeed
Same eraThe datafeed example from the ethereum dapp-bin standardized contract APIs, a single owner key value oracle.
0x65ede7...4e25fbSeptember 9, 2015Private Lottery
Same eraVitalik Buterin Serpent oracle fetcher (Oct 12, 2015). get(string) requires >=0.007 ETH, derives a request id from sha3+block.prevhash, emits GetRequest, returns the id, and sends the balance to Vitalik's 0xde0b2956 address. Byte-for-byte cracked (Serpent @ f0b4128).
0x7e7f63...ddf746October 12, 2015Private Lottery
Same eraVitalik Buterin Serpent oracle fetcher (Oct 12, 2015). Same get(string) request contract as 0x7e7f6373; sweeps balance to 0xb3cd4c25. Byte-for-byte cracked (Serpent @ f0b4128).
0x36517c...f1eaf1October 12, 2015Private Lottery
Same eraVitalik Buterin Serpent oracle caller (Oct 12, 2015). Two functions: call() invokes an external fetcher's get(string) and stores a callback id; callback() re-emits the response as LogResponse. NOT a lottery. Byte-for-byte cracked (Serpent @ f0b4128).
0xc861fc...407166October 12, 2015Private Lottery
Same eraVitalik Buterin Serpent oracle caller (Oct 12, 2015). callback + call; call() forwards value to an external fetcher's get(string) and stores a callback id. Sibling of 0xc861fc8d. Byte-for-byte cracked (Serpent @ f0b4128).
0x4fea5c...aa609bOctober 12, 2015