Skip to content
Verified contractPartial

Oraclize

Address0x8886e65a1e6e9b6f40eca576f4f4bbdcac601487
Balance

0 ETH

 

Transactions

1

 

Compiler

solc 0.1.6

 

Same code

Only this contract

 

Details

Compiler
solc 0.1.6+commit.d41f8b7c
Language
solidity
Optimization
No
License
Not stated
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
433,349
Creation transaction
0xe43b3ede13…3b76a601b0

Oraclize.sol

// Recovered by EthereumHistory (ethereumhistory.com) -sw
contract Oraclize {
    uint reqc = 0;
    address public cb_address = 0x26588a9301b0428d95e6fc3a5024fce8bec12d51;
    mapping (address => uint) balances;
    address owner;

    event Log1(bytes32 cid, uint timestamp, string datasource, string arg);
    event Log2(bytes32 cid, uint timestamp, string datasource, string arg1, string arg2);

    function Oraclize() {
        owner = msg.sender;
    }

    function() {
        if (msg.value > 0) balances[msg.sender] += msg.value;
    }

    function getPrice(string datasource) returns (uint) {
        return 10;
    }

    function getBalance(address a) returns (uint) {
        return balances[a];
    }

    function withdraw() {
        msg.sender.send(balances[msg.sender]);
        balances[msg.sender] = 0;
    }

    function withdrawAll() {
        if (msg.sender == owner) owner.send(this.balance);
    }

    function query(uint timestamp, string datasource, string arg) returns (bytes32 id) {
        uint price = getPrice(datasource);
        if (msg.value > 0) balances[msg.sender] += msg.value;
        if (balances[msg.sender] >= price) {
            balances[msg.sender] -= price;
            id = sha3(now + reqc);
            reqc++;
            Log1(id, timestamp, datasource, arg);
            return id;
        } else return 1;
    }

    function query(uint timestamp, string datasource, string arg1, string arg2) returns (bytes32 id) {
        uint price = getPrice(datasource);
        if (msg.value > 0) balances[msg.sender] += msg.value;
        if (balances[msg.sender] >= price) {
            balances[msg.sender] -= price;
            id = sha3(now + reqc);
            reqc++;
            Log2(id, timestamp, datasource, arg1, arg2);
            return id;
        } else return 1;
    }
}
Compiler settingsShow
{
  "optimizer": {
    "runs": 200,
    "enabled": false
  }
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.