ETH Price: $1,871.46 (+0.10%)

Transaction Decoder

Block:
6418457 at Sep-29-2018 01:40:55 AM +UTC
Transaction Fee:
0.00088634 ETH $1.66
Gas Used:
88,634 Gas / 10 Gwei

Emitted Events:

75 Oraclize.0xb76d0edd90c6a07aa3ff7a222d7f5933e29c6acc660c059c97837f05c4ca1a84( 0xb76d0edd90c6a07aa3ff7a222d7f5933e29c6acc660c059c97837f05c4ca1a84, 0000000000000000000000009276096a81159eff8aac815d2578aece98cd7053, 8708365411f626103199d2420eb76217a46dc8279d95e5ba349c2cdf267fe50e, 0000000000000000000000000000000000000000000000000000000000000e10, 0000000000000000000000000000000000000000000000000000000000000100, 0000000000000000000000000000000000000000000000000000000000000140, 000000000000000000000000000000000000000000000000000000000001c138, 4100000000000000000000000000000000000000000000000000000000000000, 00000000000000000000000000000000000000000000000000000002540be400, 0000000000000000000000000000000000000000000000000000000000000003, 55524c0000000000000000000000000000000000000000000000000000000000, 0000000000000000000000000000000000000000000000000000000000000048, 6a736f6e2868747470733a2f2f6170692e636f696e6d61726b65746361702e63, 6f6d2f76322f7469636b65722f31303237292e646174612e71756f7465732e55, 53442e7072696365000000000000000000000000000000000000000000000000 )

Account State Difference:

  Address   Before After State Difference Code
0x00004242...29183b109
0.28460169 Eth
Nonce: 2100
0.28371535 Eth
Nonce: 2101
0.00088634
0x3dBDc81a...e395fDcf6 14.53268483398451864 Eth14.53383483398451864 Eth0.00115
(Spark Pool)
3,995.211375062733392207 Eth3,995.212261402733392207 Eth0.00088634
0x9276096a...E98Cd7053 1.65365 Eth1.6525 Eth0.00115

Execution Trace

Reoraclizer.__callback( _myid=D7F472C804902AE073A45F015C7BFCE5A270EE2E1DAFD8206CAA301E03918D14, _result=219.927577366, _proof=0x1220A0F669ED12653B169A72F930BDE0A5A9A0665655A3EB9B9A2B7760E539E1CEC7 )
  • OraclizeAddrResolver.CALL( )
  • Oraclize.CALL( )
  • OraclizeAddrResolver.CALL( )
  • Oraclize.2ef3accc( )
  • ETH 0.00115 Oraclize.c51be90f( )
    File 1 of 3: Reoraclizer
    pragma solidity 0.4.24;
    
    
    contract OraclizeI {
    
        address public cbAddress;
        function setProofType(byte _proofType) external;
    
        function setCustomGasPrice(uint _gasPrice) external;
    
        function getPrice(string _datasource, uint gaslimit) public returns (uint _dsprice);
        function query_withGasLimit(uint _timestamp, string _datasource, string _arg, uint _gaslimit) external payable returns (bytes32 _id);
    
        function query(uint _timestamp, string _datasource, string _arg)
            external
            payable
            returns (bytes32 _id);
    
        function getPrice(string _datasource) public returns (uint _dsprice);
    }
    
    
    contract OraclizeAddrResolverI {
        function getAddress() public returns (address _addr);
    }
    
    
    contract UsingOraclize {
    
        byte constant internal proofType_Ledger = 0x30;
        byte constant internal proofType_Android = 0x40;
        byte constant internal proofStorage_IPFS = 0x01;
        uint8 constant internal networkID_auto = 0;
        uint8 constant internal networkID_mainnet = 1;
        uint8 constant internal networkID_testnet = 2;
    
        OraclizeAddrResolverI OAR;
    
        OraclizeI oraclize;
    
        modifier oraclizeAPI {
            if ((address(OAR) == 0)||(getCodeSize(address(OAR)) == 0))
                oraclize_setNetwork(networkID_auto);
    
            if (address(oraclize) != OAR.getAddress())
                oraclize = OraclizeI(OAR.getAddress());
    
            _;
        }
    
        function oraclize_setNetwork(uint8 networkID) internal returns(bool) {
            return oraclize_setNetwork();
            /* solium-disable-next-line */
            networkID; // silence the warning and remain backwards compatible
        }
    
        function oraclize_setNetwork() internal returns(bool){
            if (getCodeSize(0x1d3B2638a7cC9f2CB3D298A3DA7a90B67E5506ed) > 0){ //mainnet
                OAR = OraclizeAddrResolverI(0x1d3B2638a7cC9f2CB3D298A3DA7a90B67E5506ed);
                oraclize_setNetworkName("eth_mainnet");
                return true;
            }
            if (getCodeSize(0xc03A2615D5efaf5F49F60B7BB6583eaec212fdf1)>0){ //ropsten testnet
                OAR = OraclizeAddrResolverI(0xc03A2615D5efaf5F49F60B7BB6583eaec212fdf1);
                oraclize_setNetworkName("eth_ropsten3");
                return true;
            }
            if (getCodeSize(0xB7A07BcF2Ba2f2703b24C0691b5278999C59AC7e) > 0){ //kovan testnet
                OAR = OraclizeAddrResolverI(0xB7A07BcF2Ba2f2703b24C0691b5278999C59AC7e);
                oraclize_setNetworkName("eth_kovan");
                return true;
            }
            if (getCodeSize(0x146500cfd35B22E4A392Fe0aDc06De1a1368Ed48)>0){ //rinkeby testnet
                OAR = OraclizeAddrResolverI(0x146500cfd35B22E4A392Fe0aDc06De1a1368Ed48);
                oraclize_setNetworkName("eth_rinkeby");
                return true;
            }
            if (getCodeSize(0x51efaF4c8B3C9AfBD5aB9F4bbC82784Ab6ef8fAA)>0){ //browser-solidity
                OAR = OraclizeAddrResolverI(0x51efaF4c8B3C9AfBD5aB9F4bbC82784Ab6ef8fAA);
                return true;
            }
            return false;
        }
    
        function oraclize_getPrice(string datasource) oraclizeAPI internal returns (uint){
            return oraclize.getPrice(datasource);
        }
    
        function oraclize_getPrice(string datasource, uint gaslimit) oraclizeAPI internal returns (uint){
            return oraclize.getPrice(datasource, gaslimit);
        }
    
        function oraclize_query(string datasource, string arg) oraclizeAPI internal returns (bytes32 id){
            uint price = oraclize.getPrice(datasource);
            if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price
            return oraclize.query.value(price)(0, datasource, arg);
        }
    
        function oraclize_query(uint timestamp, string datasource, string arg, uint gaslimit) oraclizeAPI internal returns (bytes32 id){
            uint price = oraclize.getPrice(datasource, gaslimit);
            if (price > 1 ether + tx.gasprice*gaslimit) return 0; // unexpectedly high price
            return oraclize.query_withGasLimit.value(price)(timestamp, datasource, arg, gaslimit);
        }
    
        function oraclize_query(uint timestamp, string datasource, string arg)
            oraclizeAPI
            internal
            returns (bytes32 id)
        {
            uint price = oraclize.getPrice(datasource);
            if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price
            return oraclize.query.value(price)(timestamp, datasource, arg);
        }
    
        function oraclize_cbAddress() internal oraclizeAPI returns (address) {
            return oraclize.cbAddress();
        }
    
        function oraclize_setProof(byte proofP) internal oraclizeAPI {
            return oraclize.setProofType(proofP);
        }
    
        function oraclize_setCustomGasPrice(uint gasPrice) oraclizeAPI internal {
            return oraclize.setCustomGasPrice(gasPrice);
        }
    
        function getCodeSize(address _addr) internal view returns(uint _size) {
            /* solium-disable-next-line */
            assembly {
                _size := extcodesize(_addr)
            }
        }
    
        /* solium-disable-next-line */ // parseInt(parseFloat*10^_b)
        function parseInt(string _a, uint _b) internal pure 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;
            }
            if (_b > 0) mint *= 10**_b;
            return mint;
        }
    
        string public oraclize_network_name;
    
        function oraclize_setNetworkName(string _networkName) internal {
            oraclize_network_name = _networkName;
        }
    
    }
    
    
    /**
     * @title SafeMath
     * @dev Math operations with safety checks that throw on error
     */
    library SafeMath {
    
        /**
        * @dev Multiplies two numbers, throws on overflow.
        */
        function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
            // Gas optimization: this is cheaper than asserting 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
            if (a == 0) {
                return 0;
            }
    
            c = a * b;
            assert(c / a == b);
            return c;
        }
    
        /**
        * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
        */
        function sub(uint256 a, uint256 b) internal pure returns (uint256) {
            assert(b <= a);
            return a - b;
        }
    
        /**
        * @dev Adds two numbers, throws on overflow.
        */
        function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
            c = a + b;
            assert(c >= a);
            return c;
        }
    
        function pow(uint256 a, uint256 power) internal pure returns (uint256 result) {
            assert(a >= 0);
            result = 1;
            for (uint256 i = 0; i < power; i++) {
                result *= a;
                assert(result >= a);
            }
        }
    }
    
    
    /**
     * @title Ownable
     * @dev The Ownable contract has an owner address, and provides basic authorization control
     * functions, this simplifies the implementation of "user permissions".
     */
    contract Ownable {
    
        address public owner;
        address public pendingOwner;
    
        event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
    
        /**
        * @dev Throws if called by any account other than the owner.
        */
        modifier onlyOwner() {
            require(msg.sender == owner);
            _;
        }
    
        /**
        * @dev Modifier throws if called by any account other than the pendingOwner.
        */
        modifier onlyPendingOwner() {
            require(msg.sender == pendingOwner);
            _;
        }
    
        constructor() public {
            owner = msg.sender;
        }
    
        /**
        * @dev Allows the current owner to set the pendingOwner address.
        * @param newOwner The address to transfer ownership to.
        */
        function transferOwnership(address newOwner) public onlyOwner {
            pendingOwner = newOwner;
        }
    
        /**
        * @dev Allows the pendingOwner address to finalize the transfer.
        */
        function claimOwnership() public onlyPendingOwner {
            emit OwnershipTransferred(owner, pendingOwner);
            owner = pendingOwner;
            pendingOwner = address(0);
        }
    }
    
    
    /**
     * @title Whitelist
     * @dev The Whitelist contract has a whitelist of addresses, and provides basic authorization control functions.
     * @dev This simplifies the implementation of "user permissions".
     */
    contract Accessable is Ownable {
    
        uint256 public billingPeriod = 28 days;
    
        uint256 public oneTimePrice = 200 szabo;
    
        uint256 public billingAmount = 144 finney;
    
        mapping(address => uint256) public access;
    
        event AccessGranted(address addr, uint256 expired);
    
        /**
         * @dev Throws if called by any account that's not whitelisted.
         */
        modifier onlyPayed() {
            require(access[msg.sender] > now || msg.value == oneTimePrice);
            _;
        }
    
        function () external payable {
            processPurchase(msg.sender);
        }
    
        //we need to increase the price when the network is under heavy load
        function setOneTimePrice(uint256 _priceInWei) external onlyOwner {
            require(_priceInWei < 2000 szabo);
            oneTimePrice = _priceInWei;
        }
    
        function setbillingAmount(uint256 _priceInWei) external onlyOwner {
            require(_priceInWei < oneTimePrice * 24 * billingPeriod);
            billingAmount = _priceInWei;
        }
    
        function hasAccess(address _who) external returns(bool) {
            return access[_who] > now;
        }
    
        function processPurchase(address _beneficiary) public payable {
            require(_beneficiary != address(0));
            uint256 _units = msg.value / billingAmount;
            require(_units > 0);
            uint256 _remainder = msg.value % billingAmount;
            _beneficiary.transfer(_remainder);
            grantAccess(_beneficiary, _units);
        }
    
        /**
         * @dev add an address to the whitelist
         */
        function grantAccess(address _addr, uint256 _periods) internal {
            uint256 _accessExpTime;
            if (access[_addr] < now) {
                _accessExpTime = now + billingPeriod * _periods;
            } else {
                _accessExpTime = _accessExpTime + billingPeriod * _periods;
            }
            access[_addr] = _accessExpTime;
            emit AccessGranted(_addr, _accessExpTime);
        }
    }
    
    
    contract Reoraclizer is UsingOraclize, Accessable {
        using SafeMath for uint256;
    
        uint256 public lastTimeUpdate;
        uint256 minUpdatePeriod = 3300; // min update period
    
        string internal response; //price in cents
    
        uint256 internal CALLBACK_GAS_LIMIT = 115000;
    
        // will rewritten after deploying
        // needs to prevent high gas price at first oraclize response
        uint256 internal price = 999999;
    
        event NewOraclizeQuery(string description);
    
        constructor() public {
            oraclize_setProof(proofType_Android | proofStorage_IPFS);
            oraclize_setCustomGasPrice(10000000000);
        }
    
        /**
        * @dev Receives the response from oraclize.
        */
        function __callback(bytes32 _myid, string _result, bytes _proof) public {
            require((lastTimeUpdate + minUpdatePeriod) < now);
            if (msg.sender != oraclize_cbAddress()) revert();
    
            price = parseInt(_result, 4);
            lastTimeUpdate = now;
    
            _update(3600);
        }
    
        function getEthUsdPrice() external onlyPayed payable returns(uint256) {
            return price;
        }
    
        /**
         * @dev Cyclic query to update ETHUSD price. Period is one hour.
         */
        function _update(uint256 _timeout) internal {
            oraclize_query(_timeout, "URL", "json(https://api.coinmarketcap.com/v2/ticker/1027).data.quotes.USD.price", CALLBACK_GAS_LIMIT);
        }
    
        function update(uint256 _timeout) public payable onlyOwner {
            _update(_timeout);
        }
    
        function setOraclizeGasLimit (uint256 _gasLimit) external onlyOwner {
            CALLBACK_GAS_LIMIT = _gasLimit;
        }
    
        function setGasPrice(uint256 _gasPrice) external onlyOwner {
            oraclize_setCustomGasPrice(_gasPrice);
        }
    
        function withdrawEth(uint256 _value) external onlyOwner {
            require(address(this).balance > _value.add(3 ether));
            owner.transfer(_value);
        }
    
        function setMinUpdatePeriod(uint256 _minUpdatePeriod) external onlyOwner {
            minUpdatePeriod = _minUpdatePeriod;
        }
    }

    File 2 of 3: Oraclize
    /*
    Copyright (c) 2015-2016 Oraclize SRL
    Copyright (c) 2016-2017 Oraclize LTD
    */
    
    /*
    Oraclize Connector v1.2.0
    */
    
    // 'compressed' alternative, where all modifiers have been changed to FUNCTIONS
    // which is cheaper for deployment, potentially cheaper execution
    
    pragma solidity ^0.4.11;
    
    contract Oraclize {
        mapping (address => uint) reqc;
    
        mapping (address => byte) public cbAddresses;
    
        mapping (address => bool) public offchainPayment;
    
        event Log1(address sender, bytes32 cid, uint timestamp, string datasource, string arg, uint gaslimit, byte proofType, uint gasPrice);
        event Log2(address sender, bytes32 cid, uint timestamp, string datasource, string arg1, string arg2, uint gaslimit, byte proofType, uint gasPrice);
        event LogN(address sender, bytes32 cid, uint timestamp, string datasource, bytes args, uint gaslimit, byte proofType, uint gasPrice);
        event Log1_fnc(address sender, bytes32 cid, uint timestamp, string datasource, string arg, function() external callback, uint gaslimit, byte proofType, uint gasPrice);
        event Log2_fnc(address sender, bytes32 cid, uint timestamp, string datasource, string arg1, string arg2, function() external callback, uint gaslimit, byte proofType, uint gasPrice);
        event LogN_fnc(address sender, bytes32 cid, uint timestamp, string datasource, bytes args, function() external callback, uint gaslimit, byte proofType, uint gasPrice);
    
        event Emit_OffchainPaymentFlag(address indexed idx_sender, address sender, bool indexed idx_flag, bool flag);
    
        address owner;
        address paymentFlagger;
    
        function changeAdmin(address _newAdmin)
        external
        {
            onlyadmin();
            owner = _newAdmin;
        }
    
        function changePaymentFlagger(address _newFlagger)
        external
        {
            onlyadmin();
            paymentFlagger = _newFlagger;
        }
    
        function addCbAddress(address newCbAddress, byte addressType)
        external
        {
            onlyadmin();
            //bytes memory nil = '';
            addCbAddress(newCbAddress, addressType, hex'');
        }
    
        // proof is currently a placeholder for when associated proof for addressType is added
        function addCbAddress(address newCbAddress, byte addressType, bytes proof)
        public
        {
            onlyadmin();
            cbAddresses[newCbAddress] = addressType;
        }
    
        function removeCbAddress(address newCbAddress)
        external
        {
            onlyadmin();
            delete cbAddresses[newCbAddress];
        }
    
        function cbAddress()
        constant
        returns (address _cbAddress)
        {
            if (cbAddresses[tx.origin] != 0)
                _cbAddress = tx.origin;
        }
    
        function addDSource(string dsname, uint multiplier)
        external
        {
            addDSource(dsname, 0x00, multiplier);
        }
    
        function addDSource(string dsname, byte proofType, uint multiplier)
        public
        {
            onlyadmin();
            bytes32 dsname_hash = sha3(dsname, proofType);
            dsources[dsources.length++] = dsname_hash;
            price_multiplier[dsname_hash] = multiplier;
        }
    
        // Utilized by bridge
        function multiAddDSource(bytes32[] dsHash, uint256[] multiplier)
        external
        {
            onlyadmin();
            // dsHash -> sha3(DATASOURCE_NAME, PROOF_TYPE);
            for (uint i=0; i<dsHash.length; i++) {
                dsources[dsources.length++] = dsHash[i];
                price_multiplier[dsHash[i]] = multiplier[i];
            }
        }
    
        function multisetProofType(uint[] _proofType, address[] _addr)
        external
        {
            onlyadmin();
            for (uint i=0; i<_addr.length; i++) addr_proofType[_addr[i]] = byte(_proofType[i]);
        }
    
        function multisetCustomGasPrice(uint[] _gasPrice, address[] _addr)
        external
        {
            onlyadmin();
            for (uint i=0; i<_addr.length; i++) addr_gasPrice[_addr[i]] = _gasPrice[i];
        }
    
        uint gasprice = 20000000000;
    
        function setGasPrice(uint newgasprice)
        external
        {
            onlyadmin();
            gasprice = newgasprice;
        }
    
        function setBasePrice(uint new_baseprice)
        external
        { //0.001 usd in ether
            onlyadmin();
            baseprice = new_baseprice;
            for (uint i=0; i<dsources.length; i++) price[dsources[i]] = new_baseprice*price_multiplier[dsources[i]];
        }
    
        function setBasePrice(uint new_baseprice, bytes proofID)
        external
        { //0.001 usd in ether
            onlyadmin();
            baseprice = new_baseprice;
            for (uint i=0; i<dsources.length; i++) price[dsources[i]] = new_baseprice*price_multiplier[dsources[i]];
        }
    
        function setOffchainPayment(address _addr, bool _flag)
        external
        {
          if (msg.sender != paymentFlagger) throw;
          offchainPayment[_addr] = _flag;
          Emit_OffchainPaymentFlag(_addr, _addr, _flag, _flag);
        }
    
        function withdrawFunds(address _addr)
        external
        {
            onlyadmin();
            _addr.send(this.balance);
        }
    
        // unnecessary?
        //function() {}
    
        function Oraclize() {
            owner = msg.sender;
        }
    
        // Pesudo-modifiers
    
        function onlyadmin()
        private {
            if (msg.sender != owner) throw;
        }
    
        function costs(string datasource, uint gaslimit)
        private
        returns (uint price) {
            price = getPrice(datasource, gaslimit, msg.sender);
    
            if (msg.value >= price){
                uint diff = msg.value - price;
                if (diff > 0) {
                    // added for correct query cost to be returned
                    if(!msg.sender.send(diff)) {
                        throw;
                    }
                }
            } else throw;
        }
    
        mapping (address => byte) addr_proofType;
        mapping (address => uint) addr_gasPrice;
        uint public baseprice;
        mapping (bytes32 => uint) price;
        mapping (bytes32 => uint) price_multiplier;
        bytes32[] dsources;
    
        bytes32[] public randomDS_sessionPubKeysHash;
    
        function randomDS_updateSessionPubKeysHash(bytes32[] _newSessionPubKeysHash)
        external
        {
            onlyadmin();
            randomDS_sessionPubKeysHash.length = 0;
            for (uint i=0; i<_newSessionPubKeysHash.length; i++) randomDS_sessionPubKeysHash.push(_newSessionPubKeysHash[i]);
        }
    
        function randomDS_getSessionPubKeyHash()
        external
        constant
        returns (bytes32) {
            uint i = uint(sha3(reqc[msg.sender]))%randomDS_sessionPubKeysHash.length;
            return randomDS_sessionPubKeysHash[i];
        }
    
        function setProofType(byte _proofType)
        external
        {
            addr_proofType[msg.sender] = _proofType;
        }
    
        function setCustomGasPrice(uint _gasPrice)
        external
        {
            addr_gasPrice[msg.sender] = _gasPrice;
        }
    
        function getPrice(string _datasource)
        public
        returns (uint _dsprice)
        {
            return getPrice(_datasource, msg.sender);
        }
    
        function getPrice(string _datasource, uint _gaslimit)
        public
        returns (uint _dsprice)
        {
            return getPrice(_datasource, _gaslimit, msg.sender);
        }
    
        function getPrice(string _datasource, address _addr)
        private
        returns (uint _dsprice)
        {
            return getPrice(_datasource, 200000, _addr);
        }
    
        function getPrice(string _datasource, uint _gaslimit, address _addr)
        private
        returns (uint _dsprice)
        {
            uint gasprice_ = addr_gasPrice[_addr];
            if (
                    (offchainPayment[_addr])
                ||(
                    (_gaslimit <= 200000)&&
                    (reqc[_addr] == 0)&&
                    (gasprice_ <= gasprice)&&
                    (tx.origin != cbAddress())
                )
            ) return 0;
    
            if (gasprice_ == 0) gasprice_ = gasprice;
            _dsprice = price[sha3(_datasource, addr_proofType[_addr])];
            _dsprice += _gaslimit*gasprice_;
            return _dsprice;
        }
    
        function getCodeSize(address _addr)
        private
        constant
        returns(uint _size)
        {
            assembly {
                _size := extcodesize(_addr)
            }
        }
    
        function query(string _datasource, string _arg)
        payable
        external
        returns (bytes32 _id)
        {
            return query1(0, _datasource, _arg, 200000);
        }
    
        function query1(string _datasource, string _arg)
        payable
        external
        returns (bytes32 _id)
        {
            return query1(0, _datasource, _arg, 200000);
        }
    
        function query2(string _datasource, string _arg1, string _arg2)
        payable
        external
        returns (bytes32 _id)
        {
            return query2(0, _datasource, _arg1, _arg2, 200000);
        }
    
        function queryN(string _datasource, bytes _args)
        payable
        external
        returns (bytes32 _id)
        {
            return queryN(0, _datasource, _args, 200000);
        }
    
        function query(uint _timestamp, string _datasource, string _arg)
        payable
        external
        returns (bytes32 _id)
        {
            return query1(_timestamp, _datasource, _arg, 200000);
        }
    
        function query1(uint _timestamp, string _datasource, string _arg)
        payable
        external
        returns (bytes32 _id)
        {
            return query1(_timestamp, _datasource, _arg, 200000);
        }
    
        function query2(uint _timestamp, string _datasource, string _arg1, string _arg2)
        payable
        external
        returns (bytes32 _id)
        {
            return query2(_timestamp, _datasource, _arg1, _arg2, 200000);
        }
    
        function queryN(uint _timestamp, string _datasource, bytes _args)
        payable
        external
        returns (bytes32 _id)
        {
            return queryN(_timestamp, _datasource, _args, 200000);
        }
    
    /*  Needless?
        function query(uint _timestamp, string _datasource, string _arg, uint _gaslimit)
        payable
        external
        returns (bytes32 _id)
        {
            return query1(_timestamp, _datasource, _arg, _gaslimit);
        }
    */
        function query_withGasLimit(uint _timestamp, string _datasource, string _arg, uint _gaslimit)
        payable
        external
        returns (bytes32 _id)
        {
            return query1(_timestamp, _datasource, _arg, _gaslimit);
        }
    
        function query1_withGasLimit(uint _timestamp, string _datasource, string _arg, uint _gaslimit)
        payable
        external
        returns (bytes32 _id)
        {
            return query1(_timestamp, _datasource, _arg, _gaslimit);
        }
    
        function query2_withGasLimit(uint _timestamp, string _datasource, string _arg1, string _arg2, uint _gaslimit)
        payable
        external
        returns (bytes32 _id)
        {
            return query2(_timestamp, _datasource, _arg1, _arg2, _gaslimit);
        }
    
        function queryN_withGasLimit(uint _timestamp, string _datasource, bytes _args, uint _gaslimit)
        payable
        external
        returns (bytes32 _id)
        {
            return queryN(_timestamp, _datasource, _args, _gaslimit);
        }
    
        function query1(uint _timestamp, string _datasource, string _arg, uint _gaslimit)
        payable
        public
        returns (bytes32 _id)
        {
            costs(_datasource, _gaslimit);
        	if ((_timestamp > now+3600*24*60)||(_gaslimit > block.gaslimit)) throw;
    
            _id = sha3(this, msg.sender, reqc[msg.sender]);
            reqc[msg.sender]++;
            Log1(msg.sender, _id, _timestamp, _datasource, _arg, _gaslimit, addr_proofType[msg.sender], addr_gasPrice[msg.sender]);
            return _id;
        }
    
        function query2(uint _timestamp, string _datasource, string _arg1, string _arg2, uint _gaslimit)
        payable
        public
        returns (bytes32 _id)
        {
            costs(_datasource, _gaslimit);
        	if ((_timestamp > now+3600*24*60)||(_gaslimit > block.gaslimit)) throw;
    
            _id = sha3(this, msg.sender, reqc[msg.sender]);
            reqc[msg.sender]++;
            Log2(msg.sender, _id, _timestamp, _datasource, _arg1, _arg2, _gaslimit, addr_proofType[msg.sender], addr_gasPrice[msg.sender]);
            return _id;
        }
    
        function queryN(uint _timestamp, string _datasource, bytes _args, uint _gaslimit)
        payable
        public
        returns (bytes32 _id)
        {
            costs(_datasource, _gaslimit);
        	if ((_timestamp > now+3600*24*60)||(_gaslimit > block.gaslimit)) throw;
    
            _id = sha3(this, msg.sender, reqc[msg.sender]);
            reqc[msg.sender]++;
            LogN(msg.sender, _id, _timestamp, _datasource, _args, _gaslimit, addr_proofType[msg.sender], addr_gasPrice[msg.sender]);
            return _id;
        }
    
        function query1_fnc(uint _timestamp, string _datasource, string _arg, function() external _fnc, uint _gaslimit)
        payable
        public
        returns (bytes32 _id)
        {
            costs(_datasource, _gaslimit);
            if ((_timestamp > now+3600*24*60)||(_gaslimit > block.gaslimit)||address(_fnc) != msg.sender) throw;
    
            _id = sha3(this, msg.sender, reqc[msg.sender]);
            reqc[msg.sender]++;
            Log1_fnc(msg.sender, _id, _timestamp, _datasource, _arg, _fnc, _gaslimit, addr_proofType[msg.sender], addr_gasPrice[msg.sender]);
            return _id;
        }
    
        function query2_fnc(uint _timestamp, string _datasource, string _arg1, string _arg2, function() external _fnc, uint _gaslimit)
        payable
        public
        returns (bytes32 _id)
        {
            costs(_datasource, _gaslimit);
            if ((_timestamp > now+3600*24*60)||(_gaslimit > block.gaslimit)||address(_fnc) != msg.sender) throw;
    
            _id = sha3(this, msg.sender, reqc[msg.sender]);
            reqc[msg.sender]++;
            Log2_fnc(msg.sender, _id, _timestamp, _datasource, _arg1, _arg2, _fnc,  _gaslimit, addr_proofType[msg.sender], addr_gasPrice[msg.sender]);
            return _id;
        }
    
        function queryN_fnc(uint _timestamp, string _datasource, bytes _args, function() external _fnc, uint _gaslimit)
        payable
        public
        returns (bytes32 _id)
        {
            costs(_datasource, _gaslimit);
            if ((_timestamp > now+3600*24*60)||(_gaslimit > block.gaslimit)||address(_fnc) != msg.sender) throw;
    
            _id = sha3(this, msg.sender, reqc[msg.sender]);
            reqc[msg.sender]++;
            LogN_fnc(msg.sender, _id, _timestamp, _datasource, _args, _fnc, _gaslimit, addr_proofType[msg.sender], addr_gasPrice[msg.sender]);
            return _id;
        }
    }

    File 3 of 3: OraclizeAddrResolver
    /*
      Copyright (c) 2015-2016 Oraclize SRL
      Copyright (c) 2016 Oraclize LTD
    */
    
    contract OraclizeAddrResolver {
    
        address public addr;
    
        address owner;
    
        function OraclizeAddrResolver(){
            owner = msg.sender;
        }
    
        function changeOwner(address newowner){
            if (msg.sender != owner) throw;
            owner = newowner;
        }
    
        function getAddress() returns (address oaddr){
            return addr;
        }
    
        function setAddr(address newaddr){
            if (msg.sender != owner) throw;
            addr = newaddr;
        }
    
    }