Contract 0xbbbe9aebf16a729228f06b2f83d82366bcfc80c0

Contract Overview

Balance:
1.807566816712005046 Ether
TxHash Block Age From To Value [TxFee]
0x4cb56d1638eb0fba7cb7776f1c206af11bf21d076cde5c6c27e4c9abedb246ac523539113 hrs 7 mins ago0xdc8f20170c0946accf9627b3eb1513cfd1c0499f IN  0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00 Ether0.01768664
0x5abd325ec3e2e54f34d0cecf73cfd891d70eeddf4eec84247ce1c5f79eb785eb523539113 hrs 7 mins ago0xdc8f20170c0946accf9627b3eb1513cfd1c0499f IN  0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00 Ether0.00083926
0x8e2031b474255e9576364c1c21c3168f10e442c83b98c53cf4b47f871fd8d68a52286731 day 13 hrs ago0xdc8f20170c0946accf9627b3eb1513cfd1c0499f IN  0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00 Ether0.00083926
0x040dc675ffcbdf95d4074fc28df5b7abe51cfa8a5057cf103fdfda8684205fe252286731 day 13 hrs ago0xdc8f20170c0946accf9627b3eb1513cfd1c0499f IN  0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00 Ether0.01768744
0x80be915350e8fffda876ce4221ed0d61080119edcfc51b8309389a79338c738d52217222 days 13 hrs ago0xdc8f20170c0946accf9627b3eb1513cfd1c0499f IN  0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00 Ether0.01768544
0x3fc27d4204151a370604a06b28146a098ed389abc8892c26c471b82f2410995352217222 days 13 hrs ago0xdc8f20170c0946accf9627b3eb1513cfd1c0499f IN  0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00 Ether0.00083926
0xeada76cc52f93db2b7a8f8a3f8579ef62757c1e443eff33fb76a4f7831ac472252152073 days 13 hrs ago0xdc8f20170c0946accf9627b3eb1513cfd1c0499f IN  0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00 Ether0.01768664
0x87706debff8b7bcdea005c0a0d48205ceb0177b6f860e36c75b7bdd35cf701cc52152073 days 13 hrs ago0xdc8f20170c0946accf9627b3eb1513cfd1c0499f IN  0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00 Ether0.00083926
0xfe926ff70f46ba65c5321b154b05e33526ba195dd2d3c1c7e479f7d69d65756652094324 days 13 hrs ago0xdc8f20170c0946accf9627b3eb1513cfd1c0499f IN  0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00 Ether0.00083926
0xac892c5b3141c6150615dd1e9e53f6cda3c26513bfaa2a568fd34ae314c6c84f52094324 days 13 hrs ago0xdc8f20170c0946accf9627b3eb1513cfd1c0499f IN  0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00 Ether0.01768704
0xfc3398c33abcd891d37e22f4e841c2b91f5e307fd56fab9b96586ac3976bbc0b52024485 days 13 hrs ago0xdc8f20170c0946accf9627b3eb1513cfd1c0499f IN  0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00 Ether0.01768664
0x93f3924d4a95a46df21f88bd9699e3114c99534b67195a2766cb48b69bea3a9152024485 days 13 hrs ago0xdc8f20170c0946accf9627b3eb1513cfd1c0499f IN  0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00 Ether0.00083926
0xb601eef91e1ae72d0113fff138698edf86afaf813c31bd3a3f97657f84e7c0ce51957396 days 13 hrs ago0xdc8f20170c0946accf9627b3eb1513cfd1c0499f IN  0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00 Ether0.00083926
0x576148cf3d8c29f4efb50f9bc913518f85a7ffa4c0c7e701dbf2297372dba7d251955996 days 13 hrs ago0xe0045fe2149ce41f77027b895716150ab026d09a IN  0xbbbe9aebf16a729228f06b2f83d82366bcfc80c02 Ether0.0002104
0x58e8e4061c6fcdb03c9db589cf4373d4361e6fcfd9750cf8d3a25c756e016de451876057 days 20 hrs ago0xdc8f20170c0946accf9627b3eb1513cfd1c0499f IN  0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00 Ether0.00710948
0xc07fcbe045ccd50db67c156f5f419438158717900d2287a4039ba148a4e9d32951831158 days 13 hrs ago0xdc8f20170c0946accf9627b3eb1513cfd1c0499f IN  0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00 Ether0.00753602
0xd93f9c06e460d58c6d76ed87522825ba1764d9c3e8412ea04b0a076c177c169f51829888 days 13 hrs ago0xdc8f20170c0946accf9627b3eb1513cfd1c0499f IN  0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00 Ether0.00751608
0x0742094a7846d274198d7499112c8544b5498335ef6d79651178a0ce717ffd1e51819128 days 17 hrs ago0xdc8f20170c0946accf9627b3eb1513cfd1c0499f IN  0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00 Ether0.0074698
0xe83462157f3d2d623a98c9dabe4096516b7d039559b42415168b41841727bda551817468 days 17 hrs ago0xdc8f20170c0946accf9627b3eb1513cfd1c0499f IN  0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00 Ether0.00083926
0xf26fbb3ca9db85e9af428bfcf36cc205e0e94c43028e270ba45c64a25eb1a26651817428 days 17 hrs ago0xdc8f20170c0946accf9627b3eb1513cfd1c0499f IN  0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00 Ether0.01779468
0x43206ebeb3d70ff31dc2ae5f6c028db4b7b2a7c973b36270c54167090ab63dd151811028 days 20 hrs ago0xdc8f20170c0946accf9627b3eb1513cfd1c0499f IN  0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00 Ether0.00060454
0x908724e1ab58894b08801c236b176d59369e3bab84c8f6da8abd320ce13cf2c951810978 days 20 hrs ago0xdc8f20170c0946accf9627b3eb1513cfd1c0499f IN  0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00 Ether0.0173828
0xeb82a817b478edd668786fda1cc291e26467a2822a6e8e0ee490789e0f34e5c351809098 days 21 hrs ago0xdc8f20170c0946accf9627b3eb1513cfd1c0499f IN  0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00 Ether0.00081612
0xb7e9c13898083041c7ffec08f5706eddc98feed1fbaf06e8836393d6bc3760d351809048 days 21 hrs ago0xdc8f20170c0946accf9627b3eb1513cfd1c0499f IN  0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00 Ether0.01774416
0xeb4af943c5bc677558a9b10dffbfafd538c9986ac913bb123f0e2be9fabc3c4651807218 days 21 hrs ago0xdc8f20170c0946accf9627b3eb1513cfd1c0499f IN  0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00 Ether0.00060454
[ Download CSV Export 

Latest 25 internal transaction, Click here to view more Internal Transactions as a result of Contract Execution

Parent TxHash Block Age From To Value
0x4cb56d1638eb0fba7cb7776f1c206af11bf21d076cde5c6c27e4c9abedb246ac523539113 hrs 7 mins ago0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00xcbf1735aad8c4b337903cd44b419efe6538aab400.0200277 Ether
0x4cb56d1638eb0fba7cb7776f1c206af11bf21d076cde5c6c27e4c9abedb246ac523539113 hrs 7 mins ago0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00xcbf1735aad8c4b337903cd44b419efe6538aab400 Ether
0x4cb56d1638eb0fba7cb7776f1c206af11bf21d076cde5c6c27e4c9abedb246ac523539113 hrs 7 mins ago0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00xc03a2615d5efaf5f49f60b7bb6583eaec212fdf10 Ether
0x4cb56d1638eb0fba7cb7776f1c206af11bf21d076cde5c6c27e4c9abedb246ac523539113 hrs 7 mins ago0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00xca1ae670226c20a7026b8a89b040f38366075c1a0 Ether
0x4cb56d1638eb0fba7cb7776f1c206af11bf21d076cde5c6c27e4c9abedb246ac523539113 hrs 7 mins ago0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00xcbf1735aad8c4b337903cd44b419efe6538aab400 Ether
0x4cb56d1638eb0fba7cb7776f1c206af11bf21d076cde5c6c27e4c9abedb246ac523539113 hrs 7 mins ago0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00xc03a2615d5efaf5f49f60b7bb6583eaec212fdf10 Ether
0x4cb56d1638eb0fba7cb7776f1c206af11bf21d076cde5c6c27e4c9abedb246ac523539113 hrs 7 mins ago0xdad3f15f5ca0635b95c74538f9918b4ee46ddb3a0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00 Ether
0x4cb56d1638eb0fba7cb7776f1c206af11bf21d076cde5c6c27e4c9abedb246ac523539113 hrs 7 mins ago0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00xcbf1735aad8c4b337903cd44b419efe6538aab400.0040277 Ether
0x4cb56d1638eb0fba7cb7776f1c206af11bf21d076cde5c6c27e4c9abedb246ac523539113 hrs 7 mins ago0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00xcbf1735aad8c4b337903cd44b419efe6538aab400 Ether
0x4cb56d1638eb0fba7cb7776f1c206af11bf21d076cde5c6c27e4c9abedb246ac523539113 hrs 7 mins ago0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00xc03a2615d5efaf5f49f60b7bb6583eaec212fdf10 Ether
0x4cb56d1638eb0fba7cb7776f1c206af11bf21d076cde5c6c27e4c9abedb246ac523539113 hrs 7 mins ago0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00xca1ae670226c20a7026b8a89b040f38366075c1a0 Ether
0x4cb56d1638eb0fba7cb7776f1c206af11bf21d076cde5c6c27e4c9abedb246ac523539113 hrs 7 mins ago0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00xcbf1735aad8c4b337903cd44b419efe6538aab400 Ether
0x4cb56d1638eb0fba7cb7776f1c206af11bf21d076cde5c6c27e4c9abedb246ac523539113 hrs 7 mins ago0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00xc03a2615d5efaf5f49f60b7bb6583eaec212fdf10 Ether
0x4cb56d1638eb0fba7cb7776f1c206af11bf21d076cde5c6c27e4c9abedb246ac523539113 hrs 7 mins ago0xdad3f15f5ca0635b95c74538f9918b4ee46ddb3a0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00 Ether
0x4cb56d1638eb0fba7cb7776f1c206af11bf21d076cde5c6c27e4c9abedb246ac523539113 hrs 7 mins ago0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00xdad3f15f5ca0635b95c74538f9918b4ee46ddb3a0 Ether
0x4cb56d1638eb0fba7cb7776f1c206af11bf21d076cde5c6c27e4c9abedb246ac523539113 hrs 7 mins ago0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00xcbf1735aad8c4b337903cd44b419efe6538aab400 Ether
0x4cb56d1638eb0fba7cb7776f1c206af11bf21d076cde5c6c27e4c9abedb246ac523539113 hrs 7 mins ago0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00xc03a2615d5efaf5f49f60b7bb6583eaec212fdf10 Ether
0x5abd325ec3e2e54f34d0cecf73cfd891d70eeddf4eec84247ce1c5f79eb785eb523539113 hrs 7 mins ago0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00xdad3f15f5ca0635b95c74538f9918b4ee46ddb3a0 Ether
0x5abd325ec3e2e54f34d0cecf73cfd891d70eeddf4eec84247ce1c5f79eb785eb523539113 hrs 7 mins ago0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00xcbf1735aad8c4b337903cd44b419efe6538aab400 Ether
0x5abd325ec3e2e54f34d0cecf73cfd891d70eeddf4eec84247ce1c5f79eb785eb523539113 hrs 7 mins ago0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00xc03a2615d5efaf5f49f60b7bb6583eaec212fdf10 Ether
0x8e2031b474255e9576364c1c21c3168f10e442c83b98c53cf4b47f871fd8d68a52286731 day 13 hrs ago0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00xdad3f15f5ca0635b95c74538f9918b4ee46ddb3a0 Ether
0x8e2031b474255e9576364c1c21c3168f10e442c83b98c53cf4b47f871fd8d68a52286731 day 13 hrs ago0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00xcbf1735aad8c4b337903cd44b419efe6538aab400 Ether
0x8e2031b474255e9576364c1c21c3168f10e442c83b98c53cf4b47f871fd8d68a52286731 day 13 hrs ago0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00xc03a2615d5efaf5f49f60b7bb6583eaec212fdf10 Ether
0x040dc675ffcbdf95d4074fc28df5b7abe51cfa8a5057cf103fdfda8684205fe252286731 day 13 hrs ago0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00xcbf1735aad8c4b337903cd44b419efe6538aab400.0200277 Ether
0x040dc675ffcbdf95d4074fc28df5b7abe51cfa8a5057cf103fdfda8684205fe252286731 day 13 hrs ago0xbbbe9aebf16a729228f06b2f83d82366bcfc80c00xcbf1735aad8c4b337903cd44b419efe6538aab400 Ether
[ Download CSV Export 
Warning: The compiled contract might be susceptible to ExpExponentCleanup (medium/high-severity), EventStructWrongData (very low-severity) Solidity Compiler Bugs.

Contract Source Code Verified (Exact Match)
Contract Name: Oracle
Compiler Version: v0.4.24+commit.e67f0147
Optimization Enabled: Yes
Runs (Optimizer):  200


Contract Source Code
pragma solidity ^0.4.23;

// File: contracts/oracles/OraclizeAPI.sol

// <ORACLIZE_API>
/*
Copyright (c) 2015-2016 Oraclize SRL
Copyright (c) 2016 Oraclize LTD



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.
*/

// This api is currently targeted at 0.4.18, please import oraclizeAPI_pre0.4.sol or oraclizeAPI_0.4 where necessary
pragma solidity ^0.4.18;

contract OraclizeI {
    address public cbAddress;
    function query(uint _timestamp, string _datasource, string _arg) external payable returns (bytes32 _id);
    function query_withGasLimit(uint _timestamp, string _datasource, string _arg, uint _gaslimit) external payable returns (bytes32 _id);
    function query2(uint _timestamp, string _datasource, string _arg1, string _arg2) public payable returns (bytes32 _id);
    function query2_withGasLimit(uint _timestamp, string _datasource, string _arg1, string _arg2, uint _gaslimit) external payable returns (bytes32 _id);
    function queryN(uint _timestamp, string _datasource, bytes _argN) public payable returns (bytes32 _id);
    function queryN_withGasLimit(uint _timestamp, string _datasource, bytes _argN, uint _gaslimit) external payable returns (bytes32 _id);
    function getPrice(string _datasource) public returns (uint _dsprice);
    function getPrice(string _datasource, uint gaslimit) public returns (uint _dsprice);
    function setProofType(byte _proofType) external;
    function setCustomGasPrice(uint _gasPrice) external;
    function randomDS_getSessionPubKeyHash() external constant returns(bytes32);
}
contract OraclizeAddrResolverI {
    function getAddress() public 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 proofType_Android = 0x20;
    byte constant proofType_Ledger = 0x30;
    byte constant proofType_Native = 0xF0;
    byte constant proofStorage_IPFS = 0x01;
    uint8 constant networkID_auto = 0;
    uint8 constant networkID_mainnet = 1;
    uint8 constant networkID_testnet = 2;
    uint8 constant networkID_morden = 2;
    uint8 constant networkID_consensys = 161;

    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());

        _;
    }
    modifier coupon(string code){
        oraclize = OraclizeI(OAR.getAddress());
        _;
    }

    function oraclize_setNetwork(uint8 networkID) internal returns(bool){
        return oraclize_setNetwork();
        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(0x6f485C8BF6fc43eA212E93BBF8ce046C7f1cb475)>0){ //ethereum-bridge
            OAR = OraclizeAddrResolverI(0x6f485C8BF6fc43eA212E93BBF8ce046C7f1cb475);
            return true;
        }
        if (getCodeSize(0x20e12A1F859B3FeaE5Fb2A0A32C18F5a65555bBF)>0){ //ether.camp ide
            OAR = OraclizeAddrResolverI(0x20e12A1F859B3FeaE5Fb2A0A32C18F5a65555bBF);
            return true;
        }
        if (getCodeSize(0x51efaF4c8B3C9AfBD5aB9F4bbC82784Ab6ef8fAA)>0){ //browser-solidity
            OAR = OraclizeAddrResolverI(0x51efaF4c8B3C9AfBD5aB9F4bbC82784Ab6ef8fAA);
            return true;
        }
        return false;
    }

//    function __callback(bytes32 myid, string result) public {
//        __callback(myid, result, new bytes(0));
//    }
//    function __callback(bytes32 myid, string result, bytes proof) public {
//        return;
//        myid; result; proof; // Silence compiler warnings
//    }

    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) 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_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(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)(0, datasource, arg, gaslimit);
    }
    function oraclize_query(string datasource, string arg1, string arg2) oraclizeAPI internal returns (bytes32 id){
        uint price = oraclize.getPrice(datasource);
        if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price
        return oraclize.query2.value(price)(0, datasource, arg1, arg2);
    }
    function oraclize_query(uint timestamp, string datasource, string arg1, string arg2) oraclizeAPI internal returns (bytes32 id){
        uint price = oraclize.getPrice(datasource);
        if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price
        return oraclize.query2.value(price)(timestamp, datasource, arg1, arg2);
    }
    function oraclize_query(uint timestamp, string datasource, string arg1, string arg2, 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.query2_withGasLimit.value(price)(timestamp, datasource, arg1, arg2, gaslimit);
    }
    function oraclize_query(string datasource, string arg1, string arg2, 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.query2_withGasLimit.value(price)(0, datasource, arg1, arg2, gaslimit);
    }
    function oraclize_query(string datasource, string[] argN) oraclizeAPI internal returns (bytes32 id){
        uint price = oraclize.getPrice(datasource);
        if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price
        bytes memory args = stra2cbor(argN);
        return oraclize.queryN.value(price)(0, datasource, args);
    }
    function oraclize_query(uint timestamp, string datasource, string[] argN) oraclizeAPI internal returns (bytes32 id){
        uint price = oraclize.getPrice(datasource);
        if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price
        bytes memory args = stra2cbor(argN);
        return oraclize.queryN.value(price)(timestamp, datasource, args);
    }
    function oraclize_query(uint timestamp, string datasource, string[] argN, 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
        bytes memory args = stra2cbor(argN);
        return oraclize.queryN_withGasLimit.value(price)(timestamp, datasource, args, gaslimit);
    }
    function oraclize_query(string datasource, string[] argN, 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
        bytes memory args = stra2cbor(argN);
        return oraclize.queryN_withGasLimit.value(price)(0, datasource, args, gaslimit);
    }
    function oraclize_query(string datasource, string[1] args) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](1);
        dynargs[0] = args[0];
        return oraclize_query(datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, string[1] args) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](1);
        dynargs[0] = args[0];
        return oraclize_query(timestamp, datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, string[1] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](1);
        dynargs[0] = args[0];
        return oraclize_query(timestamp, datasource, dynargs, gaslimit);
    }
    function oraclize_query(string datasource, string[1] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](1);
        dynargs[0] = args[0];
        return oraclize_query(datasource, dynargs, gaslimit);
    }

    function oraclize_query(string datasource, string[2] args) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](2);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        return oraclize_query(datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, string[2] args) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](2);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        return oraclize_query(timestamp, datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, string[2] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](2);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        return oraclize_query(timestamp, datasource, dynargs, gaslimit);
    }
    function oraclize_query(string datasource, string[2] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](2);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        return oraclize_query(datasource, dynargs, gaslimit);
    }
    function oraclize_query(string datasource, string[3] args) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](3);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        return oraclize_query(datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, string[3] args) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](3);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        return oraclize_query(timestamp, datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, string[3] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](3);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        return oraclize_query(timestamp, datasource, dynargs, gaslimit);
    }
    function oraclize_query(string datasource, string[3] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](3);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        return oraclize_query(datasource, dynargs, gaslimit);
    }

    function oraclize_query(string datasource, string[4] args) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](4);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        dynargs[3] = args[3];
        return oraclize_query(datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, string[4] args) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](4);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        dynargs[3] = args[3];
        return oraclize_query(timestamp, datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, string[4] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](4);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        dynargs[3] = args[3];
        return oraclize_query(timestamp, datasource, dynargs, gaslimit);
    }
    function oraclize_query(string datasource, string[4] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](4);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        dynargs[3] = args[3];
        return oraclize_query(datasource, dynargs, gaslimit);
    }
    function oraclize_query(string datasource, string[5] args) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](5);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        dynargs[3] = args[3];
        dynargs[4] = args[4];
        return oraclize_query(datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, string[5] args) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](5);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        dynargs[3] = args[3];
        dynargs[4] = args[4];
        return oraclize_query(timestamp, datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, string[5] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](5);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        dynargs[3] = args[3];
        dynargs[4] = args[4];
        return oraclize_query(timestamp, datasource, dynargs, gaslimit);
    }
    function oraclize_query(string datasource, string[5] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](5);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        dynargs[3] = args[3];
        dynargs[4] = args[4];
        return oraclize_query(datasource, dynargs, gaslimit);
    }
    function oraclize_query(string datasource, bytes[] argN) oraclizeAPI internal returns (bytes32 id){
        uint price = oraclize.getPrice(datasource);
        if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price
        bytes memory args = ba2cbor(argN);
        return oraclize.queryN.value(price)(0, datasource, args);
    }
    function oraclize_query(uint timestamp, string datasource, bytes[] argN) oraclizeAPI internal returns (bytes32 id){
        uint price = oraclize.getPrice(datasource);
        if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price
        bytes memory args = ba2cbor(argN);
        return oraclize.queryN.value(price)(timestamp, datasource, args);
    }
    function oraclize_query(uint timestamp, string datasource, bytes[] argN, 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
        bytes memory args = ba2cbor(argN);
        return oraclize.queryN_withGasLimit.value(price)(timestamp, datasource, args, gaslimit);
    }
    function oraclize_query(string datasource, bytes[] argN, 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
        bytes memory args = ba2cbor(argN);
        return oraclize.queryN_withGasLimit.value(price)(0, datasource, args, gaslimit);
    }
    function oraclize_query(string datasource, bytes[1] args) oraclizeAPI internal returns (bytes32 id) {
        bytes[] memory dynargs = new bytes[](1);
        dynargs[0] = args[0];
        return oraclize_query(datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, bytes[1] args) oraclizeAPI internal returns (bytes32 id) {
        bytes[] memory dynargs = new bytes[](1);
        dynargs[0] = args[0];
        return oraclize_query(timestamp, datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, bytes[1] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        bytes[] memory dynargs = new bytes[](1);
        dynargs[0] = args[0];
        return oraclize_query(timestamp, datasource, dynargs, gaslimit);
    }
    function oraclize_query(string datasource, bytes[1] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        bytes[] memory dynargs = new bytes[](1);
        dynargs[0] = args[0];
        return oraclize_query(datasource, dynargs, gaslimit);
    }

    function oraclize_query(string datasource, bytes[2] args) oraclizeAPI internal returns (bytes32 id) {
        bytes[] memory dynargs = new bytes[](2);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        return oraclize_query(datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, bytes[2] args) oraclizeAPI internal returns (bytes32 id) {
        bytes[] memory dynargs = new bytes[](2);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        return oraclize_query(timestamp, datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, bytes[2] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        bytes[] memory dynargs = new bytes[](2);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        return oraclize_query(timestamp, datasource, dynargs, gaslimit);
    }
    function oraclize_query(string datasource, bytes[2] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        bytes[] memory dynargs = new bytes[](2);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        return oraclize_query(datasource, dynargs, gaslimit);
    }
    function oraclize_query(string datasource, bytes[3] args) oraclizeAPI internal returns (bytes32 id) {
        bytes[] memory dynargs = new bytes[](3);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        return oraclize_query(datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, bytes[3] args) oraclizeAPI internal returns (bytes32 id) {
        bytes[] memory dynargs = new bytes[](3);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        return oraclize_query(timestamp, datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, bytes[3] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        bytes[] memory dynargs = new bytes[](3);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        return oraclize_query(timestamp, datasource, dynargs, gaslimit);
    }
    function oraclize_query(string datasource, bytes[3] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        bytes[] memory dynargs = new bytes[](3);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        return oraclize_query(datasource, dynargs, gaslimit);
    }

    function oraclize_query(string datasource, bytes[4] args) oraclizeAPI internal returns (bytes32 id) {
        bytes[] memory dynargs = new bytes[](4);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        dynargs[3] = args[3];
        return oraclize_query(datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, bytes[4] args) oraclizeAPI internal returns (bytes32 id) {
        bytes[] memory dynargs = new bytes[](4);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        dynargs[3] = args[3];
        return oraclize_query(timestamp, datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, bytes[4] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        bytes[] memory dynargs = new bytes[](4);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        dynargs[3] = args[3];
        return oraclize_query(timestamp, datasource, dynargs, gaslimit);
    }
    function oraclize_query(string datasource, bytes[4] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        bytes[] memory dynargs = new bytes[](4);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        dynargs[3] = args[3];
        return oraclize_query(datasource, dynargs, gaslimit);
    }
    function oraclize_query(string datasource, bytes[5] args) oraclizeAPI internal returns (bytes32 id) {
        bytes[] memory dynargs = new bytes[](5);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        dynargs[3] = args[3];
        dynargs[4] = args[4];
        return oraclize_query(datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, bytes[5] args) oraclizeAPI internal returns (bytes32 id) {
        bytes[] memory dynargs = new bytes[](5);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        dynargs[3] = args[3];
        dynargs[4] = args[4];
        return oraclize_query(timestamp, datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, bytes[5] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        bytes[] memory dynargs = new bytes[](5);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        dynargs[3] = args[3];
        dynargs[4] = args[4];
        return oraclize_query(timestamp, datasource, dynargs, gaslimit);
    }
    function oraclize_query(string datasource, bytes[5] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        bytes[] memory dynargs = new bytes[](5);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        dynargs[3] = args[3];
        dynargs[4] = args[4];
        return oraclize_query(datasource, dynargs, gaslimit);
    }

    function oraclize_cbAddress() oraclizeAPI internal returns (address){
        return oraclize.cbAddress();
    }
    function oraclize_setProof(byte proofP) oraclizeAPI internal {
        return oraclize.setProofType(proofP);
    }
    function oraclize_setCustomGasPrice(uint gasPrice) oraclizeAPI internal {
        return oraclize.setCustomGasPrice(gasPrice);
    }

    function oraclize_randomDS_getSessionPubKeyHash() oraclizeAPI internal returns (bytes32){
        return oraclize.randomDS_getSessionPubKeyHash();
    }

    function getCodeSize(address _addr) constant internal returns(uint _size) {
        assembly {
        _size := extcodesize(_addr)
        }
    }

    function parseAddr(string _a) internal pure 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 >= 65)&&(b1 <= 70)) b1 -= 55;
            else if ((b1 >= 48)&&(b1 <= 57)) b1 -= 48;
            if ((b2 >= 97)&&(b2 <= 102)) b2 -= 87;
            else if ((b2 >= 65)&&(b2 <= 70)) b2 -= 55;
            else if ((b2 >= 48)&&(b2 <= 57)) b2 -= 48;
            iaddr += (b1*16+b2);
        }
        return address(iaddr);
    }

    function strCompare(string _a, string _b) internal pure 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 pure 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, string _c, string _d, string _e) internal pure returns (string) {
        bytes memory _ba = bytes(_a);
        bytes memory _bb = bytes(_b);
        bytes memory _bc = bytes(_c);
        bytes memory _bd = bytes(_d);
        bytes memory _be = bytes(_e);
        string memory abcde = new string(_ba.length + _bb.length + _bc.length + _bd.length + _be.length);
        bytes memory babcde = bytes(abcde);
        uint k = 0;
        for (uint i = 0; i < _ba.length; i++) babcde[k++] = _ba[i];
        for (i = 0; i < _bb.length; i++) babcde[k++] = _bb[i];
        for (i = 0; i < _bc.length; i++) babcde[k++] = _bc[i];
        for (i = 0; i < _bd.length; i++) babcde[k++] = _bd[i];
        for (i = 0; i < _be.length; i++) babcde[k++] = _be[i];
        return string(babcde);
    }

    function strConcat(string _a, string _b, string _c, string _d) internal pure returns (string) {
        return strConcat(_a, _b, _c, _d, "");
    }

    function strConcat(string _a, string _b, string _c) internal pure returns (string) {
        return strConcat(_a, _b, _c, "", "");
    }

    function strConcat(string _a, string _b) internal pure returns (string) {
        return strConcat(_a, _b, "", "", "");
    }

    // parseInt
    function parseInt(string _a) internal pure returns (uint) {
        return parseInt(_a, 0);
    }

    // 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;
    }

    function uint2str(uint i) internal pure returns (string){
        if (i == 0) return "0";
        uint j = i;
        uint len;
        while (j != 0){
            len++;
            j /= 10;
        }
        bytes memory bstr = new bytes(len);
        uint k = len - 1;
        while (i != 0){
            bstr[k--] = byte(48 + i % 10);
            i /= 10;
        }
        return string(bstr);
    }

    function stra2cbor(string[] arr) internal pure returns (bytes) {
        uint arrlen = arr.length;

        // get correct cbor output length
        uint outputlen = 0;
        bytes[] memory elemArray = new bytes[](arrlen);
        for (uint i = 0; i < arrlen; i++) {
            elemArray[i] = (bytes(arr[i]));
            outputlen += elemArray[i].length + (elemArray[i].length - 1)/23 + 3; //+3 accounts for paired identifier types
        }
        uint ctr = 0;
        uint cborlen = arrlen + 0x80;
        outputlen += byte(cborlen).length;
        bytes memory res = new bytes(outputlen);

        while (byte(cborlen).length > ctr) {
            res[ctr] = byte(cborlen)[ctr];
            ctr++;
        }
        for (i = 0; i < arrlen; i++) {
            res[ctr] = 0x5F;
            ctr++;
            for (uint x = 0; x < elemArray[i].length; x++) {
                // if there's a bug with larger strings, this may be the culprit
                if (x % 23 == 0) {
                    uint elemcborlen = elemArray[i].length - x >= 24 ? 23 : elemArray[i].length - x;
                    elemcborlen += 0x40;
                    uint lctr = ctr;
                    while (byte(elemcborlen).length > ctr - lctr) {
                        res[ctr] = byte(elemcborlen)[ctr - lctr];
                        ctr++;
                    }
                }
                res[ctr] = elemArray[i][x];
                ctr++;
            }
            res[ctr] = 0xFF;
            ctr++;
        }
        return res;
    }

    function ba2cbor(bytes[] arr) internal pure returns (bytes) {
        uint arrlen = arr.length;

        // get correct cbor output length
        uint outputlen = 0;
        bytes[] memory elemArray = new bytes[](arrlen);
        for (uint i = 0; i < arrlen; i++) {
            elemArray[i] = (bytes(arr[i]));
            outputlen += elemArray[i].length + (elemArray[i].length - 1)/23 + 3; //+3 accounts for paired identifier types
        }
        uint ctr = 0;
        uint cborlen = arrlen + 0x80;
        outputlen += byte(cborlen).length;
        bytes memory res = new bytes(outputlen);

        while (byte(cborlen).length > ctr) {
            res[ctr] = byte(cborlen)[ctr];
            ctr++;
        }
        for (i = 0; i < arrlen; i++) {
            res[ctr] = 0x5F;
            ctr++;
            for (uint x = 0; x < elemArray[i].length; x++) {
                // if there's a bug with larger strings, this may be the culprit
                if (x % 23 == 0) {
                    uint elemcborlen = elemArray[i].length - x >= 24 ? 23 : elemArray[i].length - x;
                    elemcborlen += 0x40;
                    uint lctr = ctr;
                    while (byte(elemcborlen).length > ctr - lctr) {
                        res[ctr] = byte(elemcborlen)[ctr - lctr];
                        ctr++;
                    }
                }
                res[ctr] = elemArray[i][x];
                ctr++;
            }
            res[ctr] = 0xFF;
            ctr++;
        }
        return res;
    }


    string oraclize_network_name;
    function oraclize_setNetworkName(string _network_name) internal {
        oraclize_network_name = _network_name;
    }

    function oraclize_getNetworkName() internal view returns (string) {
        return oraclize_network_name;
    }

    function oraclize_newRandomDSQuery(uint _delay, uint _nbytes, uint _customGasLimit) internal returns (bytes32){
        require((_nbytes > 0) && (_nbytes <= 32));
        bytes memory nbytes = new bytes(1);
        nbytes[0] = byte(_nbytes);
        bytes memory unonce = new bytes(32);
        bytes memory sessionKeyHash = new bytes(32);
        bytes32 sessionKeyHash_bytes32 = oraclize_randomDS_getSessionPubKeyHash();
        assembly {
        mstore(unonce, 0x20)
        mstore(add(unonce, 0x20), xor(blockhash(sub(number, 1)), xor(coinbase, timestamp)))
        mstore(sessionKeyHash, 0x20)
        mstore(add(sessionKeyHash, 0x20), sessionKeyHash_bytes32)
        }
        bytes[3] memory args = [unonce, nbytes, sessionKeyHash];
        bytes32 queryId = oraclize_query(_delay, "random", args, _customGasLimit);
        oraclize_randomDS_setCommitment(queryId, keccak256(bytes8(_delay), args[1], sha256(args[0]), args[2]));
        return queryId;
    }

    function oraclize_randomDS_setCommitment(bytes32 queryId, bytes32 commitment) internal {
        oraclize_randomDS_args[queryId] = commitment;
    }

    mapping(bytes32=>bytes32) oraclize_randomDS_args;
    mapping(bytes32=>bool) oraclize_randomDS_sessionKeysHashVerified;

    function verifySig(bytes32 tosignh, bytes dersig, bytes pubkey) internal returns (bool){
        bool sigok;
        address signer;

        bytes32 sigr;
        bytes32 sigs;

        bytes memory sigr_ = new bytes(32);
        uint offset = 4+(uint(dersig[3]) - 0x20);
        sigr_ = copyBytes(dersig, offset, 32, sigr_, 0);
        bytes memory sigs_ = new bytes(32);
        offset += 32 + 2;
        sigs_ = copyBytes(dersig, offset+(uint(dersig[offset-1]) - 0x20), 32, sigs_, 0);

        assembly {
        sigr := mload(add(sigr_, 32))
        sigs := mload(add(sigs_, 32))
        }


        (sigok, signer) = safer_ecrecover(tosignh, 27, sigr, sigs);
        if (address(keccak256(pubkey)) == signer) return true;
        else {
            (sigok, signer) = safer_ecrecover(tosignh, 28, sigr, sigs);
            return (address(keccak256(pubkey)) == signer);
        }
    }

    function oraclize_randomDS_proofVerify__sessionKeyValidity(bytes proof, uint sig2offset) internal returns (bool) {
        bool sigok;

        // Step 6: verify the attestation signature, APPKEY1 must sign the sessionKey from the correct ledger app (CODEHASH)
        bytes memory sig2 = new bytes(uint(proof[sig2offset+1])+2);
        copyBytes(proof, sig2offset, sig2.length, sig2, 0);

        bytes memory appkey1_pubkey = new bytes(64);
        copyBytes(proof, 3+1, 64, appkey1_pubkey, 0);

        bytes memory tosign2 = new bytes(1+65+32);
        tosign2[0] = byte(1); //role
        copyBytes(proof, sig2offset-65, 65, tosign2, 1);
        bytes memory CODEHASH = hex"fd94fa71bc0ba10d39d464d0d8f465efeef0a2764e3887fcc9df41ded20f505c";
        copyBytes(CODEHASH, 0, 32, tosign2, 1+65);
        sigok = verifySig(sha256(tosign2), sig2, appkey1_pubkey);

        if (sigok == false) return false;


        // Step 7: verify the APPKEY1 provenance (must be signed by Ledger)
        bytes memory LEDGERKEY = hex"7fb956469c5c9b89840d55b43537e66a98dd4811ea0a27224272c2e5622911e8537a2f8e86a46baec82864e98dd01e9ccc2f8bc5dfc9cbe5a91a290498dd96e4";

        bytes memory tosign3 = new bytes(1+65);
        tosign3[0] = 0xFE;
        copyBytes(proof, 3, 65, tosign3, 1);

        bytes memory sig3 = new bytes(uint(proof[3+65+1])+2);
        copyBytes(proof, 3+65, sig3.length, sig3, 0);

        sigok = verifySig(sha256(tosign3), sig3, LEDGERKEY);

        return sigok;
    }

    modifier oraclize_randomDS_proofVerify(bytes32 _queryId, string _result, bytes _proof) {
        // Step 1: the prefix has to match 'LP\x01' (Ledger Proof version 1)
        require((_proof[0] == "L") && (_proof[1] == "P") && (_proof[2] == 1));

        bool proofVerified = oraclize_randomDS_proofVerify__main(_proof, _queryId, bytes(_result), oraclize_getNetworkName());
        require(proofVerified);

        _;
    }

    function oraclize_randomDS_proofVerify__returnCode(bytes32 _queryId, string _result, bytes _proof) internal returns (uint8){
        // Step 1: the prefix has to match 'LP\x01' (Ledger Proof version 1)
        if ((_proof[0] != "L")||(_proof[1] != "P")||(_proof[2] != 1)) return 1;

        bool proofVerified = oraclize_randomDS_proofVerify__main(_proof, _queryId, bytes(_result), oraclize_getNetworkName());
        if (proofVerified == false) return 2;

        return 0;
    }

    function matchBytes32Prefix(bytes32 content, bytes prefix) internal pure returns (bool){
        bool match_ = true;

        for (uint256 i=0; i<prefix.length; i++){
            if (content[i] != prefix[i]) match_ = false;
        }

        return match_;
    }

    function oraclize_randomDS_proofVerify__main(bytes proof, bytes32 queryId, bytes result, string context_name) internal returns (bool){
        bool checkok;


        // Step 2: the unique keyhash has to match with the sha256 of (context name + queryId)
        uint ledgerProofLength = 3+65+(uint(proof[3+65+1])+2)+32;
        bytes memory keyhash = new bytes(32);
        copyBytes(proof, ledgerProofLength, 32, keyhash, 0);
        checkok = (keccak256(keyhash) == keccak256(sha256(context_name, queryId)));
        if (checkok == false) return false;

        bytes memory sig1 = new bytes(uint(proof[ledgerProofLength+(32+8+1+32)+1])+2);
        copyBytes(proof, ledgerProofLength+(32+8+1+32), sig1.length, sig1, 0);


        // Step 3: we assume sig1 is valid (it will be verified during step 5) and we verify if 'result' is the prefix of sha256(sig1)
        checkok = matchBytes32Prefix(sha256(sig1), result);
        if (checkok == false) return false;


        // Step 4: commitment match verification, keccak256(delay, nbytes, unonce, sessionKeyHash) == commitment in storage.
        // This is to verify that the computed args match with the ones specified in the query.
        bytes memory commitmentSlice1 = new bytes(8+1+32);
        copyBytes(proof, ledgerProofLength+32, 8+1+32, commitmentSlice1, 0);

        bytes memory sessionPubkey = new bytes(64);
        uint sig2offset = ledgerProofLength+32+(8+1+32)+sig1.length+65;
        copyBytes(proof, sig2offset-64, 64, sessionPubkey, 0);

        bytes32 sessionPubkeyHash = sha256(sessionPubkey);
        if (oraclize_randomDS_args[queryId] == keccak256(commitmentSlice1, sessionPubkeyHash)){ //unonce, nbytes and sessionKeyHash match
            delete oraclize_randomDS_args[queryId];
        } else return false;


        // Step 5: validity verification for sig1 (keyhash and args signed with the sessionKey)
        bytes memory tosign1 = new bytes(32+8+1+32);
        copyBytes(proof, ledgerProofLength, 32+8+1+32, tosign1, 0);
        checkok = verifySig(sha256(tosign1), sig1, sessionPubkey);
        if (checkok == false) return false;

        // verify if sessionPubkeyHash was verified already, if not.. let's do it!
        if (oraclize_randomDS_sessionKeysHashVerified[sessionPubkeyHash] == false){
            oraclize_randomDS_sessionKeysHashVerified[sessionPubkeyHash] = oraclize_randomDS_proofVerify__sessionKeyValidity(proof, sig2offset);
        }

        return oraclize_randomDS_sessionKeysHashVerified[sessionPubkeyHash];
    }


    // the following function has been written by Alex Beregszaszi (@axic), use it under the terms of the MIT license
    function copyBytes(bytes from, uint fromOffset, uint length, bytes to, uint toOffset) internal pure returns (bytes) {
        uint minLength = length + toOffset;

        // Buffer too small
        require(to.length >= minLength); // Should be a better way?

        // NOTE: the offset 32 is added to skip the `size` field of both bytes variables
        uint i = 32 + fromOffset;
        uint j = 32 + toOffset;

        while (i < (32 + fromOffset + length)) {
            assembly {
            let tmp := mload(add(from, i))
            mstore(add(to, j), tmp)
            }
            i += 32;
            j += 32;
        }

        return to;
    }

    // the following function has been written by Alex Beregszaszi (@axic), use it under the terms of the MIT license
    // Duplicate Solidity's ecrecover, but catching the CALL return value
    function safer_ecrecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal returns (bool, address) {
        // We do our own memory management here. Solidity uses memory offset
        // 0x40 to store the current end of memory. We write past it (as
        // writes are memory extensions), but don't update the offset so
        // Solidity will reuse it. The memory used here is only needed for
        // this context.

        // FIXME: inline assembly can't access return values
        bool ret;
        address addr;

        assembly {
        let size := mload(0x40)
        mstore(size, hash)
        mstore(add(size, 32), v)
        mstore(add(size, 64), r)
        mstore(add(size, 96), s)

        // NOTE: we can reuse the request memory because we deal with
        //       the return code
        ret := call(3000, 1, 0, size, 128, size, 32)
        addr := mload(size)
        }

        return (ret, addr);
    }

    // the following function has been written by Alex Beregszaszi (@axic), use it under the terms of the MIT license
    function ecrecovery(bytes32 hash, bytes sig) internal returns (bool, address) {
        bytes32 r;
        bytes32 s;
        uint8 v;

        if (sig.length != 65)
        return (false, 0);

        // The signature format is a compact form of:
        //   {bytes32 r}{bytes32 s}{uint8 v}
        // Compact means, uint8 is not padded to 32 bytes.
        assembly {
        r := mload(add(sig, 32))
        s := mload(add(sig, 64))

        // Here we are loading the last 32 bytes. We exploit the fact that
        // 'mload' will pad with zeroes if we overread.
        // There is no 'mload8' to do this, but that would be nicer.
        v := byte(0, mload(add(sig, 96)))

        // Alternative solution:
        // 'byte' is not working due to the Solidity parser, so lets
        // use the second best option, 'and'
        // v := and(mload(add(sig, 65)), 255)
        }

        // albeit non-transactional signatures are not specified by the YP, one would expect it
        // to match the YP range of [27, 28]
        //
        // geth uses [0, 1] and some clients have followed. This might change, see:
        //  https://github.com/ethereum/go-ethereum/issues/2053
        if (v < 27)
        v += 27;

        if (v != 27 && v != 28)
        return (false, 0);

        return safer_ecrecover(hash, v, r, s);
    }

}
// </ORACLIZE_API>

// File: contracts/utils/parsers/Bytes32ParserLib.sol

library Bytes32ParserLib {
    function toHexString(bytes32 _x) public pure returns (string) {
        bytes memory b = new bytes(66);
        b[0] = "0";
        b[1] = "x";

        for (uint8 i = 0; i < 32; i++) {
            b[i*2+2] = getFirstHexByte(_x[i]);
            b[i*2+3] = getSecondHexByte(_x[i]);
        }

        return string(b);
    }

    function getFirstHexByte(byte _x) private pure returns (byte) {
        uint8 firstByte = uint8(_x) / 16;

        return byte(hexToAscii(firstByte));
    }

    function getSecondHexByte(byte _x) private pure returns (byte) {
        uint8 secondByte = uint8(_x) % 16;

        return byte(hexToAscii(secondByte));
    }

    function hexToAscii(uint8 _x) private pure returns (uint8) {
        if (_x < 10) {
            return _x + 48;
        } else {
            return _x + 87;
        }
    }
}

// File: openzeppelin-solidity/contracts/ownership/Ownable.sol

/**
 * @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;


  event OwnershipRenounced(address indexed previousOwner);
  event OwnershipTransferred(
    address indexed previousOwner,
    address indexed newOwner
  );


  /**
   * @dev The Ownable constructor sets the original `owner` of the contract to the sender
   * account.
   */
  constructor() public {
    owner = msg.sender;
  }

  /**
   * @dev Throws if called by any account other than the owner.
   */
  modifier onlyOwner() {
    require(msg.sender == owner);
    _;
  }

  /**
   * @dev Allows the current owner to relinquish control of the contract.
   */
  function renounceOwnership() public onlyOwner {
    emit OwnershipRenounced(owner);
    owner = address(0);
  }

  /**
   * @dev Allows the current owner to transfer control of the contract to a newOwner.
   * @param _newOwner The address to transfer ownership to.
   */
  function transferOwnership(address _newOwner) public onlyOwner {
    _transferOwnership(_newOwner);
  }

  /**
   * @dev Transfers control of the contract to a newOwner.
   * @param _newOwner The address to transfer ownership to.
   */
  function _transferOwnership(address _newOwner) internal {
    require(_newOwner != address(0));
    emit OwnershipTransferred(owner, _newOwner);
    owner = _newOwner;
  }
}

// File: contracts/VpfFactoryInterface.sol

contract VpfFactoryInterface {
    function generateNext() public;
    function isPaused() public view returns(bool);
}

// File: contracts/oracles/OracleInterface.sol

contract OracleInterface {
    function request(
        bytes32 _assetHash,
        uint _time,
        uint8 _decimalPoints,
        uint _gasLimit) public;
}

// File: contracts/PhenomenonsContract.sol

contract PhenomenonsContract is Ownable {

    struct Phenomenon {
        string mnemonic;
        string name;
        string description;
        string category;
        uint8 valueDecimalPlaces;
        bool enabled;
        bool exists;
    }

    mapping(bytes32 => Phenomenon) public phenomenons;
    string[] public mnemonics;

    event PhenomenonAdd(bytes32 hash);
    event PhenomenonDisable(bytes32 hash);
    event PhenomenonEnable(bytes32 hash);

    function addPhenomenon(
        string _mnemonic,
        string _name,
        string _description,
        string _category,
        uint8 _valueDecimalPlaces
    ) public onlyOwner
    {
        bytes32 hash = keccak256(abi.encodePacked(_mnemonic));
        require(bytes(phenomenons[hash].mnemonic).length == 0, "Phenomenon already exists!");

        Phenomenon memory phenomenon = Phenomenon(
            _mnemonic,
            _name,
            _description,
            _category,
            _valueDecimalPlaces,
            true,
            true
        );

        phenomenons[hash] = phenomenon;
        mnemonics.push(_mnemonic);

        emit PhenomenonAdd(hash);
    }

    function disablePhenomenon(bytes32 _hash) public onlyOwner {
        require(phenomenons[_hash].enabled == true);

        phenomenons[_hash].enabled = false;

        emit PhenomenonDisable(_hash);
    }

    function enablePhenomenon(bytes32 _hash) public onlyOwner {
        require(phenomenons[_hash].exists == true);
        require(phenomenons[_hash].enabled == false);

        phenomenons[_hash].enabled = true;

        emit PhenomenonEnable(_hash);
    }

    function mnemonicsCount() public view returns(uint) {
        return mnemonics.length;
    }

    function isEnabled(bytes32 _hash) public view returns(bool) {
        return phenomenons[_hash].enabled;
    }

    function decimalPoints(bytes32 _hash) public view returns(uint8) {
        return phenomenons[_hash].valueDecimalPlaces;
    }
}

// File: contracts/ContractAddressesManager.sol

contract ContractAddressesManager is Ownable {

    OracleInterface public oracle;
    PhenomenonsContract public phenomenonsContract;
    mapping(address => bool) public factories;

    event AddFactory(address _factory);
    event RemoveFactory(address _factory);

    function addFactory(VpfFactoryInterface _factory) public onlyOwnerOrigin {
        factories[_factory] = true;
        emit AddFactory(_factory);
    }

    function removeFactory(VpfFactoryInterface _factory) public onlyOwner {
        factories[_factory] = false;
        emit RemoveFactory(_factory);
    }

    function setOracle(OracleInterface _oracle) public onlyOwner {
        oracle = _oracle;
    }

    function setPhenomenonsContract(PhenomenonsContract _phenomenonsContract) public onlyOwner {
        phenomenonsContract = _phenomenonsContract;
    }

    modifier onlyOwnerOrigin() {
        require(tx.origin == owner);
        _;
    }
}

// File: contracts/oracles/UsingOracle.sol

contract UsingOracle {
    ContractAddressesManager addressManager;

    constructor(ContractAddressesManager _manager) public {
        addressManager = _manager;
    }

    function updateValue(bytes32 _vpfHash, uint _time, uint _value) public onlyFromOracle;

    modifier onlyFromOracle() {
        require(msg.sender == address(addressManager.oracle()));
        _;
    }
}

// File: openzeppelin-solidity/contracts/math/SafeMath.sol

/**
 * @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 Integer division of two numbers, truncating the quotient.
  */
  function div(uint256 a, uint256 b) internal pure returns (uint256) {
    // assert(b > 0); // Solidity automatically throws when dividing by 0
    // uint256 c = a / b;
    // assert(a == b * c + a % b); // There is no case in which this doesn't hold
    return a / b;
  }

  /**
  * @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;
  }
}

// File: contracts/oracles/Oracle.sol

contract Oracle is usingOraclize, Ownable, OracleInterface {
    using Bytes32ParserLib for bytes32;
    using SafeMath for uint256;

    UsingOracle usingOracle;

    uint public gasPrice = 20000000000;
    uint public delay;
    string public oracleHost;

    struct VpfValueCheck {
        bytes32 hash;
        uint date;
        uint8 decimalPoints;
    }

    event QuerySent(string query, uint time);
    event FundsHaveRunOut(bytes32 vpfHash, uint time, uint8 decimalPoints, uint gasLimit);

    mapping(bytes32=>VpfValueCheck) queries;

    constructor(address _oar, string _oracleHost, uint _delay) public {
        OAR = OraclizeAddrResolverI(_oar);
        oracleHost = _oracleHost;
        delay = _delay;
    }

    function() public payable { }

    function setVpf(UsingOracle _usingOracle) public onlyOwner {
        usingOracle = _usingOracle;
    }

    function setHost(string _oracleHost) public onlyOwner {
        oracleHost = _oracleHost;
    }

    function request(
        bytes32 _vpfHash,
        uint _time,
        uint8 _decimalPoints,
        uint _gasLimit
    ) public onlyVpfsContractOrOwner
    {
        if (oraclize_getPrice("URL", _gasLimit) > address(this).balance) {
            emit FundsHaveRunOut(
                _vpfHash,
                _time,
                _decimalPoints,
                _gasLimit
            );

            return;
        }

        string memory query = strConcat("json(", constructUrl(_vpfHash, _time), ").value");

        bytes32 queryId = sendQuery(query, _time, _gasLimit);
        queries[queryId] = VpfValueCheck(_vpfHash, _time, _decimalPoints);

        emit QuerySent(query, _time);
    }

    function setGasPrice(uint _gasPrice) public onlyOwner {
        oraclize_setCustomGasPrice(_gasPrice);
        gasPrice = _gasPrice;
    }

    function setDelay(uint _delay) public onlyOwner {
        delay = _delay;
    }

    function __callback(bytes32 myid, string result) public onlyFromOraclize {
        require(queries[myid].hash != bytes32(0));

        uint value = parseAndRound(result, queries[myid].decimalPoints);

        usingOracle.updateValue(queries[myid].hash, queries[myid].date, value);

        delete queries[myid];
    }

    function constructUrl(bytes32 _vpfHash, uint _time) public view returns(string) {
        return strConcat(
            oracleHost,
            "/api/vpf/",
            _vpfHash.toHexString(),
            "/value?timestamp=",
            uint2str(_time)
        );
    }

    function sendQuery(string _query, uint _time, uint _gasLimit) internal returns(bytes32) {
        uint delayedTime = _time.add(delay);

        if (delayedTime > now) {
            return oraclize_query(
                delayedTime,
                "URL",
                _query,
                _gasLimit
            );
        } else {
            return oraclize_query(
                "URL",
                _query,
                _gasLimit
            );
        }
    }

    function parseAndRound(string result, uint8 decimalPoints) internal pure returns(uint) {
        uint value = parseInt(result, decimalPoints+1);

        return value.add(5).div(10);
    }

    modifier onlyFromOraclize() {
        require(msg.sender == oraclize_cbAddress());
        _;
    }

    modifier onlyVpfsContractOrOwner() {
        require(msg.sender == address(usingOracle) || msg.sender == owner);
        _;
    }
}

Contract ABI
[{"constant":true,"inputs":[],"name":"oracleHost","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"myid","type":"bytes32"},{"name":"result","type":"string"}],"name":"__callback","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_vpfHash","type":"bytes32"},{"name":"_time","type":"uint256"},{"name":"_decimalPoints","type":"uint8"},{"name":"_gasLimit","type":"uint256"}],"name":"request","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_usingOracle","type":"address"}],"name":"setVpf","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"delay","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"renounceOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_oracleHost","type":"string"}],"name":"setHost","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_vpfHash","type":"bytes32"},{"name":"_time","type":"uint256"}],"name":"constructUrl","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_gasPrice","type":"uint256"}],"name":"setGasPrice","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_delay","type":"uint256"}],"name":"setDelay","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"gasPrice","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_oar","type":"address"},{"name":"_oracleHost","type":"string"},{"name":"_delay","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":false,"name":"query","type":"string"},{"indexed":false,"name":"time","type":"uint256"}],"name":"QuerySent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"vpfHash","type":"bytes32"},{"indexed":false,"name":"time","type":"uint256"},{"indexed":false,"name":"decimalPoints","type":"uint8"},{"indexed":false,"name":"gasLimit","type":"uint256"}],"name":"FundsHaveRunOut","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"}],"name":"OwnershipRenounced","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"}]

Contract Creation Code
60806040526404a817c8006007553480156200001a57600080fd5b5060405162002486380380620024868339810160409081528151602080840151928401516005805433600160a060020a03199182161790915560008054909116600160a060020a038516179055929093018051919390929162000084916009919085019062000091565b5060085550620001369050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620000d457805160ff191683800117855562000104565b8280016001018555821562000104579182015b8281111562000104578251825591602001919060010190620000e7565b506200011292915062000116565b5090565b6200013391905b808211156200011257600081556001016200011d565b90565b61234080620001466000396000f3006080604052600436106100ab5763ffffffff60e060020a6000350416632411266f81146100ad57806327dc297e1461013757806345ff8fde1461019557806355fdd9d5146101b95780636a42b8f8146101da578063715018a6146102015780638da5cb5b14610216578063a5ab89ff14610247578063b8ccc682146102a0578063bf1fe420146102bb578063e177246e146102d3578063f2fde38b146102eb578063fe173b971461030c575b005b3480156100b957600080fd5b506100c2610321565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100fc5781810151838201526020016100e4565b50505050905090810190601f1680156101295780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561014357600080fd5b5060408051602060046024803582810135601f81018590048502860185019096528585526100ab9583359536956044949193909101919081908401838280828437509497506103af9650505050505050565b3480156101a157600080fd5b506100ab60043560243560ff604435166064356104ce565b3480156101c557600080fd5b506100ab600160a060020a036004351661071d565b3480156101e657600080fd5b506101ef610756565b60408051918252519081900360200190f35b34801561020d57600080fd5b506100ab61075c565b34801561022257600080fd5b5061022b6107bd565b60408051600160a060020a039092168252519081900360200190f35b34801561025357600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526100ab9436949293602493928401919081908401838280828437509497506107cc9650505050505050565b3480156102ac57600080fd5b506100c26004356024356107fa565b3480156102c757600080fd5b506100ab600435610a01565b3480156102df57600080fd5b506100ab600435610a26565b3480156102f757600080fd5b506100ab600160a060020a0360043516610a42565b34801561031857600080fd5b506101ef610a65565b6009805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156103a75780601f1061037c576101008083540402835291602001916103a7565b820191906000526020600020905b81548152906001019060200180831161038a57829003601f168201915b505050505081565b60006103b9610a6b565b600160a060020a031633146103cd57600080fd5b6000838152600a602052604090205415156103e757600080fd5b6000838152600a602052604090206002015461040790839060ff16610c5d565b6006546000858152600a6020526040808220805460019091015482517f5b5d2c8f00000000000000000000000000000000000000000000000000000000815260048101929092526024820152604481018590529051939450600160a060020a0390921692635b5d2c8f92606480820193929182900301818387803b15801561048e57600080fd5b505af11580156104a2573d6000803e3d6000fd5b50505060009384525050600a60205250604081208181556001810191909155600201805460ff19169055565b600654606090600090600160a060020a03163314806104f75750600554600160a060020a031633145b151561050257600080fd5b60408051808201909152600381527f55524c000000000000000000000000000000000000000000000000000000000060208201523031906105439085610c9c565b111561059757604080518781526020810187905260ff8616818301526060810185905290517f49374d55beb4ccdd57a32004c4a323f18f0ee7ff53ad69e0e0290970aa7162539181900360800190a1610715565b6106136040805190810160405280600581526020017f6a736f6e280000000000000000000000000000000000000000000000000000008152506105da88886107fa565b60408051808201909152600781527f292e76616c7565000000000000000000000000000000000000000000000000006020820152610f09565b9150610620828685610f38565b604080516060808201835289825260208083018a815260ff8a81168587019081526000888152600a85528781209651875592516001870155516002909501805460ff1916959091169490941790935583518082018b905284815287519481019490945286519495507ff51b1e2735dc6c6694f2dab04485f1ca754232e258f60feac942d85a2d57702c9487948b949093849390840192908701918190849084905b838110156106d95781810151838201526020016106c1565b50505050905090810190601f1680156107065780820380516001836020036101000a031916815260200191505b50935050505060405180910390a15b505050505050565b600554600160a060020a0316331461073457600080fd5b60068054600160a060020a031916600160a060020a0392909216919091179055565b60085481565b600554600160a060020a0316331461077357600080fd5b600554604051600160a060020a03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a260058054600160a060020a0319169055565b600554600160a060020a031681565b600554600160a060020a031633146107e357600080fd5b80516107f690600990602084019061227c565b5050565b6009805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181526060936109fa93919290918301828280156108895780601f1061085e57610100808354040283529160200191610889565b820191906000526020600020905b81548152906001019060200180831161086c57829003601f168201915b5050604080518082018252600981527f2f6170692f7670662f0000000000000000000000000000000000000000000000602082015281517fedb961ff000000000000000000000000000000000000000000000000000000008152600481018b9052915190945073ca1ae670226c20a7026b8a89b040f38366075c1a935063edb961ff92506024808301926000929190829003018186803b15801561092c57600080fd5b505af4158015610940573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052602081101561096957600080fd5b81019080805164010000000081111561098157600080fd5b8201602081018481111561099457600080fd5b81516401000000008111828201871017156109ae57600080fd5b50509291905050506040805190810160405280601181526020017f2f76616c75653f74696d657374616d703d0000000000000000000000000000008152506109f587610fea565b6110dd565b9392505050565b600554600160a060020a03163314610a1857600080fd5b610a218161133e565b600755565b600554600160a060020a03163314610a3d57600080fd5b600855565b600554600160a060020a03163314610a5957600080fd5b610a628161152b565b50565b60075481565b60008054600160a060020a03161580610a965750600054610a9490600160a060020a031661159c565b155b15610aa757610aa560006115a0565b505b6000809054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015610af957600080fd5b505af1158015610b0d573d6000803e3d6000fd5b505050506040513d6020811015610b2357600080fd5b5051600154600160a060020a03908116911614610bd8576000809054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015610b8c57600080fd5b505af1158015610ba0573d6000803e3d6000fd5b505050506040513d6020811015610bb657600080fd5b505160018054600160a060020a031916600160a060020a039092169190911790555b600160009054906101000a9004600160a060020a0316600160a060020a031663c281d19e6040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015610c2b57600080fd5b505af1158015610c3f573d6000803e3d6000fd5b505050506040513d6020811015610c5557600080fd5b505190505b90565b600080610c70848460010160ff166115b0565b9050610c94600a610c8883600563ffffffff61172216565b9063ffffffff61172f16565b949350505050565b60008054600160a060020a03161580610cc75750600054610cc590600160a060020a031661159c565b155b15610cd857610cd660006115a0565b505b6000809054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015610d2a57600080fd5b505af1158015610d3e573d6000803e3d6000fd5b505050506040513d6020811015610d5457600080fd5b5051600154600160a060020a03908116911614610e09576000809054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015610dbd57600080fd5b505af1158015610dd1573d6000803e3d6000fd5b505050506040513d6020811015610de757600080fd5b505160018054600160a060020a031916600160a060020a039092169190911790555b600154604080517f2ef3accc0000000000000000000000000000000000000000000000000000000081526024810185905260048101918252855160448201528551600160a060020a0390931692632ef3accc9287928792829160640190602086019080838360005b83811015610e89578181015183820152602001610e71565b50505050905090810190601f168015610eb65780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b158015610ed657600080fd5b505af1158015610eea573d6000803e3d6000fd5b505050506040513d6020811015610f0057600080fd5b50519392505050565b6060610c94848484602060405190810160405280600081525060206040519081016040528060008152506110dd565b600080610f506008548561172290919063ffffffff16565b905042811115610fa257610f9b816040805190810160405280600381526020017f55524c00000000000000000000000000000000000000000000000000000000008152508786611744565b9150610fe2565b610f9b6040805190810160405280600381526020017f55524c00000000000000000000000000000000000000000000000000000000008152508685611b46565b509392505050565b606060008082818515156110335760408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015294506110d4565b8593505b831561104e57600190920191600a84049350611037565b826040519080825280601f01601f19166020018201604052801561107c578160200160208202803883390190505b5091505060001982015b85156110d057815160001982019160f860020a6030600a8a0601029184919081106110ad57fe5b906020010190600160f860020a031916908160001a905350600a86049550611086565b8194505b50505050919050565b6060806060806060806060806000808e98508d97508c96508b95508a94508451865188518a518c51010101016040519080825280601f01601f191660200182016040528015611136578160200160208202803883390190505b50935083925060009150600090505b88518110156111a357888181518110151561115c57fe5b90602001015160f860020a900460f860020a02838380600101945081518110151561118357fe5b906020010190600160f860020a031916908160001a905350600101611145565b5060005b87518110156112055787818151811015156111be57fe5b90602001015160f860020a900460f860020a0283838060010194508151811015156111e557fe5b906020010190600160f860020a031916908160001a9053506001016111a7565b5060005b865181101561126757868181518110151561122057fe5b90602001015160f860020a900460f860020a02838380600101945081518110151561124757fe5b906020010190600160f860020a031916908160001a905350600101611209565b5060005b85518110156112c957858181518110151561128257fe5b90602001015160f860020a900460f860020a0283838060010194508151811015156112a957fe5b906020010190600160f860020a031916908160001a90535060010161126b565b5060005b845181101561132b5784818151811015156112e457fe5b90602001015160f860020a900460f860020a02838380600101945081518110151561130b57fe5b906020010190600160f860020a031916908160001a9053506001016112cd565b50909d9c50505050505050505050505050565b600054600160a060020a03161580611368575060005461136690600160a060020a031661159c565b155b156113795761137760006115a0565b505b6000809054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156113cb57600080fd5b505af11580156113df573d6000803e3d6000fd5b505050506040513d60208110156113f557600080fd5b5051600154600160a060020a039081169116146114aa576000809054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561145e57600080fd5b505af1158015611472573d6000803e3d6000fd5b505050506040513d602081101561148857600080fd5b505160018054600160a060020a031916600160a060020a039092169190911790555b600154604080517fca6ad1e4000000000000000000000000000000000000000000000000000000008152600481018490529051600160a060020a039092169163ca6ad1e49160248082019260009290919082900301818387803b15801561151057600080fd5b505af1158015611524573d6000803e3d6000fd5b5050505050565b600160a060020a038116151561154057600080fd5b600554604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a360058054600160a060020a031916600160a060020a0392909216919091179055565b3b90565b60006115aa611f45565b92915050565b6000828180805b83518110156117055783517f3000000000000000000000000000000000000000000000000000000000000000908590839081106115f057fe5b90602001015160f860020a900460f860020a02600160f860020a03191610158015611666575083517f39000000000000000000000000000000000000000000000000000000000000009085908390811061164657fe5b90602001015160f860020a900460f860020a02600160f860020a03191611155b156116bf5781156116855785151561167d57611705565b600019909501945b600a830292506030848281518110151561169b57fe5b90602001015160f860020a900460f860020a0260f860020a900403830192506116fd565b83818151811015156116cd57fe5b90602001015160f860020a900460f860020a02600160f860020a031916602e60f860020a0214156116fd57600191505b6001016115b7565b60008611156117175785600a0a830292505b509095945050505050565b818101828110156115aa57fe5b6000818381151561173c57fe5b049392505050565b600080548190600160a060020a03161580611771575060005461176f90600160a060020a031661159c565b155b156117825761178060006115a0565b505b6000809054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156117d457600080fd5b505af11580156117e8573d6000803e3d6000fd5b505050506040513d60208110156117fe57600080fd5b5051600154600160a060020a039081169116146118b3576000809054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561186757600080fd5b505af115801561187b573d6000803e3d6000fd5b505050506040513d602081101561189157600080fd5b505160018054600160a060020a031916600160a060020a039092169190911790555b600154604080517f2ef3accc0000000000000000000000000000000000000000000000000000000081526024810186905260048101918252875160448201528751600160a060020a0390931692632ef3accc9289928892829160640190602086019080838360005b8381101561193357818101518382015260200161191b565b50505050905090810190601f1680156119605780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b15801561198057600080fd5b505af1158015611994573d6000803e3d6000fd5b505050506040513d60208110156119aa57600080fd5b50519050670de0b6b3a76400003a8402018111156119cb5760009150611b3d565b6001546040517fc51be90f0000000000000000000000000000000000000000000000000000000081526004810188815260648201869052608060248301908152885160848401528851600160a060020a039094169363c51be90f9386938c938c938c938c939291604482019160a40190602088019080838360005b83811015611a5e578181015183820152602001611a46565b50505050905090810190601f168015611a8b5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015611abe578181015183820152602001611aa6565b50505050905090810190601f168015611aeb5780820380516001836020036101000a031916815260200191505b5096505050505050506020604051808303818588803b158015611b0d57600080fd5b505af1158015611b21573d6000803e3d6000fd5b50505050506040513d6020811015611b3857600080fd5b505191505b50949350505050565b600080548190600160a060020a03161580611b735750600054611b7190600160a060020a031661159c565b155b15611b8457611b8260006115a0565b505b6000809054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015611bd657600080fd5b505af1158015611bea573d6000803e3d6000fd5b505050506040513d6020811015611c0057600080fd5b5051600154600160a060020a03908116911614611cb5576000809054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015611c6957600080fd5b505af1158015611c7d573d6000803e3d6000fd5b505050506040513d6020811015611c9357600080fd5b505160018054600160a060020a031916600160a060020a039092169190911790555b600154604080517f2ef3accc0000000000000000000000000000000000000000000000000000000081526024810186905260048101918252875160448201528751600160a060020a0390931692632ef3accc9289928892829160640190602086019080838360005b83811015611d35578181015183820152602001611d1d565b50505050905090810190601f168015611d625780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b158015611d8257600080fd5b505af1158015611d96573d6000803e3d6000fd5b505050506040513d6020811015611dac57600080fd5b50519050670de0b6b3a76400003a840201811115611dcd5760009150610fe2565b6001546040517fc51be90f00000000000000000000000000000000000000000000000000000000815260006004820181815260648301879052608060248401908152895160848501528951600160a060020a039095169463c51be90f948794938c938c938c93604481019160a49091019060208801908083838c5b83811015611e60578181015183820152602001611e48565b50505050905090810190601f168015611e8d5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015611ec0578181015183820152602001611ea8565b50505050905090810190601f168015611eed5780820380516001836020036101000a031916815260200191505b5096505050505050506020604051808303818588803b158015611f0f57600080fd5b505af1158015611f23573d6000803e3d6000fd5b50505050506040513d6020811015611f3a57600080fd5b505195945050505050565b600080611f65731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed61159c565b1115611fd65760008054600160a060020a031916731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed17905560408051808201909152600b81527f6574685f6d61696e6e65740000000000000000000000000000000000000000006020820152611fce9061226d565b506001610c5a565b6000611ff573c03a2615d5efaf5f49f60b7bb6583eaec212fdf161159c565b111561205e5760008054600160a060020a03191673c03a2615d5efaf5f49f60b7bb6583eaec212fdf117905560408051808201909152600c81527f6574685f726f707374656e3300000000000000000000000000000000000000006020820152611fce9061226d565b600061207d73b7a07bcf2ba2f2703b24c0691b5278999c59ac7e61159c565b11156120e65760008054600160a060020a03191673b7a07bcf2ba2f2703b24c0691b5278999c59ac7e17905560408051808201909152600981527f6574685f6b6f76616e00000000000000000000000000000000000000000000006020820152611fce9061226d565b600061210573146500cfd35b22e4a392fe0adc06de1a1368ed4861159c565b111561216e5760008054600160a060020a03191673146500cfd35b22e4a392fe0adc06de1a1368ed4817905560408051808201909152600b81527f6574685f72696e6b6562790000000000000000000000000000000000000000006020820152611fce9061226d565b600061218d736f485c8bf6fc43ea212e93bbf8ce046c7f1cb47561159c565b11156121c1575060008054600160a060020a031916736f485c8bf6fc43ea212e93bbf8ce046c7f1cb4751790556001610c5a565b60006121e07320e12a1f859b3feae5fb2a0a32c18f5a65555bbf61159c565b1115612214575060008054600160a060020a0319167320e12a1f859b3feae5fb2a0a32c18f5a65555bbf1790556001610c5a565b60006122337351efaf4c8b3c9afbd5ab9f4bbc82784ab6ef8faa61159c565b1115612267575060008054600160a060020a0319167351efaf4c8b3c9afbd5ab9f4bbc82784ab6ef8faa1790556001610c5a565b50600090565b80516107f69060029060208401905b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106122bd57805160ff19168380011785556122ea565b828001600101855582156122ea579182015b828111156122ea5782518255916020019190600101906122cf565b506122f69291506122fa565b5090565b610c5a91905b808211156122f657600081556001016123005600a165627a7a72305820de1315b60793857eaa5c620984b062c70371278d02bee78c2d8d354b5f5ab10d00290000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000019687474703a2f2f33342e3234372e31382e3137332f70726f6400000000000000


    Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000019687474703a2f2f33342e3234372e31382e3137332f70726f6400000000000000

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000019
Arg [4] : 687474703a2f2f33342e3234372e31382e3137332f70726f6400000000000000


   Library Used
Bytes32ParserLib : 0xca1ae670226c20a7026b8a89b040f38366075c1a

   Swarm Source:
bzzr://de1315b60793857eaa5c620984b062c70371278d02bee78c2d8d354b5f5ab10d
Block Age Transaction Difficulty GasUsed Reward
Block Age Uncle Number Difficulty GasUsed Reward