Sponsored Link: Join FundYourselfNow ICO – Crypto crowdfunding platform to find talent, raise funding while protecting project fraud
Contract Overview | Etheroll
ETH Balance: 1,779.468711304236365811 Ether
ETH USD Value: $561,422.38 (@ $315.50/ETH)
No Of Transactions: 29730 txns
  Latest 25 txns from a total Of 29730 transactions View All

TxHash Block Age From To Value [TxFee]
0x88a01a5dd1361094cb37b0b81c39b187c429f2abe5719f8e1e265d61cfd8dfe539455431 min agoOraclize  IN   Etheroll0 Ether0.00295458
0xc10d0bdd418cd12592f0abd4ceb3a37e67694f8355c918cb4fd62e5dbc0cca4439455392 mins ago0x33497eded4c3bf6aa93dee5b75f5241ff1a20f58  IN   Etheroll10 Ether0.00419216
0x170b2b13e973599f187e64ef48bd1e5d45d485187221021cae6c5a4e4f45f12d39455334 mins agoOraclize  IN   Etheroll0 Ether0.00297594
0x0c58f3f4aa8f3982b4bd2c595fbe2f318a978deeb1c86879cdb3b60a7487cbc639455248 mins agoOraclize  IN   Etheroll0 Ether0.00297594
0x87af03805a399c683d0c6d7f995992193db256bbec3e44b981b47d7031c6ff9c39455228 mins agoOraclize  IN   Etheroll0 Ether0.00297594
0xa5044626a37084d431308bfb12c4ef2548d3fbba7e541e9380df89ca0aed76a139455228 mins ago0x6ecd5bbd600931d2ffad11e2948939b284afd5d6  IN   Etheroll0.1 Ether0.00735362
0xcf397ffc9a5bcacd8e315387dc6611052cd700f5606119f014ae58d057764e3f39455209 mins ago0xa815e78c608c1e946629882095bcfb2773ca40b0  IN   Etheroll0.34 Ether0.01257648
0xa55dbd6efff36930332a93534e8f34f8134007523001a22098228108806296e2394551810 mins ago0x33497eded4c3bf6aa93dee5b75f5241ff1a20f58  IN   Etheroll10 Ether0.00419216
0x3df0bcc085af13e856241db81abdb68c6bd8020a33a981ea4437aab5d08b762e394551810 mins agoOraclize  IN   Etheroll0 Ether0.00297466
0xff8e36ac7593a610d4a96f7ed90ededbf3e8ba7b716a57b2ac8f0b1215012177394551810 mins ago0xc5bd85f41da515e2e5c0dea22207bc96386f6a33  IN   Etheroll0.3 Ether0.00440176
0x9f7e7f6f17be8c8f5588e42d389992a41546fddf8241aa9e09ac727467ebceae394551810 mins ago0x09d9a8112621ea106c4c0df7cc4545852ac16fc2  IN   Etheroll1 Ether0.00735362
0x690d72c21ad04df4b11dd5043dec7a270401a29dedeac04f95eb41fca73fd98a394551710 mins agoOraclize  IN   Etheroll0 Ether0.00275994
0x41321a41dd359eec9334811aefb72d55e1fff27d3bd1e9704cb39748d69eb84f394551610 mins agoOraclize  IN   Etheroll0 Ether0.00297594
0x71a7f5d1f144d53f461975045273c6538abb62681174e90d440479c663bb6797394551610 mins ago0xc5bd85f41da515e2e5c0dea22207bc96386f6a33  IN   Etheroll0.3 Ether0.00440176
0x1b33ba011565ac2391f0bdcb7d1cdf1c849e034c016a8d148064080613d8fc26394550812 mins ago0x252eb4f6e017003b61fb09e7baa8a37d65291b24  IN   Etheroll0.1 Ether0.00735362
0x7f2aae205ed425a3c7be43be1a3186f9440f0a1d06b9c06b0739e5276ef05cc7394550615 mins agoOraclize  IN   Etheroll0 Ether0.00275994
0x89f85378a7b3e9d6f15718c0b33c1c1ebc207035a38c62d837101de5567d3175394550615 mins ago0xc5bd85f41da515e2e5c0dea22207bc96386f6a33  IN   Etheroll0.3 Ether0.00440176
0xcb936e6100ba2aa1455c3b6847032c80b8c81d5a846f79a85fef7c2abeeb3d6e394550416 mins agoOraclize  IN   Etheroll0 Ether0.00297466
0x1a70fce9a1f1075f870085f03eaf67f11b4e3374dee15fc7f0631578df3efbae394550317 mins agoOraclize  IN   Etheroll0 Ether0.00297594
0x5ddbbf1ee434cdc612110c42aa39e2a393eb835e66bea6a442a0078304ff8e93394550317 mins ago0xc5bd85f41da515e2e5c0dea22207bc96386f6a33  IN   Etheroll0.3 Ether0.00440176
0x9ced4085ed68f3c4ab756ff2d7a490d160f023335c50f7c96781d32e68d65e30394550317 mins ago0xa815e78c608c1e946629882095bcfb2773ca40b0  IN   Etheroll0.23 Ether0.00735362
0x65b36cb7f8280fc846f560c170a46da88fe4fd89a033cadd7567ff07abac9337394550217 mins ago0xc5bd85f41da515e2e5c0dea22207bc96386f6a33  IN   Etheroll0.3 Ether0.00440176
0x3654dda56c74bdfc7e856bce5d09ef98ddc59760dfa291638f049906e3ee8cbb394549121 mins ago0x09d9a8112621ea106c4c0df7cc4545852ac16fc2  IN   Etheroll1 Ether0.00735362
0x432e346ebbea3ae4d1f55fbda7abbb1e5981ab27cca732c21bb055af05beed0a394548523 mins agoOraclize  IN   Etheroll0 Ether0.00275866
0xe185fb3cc82be66b30f7e36443de5c0ea6141b0a057818fb4197666251d29cb8394548224 mins agoOraclize  IN   Etheroll0 Ether0.00297594

[Download: CSV Export ]    
 Internal Transactions as a result of Contract Execution
  Latest 25 Internal Txns, Click here to View More View All
ParentTxHash Block Age From To Value
0x88a01a5dd1361094cb37b0b81c39b187c429f2abe5719f8e1e265d61cfd8dfe539455431 min ago0xece701c76bd00d1c3f96410a0c69ea8dfcf5f34e0x33497eded4c3bf6aa93dee5b75f5241ff1a20f5813.378378378378378377 Ether
0xc10d0bdd418cd12592f0abd4ceb3a37e67694f8355c918cb4fd62e5dbc0cca4439455392 mins ago0xece701c76bd00d1c3f96410a0c69ea8dfcf5f34e0x6f28b146804dba2d6f944c03528a8fdbc673df2c0.0048441638126592 Ether
0x170b2b13e973599f187e64ef48bd1e5d45d485187221021cae6c5a4e4f45f12d39455334 mins ago0xece701c76bd00d1c3f96410a0c69ea8dfcf5f34e0x6ecd5bbd600931d2ffad11e2948939b284afd5d60.139436619718309858 Ether
0x0c58f3f4aa8f3982b4bd2c595fbe2f318a978deeb1c86879cdb3b60a7487cbc639455248 mins ago0xece701c76bd00d1c3f96410a0c69ea8dfcf5f34e0xc5bd85f41da515e2e5c0dea22207bc96386f6a330.306185567010309277 Ether
0x87af03805a399c683d0c6d7f995992193db256bbec3e44b981b47d7031c6ff9c39455228 mins ago0xece701c76bd00d1c3f96410a0c69ea8dfcf5f34e0x33497eded4c3bf6aa93dee5b75f5241ff1a20f5812.692307692307692306 Ether
0xa5044626a37084d431308bfb12c4ef2548d3fbba7e541e9380df89ca0aed76a139455228 mins ago0xece701c76bd00d1c3f96410a0c69ea8dfcf5f34e0x6f28b146804dba2d6f944c03528a8fdbc673df2c0.0048441638126592 Ether
0xcf397ffc9a5bcacd8e315387dc6611052cd700f5606119f014ae58d057764e3f39455209 mins ago0xece701c76bd00d1c3f96410a0c69ea8dfcf5f34e0x6f28b146804dba2d6f944c03528a8fdbc673df2c0.0048441638126592 Ether
0xa55dbd6efff36930332a93534e8f34f8134007523001a22098228108806296e2394551810 mins ago0xece701c76bd00d1c3f96410a0c69ea8dfcf5f34e0x6f28b146804dba2d6f944c03528a8fdbc673df2c0.0048441638126592 Ether
0x3df0bcc085af13e856241db81abdb68c6bd8020a33a981ea4437aab5d08b762e394551810 mins ago0xece701c76bd00d1c3f96410a0c69ea8dfcf5f34e0xc5bd85f41da515e2e5c0dea22207bc96386f6a330.306185567010309277 Ether
0xff8e36ac7593a610d4a96f7ed90ededbf3e8ba7b716a57b2ac8f0b1215012177394551810 mins ago0xece701c76bd00d1c3f96410a0c69ea8dfcf5f34e0x6f28b146804dba2d6f944c03528a8fdbc673df2c0.0048441638126592 Ether
0x9f7e7f6f17be8c8f5588e42d389992a41546fddf8241aa9e09ac727467ebceae394551810 mins ago0xece701c76bd00d1c3f96410a0c69ea8dfcf5f34e0x6f28b146804dba2d6f944c03528a8fdbc673df2c0.0048441638126592 Ether
0x690d72c21ad04df4b11dd5043dec7a270401a29dedeac04f95eb41fca73fd98a394551710 mins ago0xece701c76bd00d1c3f96410a0c69ea8dfcf5f34e0x252eb4f6e017003b61fb09e7baa8a37d65291b241 wei
0x41321a41dd359eec9334811aefb72d55e1fff27d3bd1e9704cb39748d69eb84f394551610 mins ago0xece701c76bd00d1c3f96410a0c69ea8dfcf5f34e0xc5bd85f41da515e2e5c0dea22207bc96386f6a330.306185567010309277 Ether
0x71a7f5d1f144d53f461975045273c6538abb62681174e90d440479c663bb6797394551610 mins ago0xece701c76bd00d1c3f96410a0c69ea8dfcf5f34e0x6f28b146804dba2d6f944c03528a8fdbc673df2c0.0048441638126592 Ether
0x1b33ba011565ac2391f0bdcb7d1cdf1c849e034c016a8d148064080613d8fc26394550812 mins ago0xece701c76bd00d1c3f96410a0c69ea8dfcf5f34e0x6f28b146804dba2d6f944c03528a8fdbc673df2c0.0048441638126592 Ether
0x7f2aae205ed425a3c7be43be1a3186f9440f0a1d06b9c06b0739e5276ef05cc7394550615 mins ago0xece701c76bd00d1c3f96410a0c69ea8dfcf5f34e0xa815e78c608c1e946629882095bcfb2773ca40b01 wei
0x89f85378a7b3e9d6f15718c0b33c1c1ebc207035a38c62d837101de5567d3175394550615 mins ago0xece701c76bd00d1c3f96410a0c69ea8dfcf5f34e0x6f28b146804dba2d6f944c03528a8fdbc673df2c0.0048441638126592 Ether
0xcb936e6100ba2aa1455c3b6847032c80b8c81d5a846f79a85fef7c2abeeb3d6e394550416 mins ago0xece701c76bd00d1c3f96410a0c69ea8dfcf5f34e0xc5bd85f41da515e2e5c0dea22207bc96386f6a330.306185567010309277 Ether
0x1a70fce9a1f1075f870085f03eaf67f11b4e3374dee15fc7f0631578df3efbae394550317 mins ago0xece701c76bd00d1c3f96410a0c69ea8dfcf5f34e0x09d9a8112621ea106c4c0df7cc4545852ac16fc21.124999999999999999 Ether
0x5ddbbf1ee434cdc612110c42aa39e2a393eb835e66bea6a442a0078304ff8e93394550317 mins ago0xece701c76bd00d1c3f96410a0c69ea8dfcf5f34e0x6f28b146804dba2d6f944c03528a8fdbc673df2c0.0048441638126592 Ether
0x9ced4085ed68f3c4ab756ff2d7a490d160f023335c50f7c96781d32e68d65e30394550317 mins ago0xece701c76bd00d1c3f96410a0c69ea8dfcf5f34e0x6f28b146804dba2d6f944c03528a8fdbc673df2c0.0048441638126592 Ether
0x65b36cb7f8280fc846f560c170a46da88fe4fd89a033cadd7567ff07abac9337394550217 mins ago0xece701c76bd00d1c3f96410a0c69ea8dfcf5f34e0x6f28b146804dba2d6f944c03528a8fdbc673df2c0.0048441638126592 Ether
0x3654dda56c74bdfc7e856bce5d09ef98ddc59760dfa291638f049906e3ee8cbb394549121 mins ago0xece701c76bd00d1c3f96410a0c69ea8dfcf5f34e0x6f28b146804dba2d6f944c03528a8fdbc673df2c0.0048441638126592 Ether
0x432e346ebbea3ae4d1f55fbda7abbb1e5981ab27cca732c21bb055af05beed0a394548523 mins ago0xece701c76bd00d1c3f96410a0c69ea8dfcf5f34e0xd509e170b391309e0dbdb761d5aafdb4dfa5c1351 wei
0xe185fb3cc82be66b30f7e36443de5c0ea6141b0a057818fb4197666251d29cb8394548224 mins ago0xece701c76bd00d1c3f96410a0c69ea8dfcf5f34e0xc5bd85f41da515e2e5c0dea22207bc96386f6a330.510309278350515463 Ether

[Download: CSV Export ]    
Warning: The compiled contract might be susceptible to SkipEmptyStringLiteral (low-severity), ConstantOptimizerSubtraction (low-severity) Solidity compiler bugs.

Contract Source Code Verified
Contract Name: Etheroll
Compiler Version: v0.4.10+commit.f0d539ae
Optimization Enabled: Yes
Online Solidity Editor:  -NA-



  Contract Source Code   Find Similiar Contracts
pragma solidity ^0.4.2;

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

contract OraclizeI {
    address public cbAddress;
    function query(uint _timestamp, string _datasource, string _arg) payable returns (bytes32 _id);
    function query_withGasLimit(uint _timestamp, string _datasource, string _arg, uint _gaslimit) payable returns (bytes32 _id);
    function query2(uint _timestamp, string _datasource, string _arg1, string _arg2) payable returns (bytes32 _id);
    function query2_withGasLimit(uint _timestamp, string _datasource, string _arg1, string _arg2, uint _gaslimit) payable returns (bytes32 _id);
    function queryN(uint _timestamp, string _datasource, bytes _argN) payable returns (bytes32 _id);
    function queryN_withGasLimit(uint _timestamp, string _datasource, bytes _argN, uint _gaslimit) payable returns (bytes32 _id);
    function getPrice(string _datasource) returns (uint _dsprice);
    function getPrice(string _datasource, uint gaslimit) returns (uint _dsprice);
    function useCoupon(string _coupon);
    function setProofType(byte _proofType);
    function setConfig(bytes32 _config);
    function setCustomGasPrice(uint _gasPrice);
}
contract OraclizeAddrResolverI {
    function getAddress() returns (address _addr);
}
contract usingOraclize {
    uint constant day = 60*60*24;
    uint constant week = 60*60*24*7;
    uint constant month = 60*60*24*30;
    byte constant proofType_NONE = 0x00;
    byte constant proofType_TLSNotary = 0x10;
    byte constant proofStorage_IPFS = 0x01;
    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);
        oraclize = OraclizeI(OAR.getAddress());
        _;
    }
    modifier coupon(string code){
        oraclize = OraclizeI(OAR.getAddress());
        oraclize.useCoupon(code);
        _;
    }

    function oraclize_setNetwork(uint8 networkID) internal returns(bool){
        if (getCodeSize(0x1d3B2638a7cC9f2CB3D298A3DA7a90B67E5506ed)>0){ //mainnet
            OAR = OraclizeAddrResolverI(0x1d3B2638a7cC9f2CB3D298A3DA7a90B67E5506ed);
            return true;
        }
        if (getCodeSize(0xc03A2615D5efaf5F49F60B7BB6583eaec212fdf1)>0){ //ropsten testnet
            OAR = OraclizeAddrResolverI(0xc03A2615D5efaf5F49F60B7BB6583eaec212fdf1);
            return true;
        }
        if (getCodeSize(0xB7A07BcF2Ba2f2703b24C0691b5278999C59AC7e)>0){ //kovan testnet
            OAR = OraclizeAddrResolverI(0xB7A07BcF2Ba2f2703b24C0691b5278999C59AC7e);
            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) {
        __callback(myid, result, new bytes(0));
    }
    function __callback(bytes32 myid, string result, bytes proof) {
    }

    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_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_setConfig(bytes32 config) oraclizeAPI internal {
        return oraclize.setConfig(config);
    }

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

    function parseAddr(string _a) internal returns (address){
        bytes memory tmp = bytes(_a);
        uint160 iaddr = 0;
        uint160 b1;
        uint160 b2;
        for (uint i=2; i<2+2*20; i+=2){
            iaddr *= 256;
            b1 = uint160(tmp[i]);
            b2 = uint160(tmp[i+1]);
            if ((b1 >= 97)&&(b1 <= 102)) b1 -= 87;
            else if ((b1 >= 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 returns (int) {
        bytes memory a = bytes(_a);
        bytes memory b = bytes(_b);
        uint minLength = a.length;
        if (b.length < minLength) minLength = b.length;
        for (uint i = 0; i < minLength; i ++)
            if (a[i] < b[i])
                return -1;
            else if (a[i] > b[i])
                return 1;
        if (a.length < b.length)
            return -1;
        else if (a.length > b.length)
            return 1;
        else
            return 0;
    }

    function indexOf(string _haystack, string _needle) internal returns (int) {
        bytes memory h = bytes(_haystack);
        bytes memory n = bytes(_needle);
        if(h.length < 1 || n.length < 1 || (n.length > h.length))
            return -1;
        else if(h.length > (2**128 -1))
            return -1;
        else
        {
            uint subindex = 0;
            for (uint i = 0; i < h.length; i ++)
            {
                if (h[i] == n[0])
                {
                    subindex = 1;
                    while(subindex < n.length && (i + subindex) < h.length && h[i + subindex] == n[subindex])
                    {
                        subindex++;
                    }
                    if(subindex == n.length)
                        return int(i);
                }
            }
            return -1;
        }
    }

    function strConcat(string _a, string _b, string _c, string _d, string _e) internal 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 returns (string) {
        return strConcat(_a, _b, _c, _d, "");
    }

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

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

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

    // parseInt(parseFloat*10^_b)
    function parseInt(string _a, uint _b) internal returns (uint) {
        bytes memory bresult = bytes(_a);
        uint mint = 0;
        bool decimals = false;
        for (uint i=0; i<bresult.length; i++){
            if ((bresult[i] >= 48)&&(bresult[i] <= 57)){
                if (decimals){
                   if (_b == 0) break;
                    else _b--;
                }
                mint *= 10;
                mint += uint(bresult[i]) - 48;
            } else if (bresult[i] == 46) decimals = true;
        }
        if (_b > 0) mint *= 10**_b;
        return mint;
    }

    function uint2str(uint i) internal 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 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;
        }
}
// </ORACLIZE_API>

/*
 * @title String & slice utility library for Solidity contracts.
 * @author Nick Johnson <arachnid@notdot.net>
 *
 * @dev Functionality in this library is largely implemented using an
 *      abstraction called a 'slice'. A slice represents a part of a string -
 *      anything from the entire string to a single character, or even no
 *      characters at all (a 0-length slice). Since a slice only has to specify
 *      an offset and a length, copying and manipulating slices is a lot less
 *      expensive than copying and manipulating the strings they reference.
 *
 *      To further reduce gas costs, most functions on slice that need to return
 *      a slice modify the original one instead of allocating a new one; for
 *      instance, `s.split(".")` will return the text up to the first '.',
 *      modifying s to only contain the remainder of the string after the '.'.
 *      In situations where you do not want to modify the original slice, you
 *      can make a copy first with `.copy()`, for example:
 *      `s.copy().split(".")`. Try and avoid using this idiom in loops; since
 *      Solidity has no memory management, it will result in allocating many
 *      short-lived slices that are later discarded.
 *
 *      Functions that return two slices come in two versions: a non-allocating
 *      version that takes the second slice as an argument, modifying it in
 *      place, and an allocating version that allocates and returns the second
 *      slice; see `nextRune` for example.
 *
 *      Functions that have to copy string data will return strings rather than
 *      slices; these can be cast back to slices for further processing if
 *      required.
 *
 *      For convenience, some functions are provided with non-modifying
 *      variants that create a new slice and return both; for instance,
 *      `s.splitNew('.')` leaves s unmodified, and returns two values
 *      corresponding to the left and right parts of the string.
 */
library strings {
    struct slice {
        uint _len;
        uint _ptr;
    }

    function memcpy(uint dest, uint src, uint len) private {
        // Copy word-length chunks while possible
        for(; len >= 32; len -= 32) {
            assembly {
                mstore(dest, mload(src))
            }
            dest += 32;
            src += 32;
        }

        // Copy remaining bytes
        uint mask = 256 ** (32 - len) - 1;
        assembly {
            let srcpart := and(mload(src), not(mask))
            let destpart := and(mload(dest), mask)
            mstore(dest, or(destpart, srcpart))
        }
    }

    /*
     * @dev Returns a slice containing the entire string.
     * @param self The string to make a slice from.
     * @return A newly allocated slice containing the entire string.
     */
    function toSlice(string self) internal returns (slice) {
        uint ptr;
        assembly {
            ptr := add(self, 0x20)
        }
        return slice(bytes(self).length, ptr);
    }

    /*
     * @dev Returns the length of a null-terminated bytes32 string.
     * @param self The value to find the length of.
     * @return The length of the string, from 0 to 32.
     */
    function len(bytes32 self) internal returns (uint) {
        uint ret;
        if (self == 0)
            return 0;
        if (self & 0xffffffffffffffffffffffffffffffff == 0) {
            ret += 16;
            self = bytes32(uint(self) / 0x100000000000000000000000000000000);
        }
        if (self & 0xffffffffffffffff == 0) {
            ret += 8;
            self = bytes32(uint(self) / 0x10000000000000000);
        }
        if (self & 0xffffffff == 0) {
            ret += 4;
            self = bytes32(uint(self) / 0x100000000);
        }
        if (self & 0xffff == 0) {
            ret += 2;
            self = bytes32(uint(self) / 0x10000);
        }
        if (self & 0xff == 0) {
            ret += 1;
        }
        return 32 - ret;
    }

    /*
     * @dev Returns a slice containing the entire bytes32, interpreted as a
     *      null-termintaed utf-8 string.
     * @param self The bytes32 value to convert to a slice.
     * @return A new slice containing the value of the input argument up to the
     *         first null.
     */
    function toSliceB32(bytes32 self) internal returns (slice ret) {
        // Allocate space for `self` in memory, copy it there, and point ret at it
        assembly {
            let ptr := mload(0x40)
            mstore(0x40, add(ptr, 0x20))
            mstore(ptr, self)
            mstore(add(ret, 0x20), ptr)
        }
        ret._len = len(self);
    }

    /*
     * @dev Returns a new slice containing the same data as the current slice.
     * @param self The slice to copy.
     * @return A new slice containing the same data as `self`.
     */
    function copy(slice self) internal returns (slice) {
        return slice(self._len, self._ptr);
    }

    /*
     * @dev Copies a slice to a new string.
     * @param self The slice to copy.
     * @return A newly allocated string containing the slice's text.
     */
    function toString(slice self) internal returns (string) {
        var ret = new string(self._len);
        uint retptr;
        assembly { retptr := add(ret, 32) }

        memcpy(retptr, self._ptr, self._len);
        return ret;
    }

    /*
     * @dev Returns the length in runes of the slice. Note that this operation
     *      takes time proportional to the length of the slice; avoid using it
     *      in loops, and call `slice.empty()` if you only need to know whether
     *      the slice is empty or not.
     * @param self The slice to operate on.
     * @return The length of the slice in runes.
     */
    function len(slice self) internal returns (uint) {
        // Starting at ptr-31 means the LSB will be the byte we care about
        var ptr = self._ptr - 31;
        var end = ptr + self._len;
        for (uint len = 0; ptr < end; len++) {
            uint8 b;
            assembly { b := and(mload(ptr), 0xFF) }
            if (b < 0x80) {
                ptr += 1;
            } else if(b < 0xE0) {
                ptr += 2;
            } else if(b < 0xF0) {
                ptr += 3;
            } else if(b < 0xF8) {
                ptr += 4;
            } else if(b < 0xFC) {
                ptr += 5;
            } else {
                ptr += 6;
            }
        }
        return len;
    }

    /*
     * @dev Returns true if the slice is empty (has a length of 0).
     * @param self The slice to operate on.
     * @return True if the slice is empty, False otherwise.
     */
    function empty(slice self) internal returns (bool) {
        return self._len == 0;
    }

    /*
     * @dev Returns a positive number if `other` comes lexicographically after
     *      `self`, a negative number if it comes before, or zero if the
     *      contents of the two slices are equal. Comparison is done per-rune,
     *      on unicode codepoints.
     * @param self The first slice to compare.
     * @param other The second slice to compare.
     * @return The result of the comparison.
     */
    function compare(slice self, slice other) internal returns (int) {
        uint shortest = self._len;
        if (other._len < self._len)
            shortest = other._len;

        var selfptr = self._ptr;
        var otherptr = other._ptr;
        for (uint idx = 0; idx < shortest; idx += 32) {
            uint a;
            uint b;
            assembly {
                a := mload(selfptr)
                b := mload(otherptr)
            }
            if (a != b) {
                // Mask out irrelevant bytes and check again
                uint mask = ~(2 ** (8 * (32 - shortest + idx)) - 1);
                var diff = (a & mask) - (b & mask);
                if (diff != 0)
                    return int(diff);
            }
            selfptr += 32;
            otherptr += 32;
        }
        return int(self._len) - int(other._len);
    }

    /*
     * @dev Returns true if the two slices contain the same text.
     * @param self The first slice to compare.
     * @param self The second slice to compare.
     * @return True if the slices are equal, false otherwise.
     */
    function equals(slice self, slice other) internal returns (bool) {
        return compare(self, other) == 0;
    }

    /*
     * @dev Extracts the first rune in the slice into `rune`, advancing the
     *      slice to point to the next rune and returning `self`.
     * @param self The slice to operate on.
     * @param rune The slice that will contain the first rune.
     * @return `rune`.
     */
    function nextRune(slice self, slice rune) internal returns (slice) {
        rune._ptr = self._ptr;

        if (self._len == 0) {
            rune._len = 0;
            return rune;
        }

        uint len;
        uint b;
        // Load the first byte of the rune into the LSBs of b
        assembly { b := and(mload(sub(mload(add(self, 32)), 31)), 0xFF) }
        if (b < 0x80) {
            len = 1;
        } else if(b < 0xE0) {
            len = 2;
        } else if(b < 0xF0) {
            len = 3;
        } else {
            len = 4;
        }

        // Check for truncated codepoints
        if (len > self._len) {
            rune._len = self._len;
            self._ptr += self._len;
            self._len = 0;
            return rune;
        }

        self._ptr += len;
        self._len -= len;
        rune._len = len;
        return rune;
    }

    /*
     * @dev Returns the first rune in the slice, advancing the slice to point
     *      to the next rune.
     * @param self The slice to operate on.
     * @return A slice containing only the first rune from `self`.
     */
    function nextRune(slice self) internal returns (slice ret) {
        nextRune(self, ret);
    }

    /*
     * @dev Returns the number of the first codepoint in the slice.
     * @param self The slice to operate on.
     * @return The number of the first codepoint in the slice.
     */
    function ord(slice self) internal returns (uint ret) {
        if (self._len == 0) {
            return 0;
        }

        uint word;
        uint len;
        uint div = 2 ** 248;

        // Load the rune into the MSBs of b
        assembly { word:= mload(mload(add(self, 32))) }
        var b = word / div;
        if (b < 0x80) {
            ret = b;
            len = 1;
        } else if(b < 0xE0) {
            ret = b & 0x1F;
            len = 2;
        } else if(b < 0xF0) {
            ret = b & 0x0F;
            len = 3;
        } else {
            ret = b & 0x07;
            len = 4;
        }

        // Check for truncated codepoints
        if (len > self._len) {
            return 0;
        }

        for (uint i = 1; i < len; i++) {
            div = div / 256;
            b = (word / div) & 0xFF;
            if (b & 0xC0 != 0x80) {
                // Invalid UTF-8 sequence
                return 0;
            }
            ret = (ret * 64) | (b & 0x3F);
        }

        return ret;
    }

    /*
     * @dev Returns the keccak-256 hash of the slice.
     * @param self The slice to hash.
     * @return The hash of the slice.
     */
    function keccak(slice self) internal returns (bytes32 ret) {
        assembly {
            ret := sha3(mload(add(self, 32)), mload(self))
        }
    }

    /*
     * @dev Returns true if `self` starts with `needle`.
     * @param self The slice to operate on.
     * @param needle The slice to search for.
     * @return True if the slice starts with the provided text, false otherwise.
     */
    function startsWith(slice self, slice needle) internal returns (bool) {
        if (self._len < needle._len) {
            return false;
        }

        if (self._ptr == needle._ptr) {
            return true;
        }

        bool equal;
        assembly {
            let len := mload(needle)
            let selfptr := mload(add(self, 0x20))
            let needleptr := mload(add(needle, 0x20))
            equal := eq(sha3(selfptr, len), sha3(needleptr, len))
        }
        return equal;
    }

    /*
     * @dev If `self` starts with `needle`, `needle` is removed from the
     *      beginning of `self`. Otherwise, `self` is unmodified.
     * @param self The slice to operate on.
     * @param needle The slice to search for.
     * @return `self`
     */
    function beyond(slice self, slice needle) internal returns (slice) {
        if (self._len < needle._len) {
            return self;
        }

        bool equal = true;
        if (self._ptr != needle._ptr) {
            assembly {
                let len := mload(needle)
                let selfptr := mload(add(self, 0x20))
                let needleptr := mload(add(needle, 0x20))
                equal := eq(sha3(selfptr, len), sha3(needleptr, len))
            }
        }

        if (equal) {
            self._len -= needle._len;
            self._ptr += needle._len;
        }

        return self;
    }

    /*
     * @dev Returns true if the slice ends with `needle`.
     * @param self The slice to operate on.
     * @param needle The slice to search for.
     * @return True if the slice starts with the provided text, false otherwise.
     */
    function endsWith(slice self, slice needle) internal returns (bool) {
        if (self._len < needle._len) {
            return false;
        }

        var selfptr = self._ptr + self._len - needle._len;

        if (selfptr == needle._ptr) {
            return true;
        }

        bool equal;
        assembly {
            let len := mload(needle)
            let needleptr := mload(add(needle, 0x20))
            equal := eq(sha3(selfptr, len), sha3(needleptr, len))
        }

        return equal;
    }

    /*
     * @dev If `self` ends with `needle`, `needle` is removed from the
     *      end of `self`. Otherwise, `self` is unmodified.
     * @param self The slice to operate on.
     * @param needle The slice to search for.
     * @return `self`
     */
    function until(slice self, slice needle) internal returns (slice) {
        if (self._len < needle._len) {
            return self;
        }

        var selfptr = self._ptr + self._len - needle._len;
        bool equal = true;
        if (selfptr != needle._ptr) {
            assembly {
                let len := mload(needle)
                let needleptr := mload(add(needle, 0x20))
                equal := eq(sha3(selfptr, len), sha3(needleptr, len))
            }
        }

        if (equal) {
            self._len -= needle._len;
        }

        return self;
    }

    // Returns the memory address of the first byte of the first occurrence of
    // `needle` in `self`, or the first byte after `self` if not found.
    function findPtr(uint selflen, uint selfptr, uint needlelen, uint needleptr) private returns (uint) {
        uint ptr;
        uint idx;

        if (needlelen <= selflen) {
            if (needlelen <= 32) {
                // Optimized assembly for 68 gas per byte on short strings
                assembly {
                    let mask := not(sub(exp(2, mul(8, sub(32, needlelen))), 1))
                    let needledata := and(mload(needleptr), mask)
                    let end := add(selfptr, sub(selflen, needlelen))
                    ptr := selfptr
                    loop:
                    jumpi(exit, eq(and(mload(ptr), mask), needledata))
                    ptr := add(ptr, 1)
                    jumpi(loop, lt(sub(ptr, 1), end))
                    ptr := add(selfptr, selflen)
                    exit:
                }
                return ptr;
            } else {
                // For long needles, use hashing
                bytes32 hash;
                assembly { hash := sha3(needleptr, needlelen) }
                ptr = selfptr;
                for (idx = 0; idx <= selflen - needlelen; idx++) {
                    bytes32 testHash;
                    assembly { testHash := sha3(ptr, needlelen) }
                    if (hash == testHash)
                        return ptr;
                    ptr += 1;
                }
            }
        }
        return selfptr + selflen;
    }

    // Returns the memory address of the first byte after the last occurrence of
    // `needle` in `self`, or the address of `self` if not found.
    function rfindPtr(uint selflen, uint selfptr, uint needlelen, uint needleptr) private returns (uint) {
        uint ptr;

        if (needlelen <= selflen) {
            if (needlelen <= 32) {
                // Optimized assembly for 69 gas per byte on short strings
                assembly {
                    let mask := not(sub(exp(2, mul(8, sub(32, needlelen))), 1))
                    let needledata := and(mload(needleptr), mask)
                    ptr := add(selfptr, sub(selflen, needlelen))
                    loop:
                    jumpi(ret, eq(and(mload(ptr), mask), needledata))
                    ptr := sub(ptr, 1)
                    jumpi(loop, gt(add(ptr, 1), selfptr))
                    ptr := selfptr
                    jump(exit)
                    ret:
                    ptr := add(ptr, needlelen)
                    exit:
                }
                return ptr;
            } else {
                // For long needles, use hashing
                bytes32 hash;
                assembly { hash := sha3(needleptr, needlelen) }
                ptr = selfptr + (selflen - needlelen);
                while (ptr >= selfptr) {
                    bytes32 testHash;
                    assembly { testHash := sha3(ptr, needlelen) }
                    if (hash == testHash)
                        return ptr + needlelen;
                    ptr -= 1;
                }
            }
        }
        return selfptr;
    }

    /*
     * @dev Modifies `self` to contain everything from the first occurrence of
     *      `needle` to the end of the slice. `self` is set to the empty slice
     *      if `needle` is not found.
     * @param self The slice to search and modify.
     * @param needle The text to search for.
     * @return `self`.
     */
    function find(slice self, slice needle) internal returns (slice) {
        uint ptr = findPtr(self._len, self._ptr, needle._len, needle._ptr);
        self._len -= ptr - self._ptr;
        self._ptr = ptr;
        return self;
    }

    /*
     * @dev Modifies `self` to contain the part of the string from the start of
     *      `self` to the end of the first occurrence of `needle`. If `needle`
     *      is not found, `self` is set to the empty slice.
     * @param self The slice to search and modify.
     * @param needle The text to search for.
     * @return `self`.
     */
    function rfind(slice self, slice needle) internal returns (slice) {
        uint ptr = rfindPtr(self._len, self._ptr, needle._len, needle._ptr);
        self._len = ptr - self._ptr;
        return self;
    }

    /*
     * @dev Splits the slice, setting `self` to everything after the first
     *      occurrence of `needle`, and `token` to everything before it. If
     *      `needle` does not occur in `self`, `self` is set to the empty slice,
     *      and `token` is set to the entirety of `self`.
     * @param self The slice to split.
     * @param needle The text to search for in `self`.
     * @param token An output parameter to which the first token is written.
     * @return `token`.
     */
    function split(slice self, slice needle, slice token) internal returns (slice) {
        uint ptr = findPtr(self._len, self._ptr, needle._len, needle._ptr);
        token._ptr = self._ptr;
        token._len = ptr - self._ptr;
        if (ptr == self._ptr + self._len) {
            // Not found
            self._len = 0;
        } else {
            self._len -= token._len + needle._len;
            self._ptr = ptr + needle._len;
        }
        return token;
    }

    /*
     * @dev Splits the slice, setting `self` to everything after the first
     *      occurrence of `needle`, and returning everything before it. If
     *      `needle` does not occur in `self`, `self` is set to the empty slice,
     *      and the entirety of `self` is returned.
     * @param self The slice to split.
     * @param needle The text to search for in `self`.
     * @return The part of `self` up to the first occurrence of `delim`.
     */
    function split(slice self, slice needle) internal returns (slice token) {
        split(self, needle, token);
    }

    /*
     * @dev Splits the slice, setting `self` to everything before the last
     *      occurrence of `needle`, and `token` to everything after it. If
     *      `needle` does not occur in `self`, `self` is set to the empty slice,
     *      and `token` is set to the entirety of `self`.
     * @param self The slice to split.
     * @param needle The text to search for in `self`.
     * @param token An output parameter to which the first token is written.
     * @return `token`.
     */
    function rsplit(slice self, slice needle, slice token) internal returns (slice) {
        uint ptr = rfindPtr(self._len, self._ptr, needle._len, needle._ptr);
        token._ptr = ptr;
        token._len = self._len - (ptr - self._ptr);
        if (ptr == self._ptr) {
            // Not found
            self._len = 0;
        } else {
            self._len -= token._len + needle._len;
        }
        return token;
    }

    /*
     * @dev Splits the slice, setting `self` to everything before the last
     *      occurrence of `needle`, and returning everything after it. If
     *      `needle` does not occur in `self`, `self` is set to the empty slice,
     *      and the entirety of `self` is returned.
     * @param self The slice to split.
     * @param needle The text to search for in `self`.
     * @return The part of `self` after the last occurrence of `delim`.
     */
    function rsplit(slice self, slice needle) internal returns (slice token) {
        rsplit(self, needle, token);
    }

    /*
     * @dev Counts the number of nonoverlapping occurrences of `needle` in `self`.
     * @param self The slice to search.
     * @param needle The text to search for in `self`.
     * @return The number of occurrences of `needle` found in `self`.
     */
    function count(slice self, slice needle) internal returns (uint count) {
        uint ptr = findPtr(self._len, self._ptr, needle._len, needle._ptr) + needle._len;
        while (ptr <= self._ptr + self._len) {
            count++;
            ptr = findPtr(self._len - (ptr - self._ptr), ptr, needle._len, needle._ptr) + needle._len;
        }
    }

    /*
     * @dev Returns True if `self` contains `needle`.
     * @param self The slice to search.
     * @param needle The text to search for in `self`.
     * @return True if `needle` is found in `self`, false otherwise.
     */
    function contains(slice self, slice needle) internal returns (bool) {
        return rfindPtr(self._len, self._ptr, needle._len, needle._ptr) != self._ptr;
    }

    /*
     * @dev Returns a newly allocated string containing the concatenation of
     *      `self` and `other`.
     * @param self The first slice to concatenate.
     * @param other The second slice to concatenate.
     * @return The concatenation of the two strings.
     */
    function concat(slice self, slice other) internal returns (string) {
        var ret = new string(self._len + other._len);
        uint retptr;
        assembly { retptr := add(ret, 32) }
        memcpy(retptr, self._ptr, self._len);
        memcpy(retptr + self._len, other._ptr, other._len);
        return ret;
    }

    /*
     * @dev Joins an array of slices, using `self` as a delimiter, returning a
     *      newly allocated string.
     * @param self The delimiter to use.
     * @param parts A list of slices to join.
     * @return A newly allocated string containing all the slices in `parts`,
     *         joined with `self`.
     */
    function join(slice self, slice[] parts) internal returns (string) {
        if (parts.length == 0)
            return "";

        uint len = self._len * (parts.length - 1);
        for(uint i = 0; i < parts.length; i++)
            len += parts[i]._len;

        var ret = new string(len);
        uint retptr;
        assembly { retptr := add(ret, 32) }

        for(i = 0; i < parts.length; i++) {
            memcpy(retptr, parts[i]._ptr, parts[i]._len);
            retptr += parts[i]._len;
            if (i < parts.length - 1) {
                memcpy(retptr, self._ptr, self._len);
                retptr += self._len;
            }
        }

        return ret;
    }
}


contract DSSafeAddSub {
    function safeToAdd(uint a, uint b) internal returns (bool) {
        return (a + b >= a);
    }
    function safeAdd(uint a, uint b) internal returns (uint) {
        if (!safeToAdd(a, b)) throw;
        return a + b;
    }

    function safeToSubtract(uint a, uint b) internal returns (bool) {
        return (b <= a);
    }

    function safeSub(uint a, uint b) internal returns (uint) {
        if (!safeToSubtract(a, b)) throw;
        return a - b;
    } 
}



contract Etheroll is usingOraclize, DSSafeAddSub {
    
     using strings for *;

    /*
     * checks player profit, bet size and player number is within range
    */
    modifier betIsValid(uint _betSize, uint _playerNumber) {      
        if(((((_betSize * (100-(safeSub(_playerNumber,1)))) / (safeSub(_playerNumber,1))+_betSize))*houseEdge/houseEdgeDivisor)-_betSize > maxProfit || _betSize < minBet || _playerNumber < minNumber || _playerNumber > maxNumber) throw;        
		_;
    }

    /*
     * checks game is currently active
    */
    modifier gameIsActive {
        if(gamePaused == true) throw;
		_;
    }    

    /*
     * checks payouts are currently active
    */
    modifier payoutsAreActive {
        if(payoutsPaused == true) throw;
		_;
    }    

    /*
     * checks only Oraclize address is calling
    */
    modifier onlyOraclize {
        if (msg.sender != oraclize_cbAddress()) throw;
        _;
    }

    /*
     * checks only owner address is calling
    */
    modifier onlyOwner {
         if (msg.sender != owner) throw;
         _;
    }

    /*
     * checks only treasury address is calling
    */
    modifier onlyTreasury {
         if (msg.sender != treasury) throw;
         _;
    }    

    /*
     * game vars
    */ 
    uint constant public maxProfitDivisor = 1000000;
    uint constant public houseEdgeDivisor = 1000;    
    uint constant public maxNumber = 99; 
    uint constant public minNumber = 2;
	bool public gamePaused;
    uint32 public gasForOraclize;
    address public owner;
    bool public payoutsPaused; 
    address public treasury;
    uint public contractBalance;
    uint public houseEdge;     
    uint public maxProfit;   
    uint public maxProfitAsPercentOfHouse;                    
    uint public minBet; 
    //init dicontinued contract data          
    int public totalBets = 5671;
    uint public maxPendingPayouts;
    //init dicontinued contract data      
    uint public totalWeiWon = 2091633232860934129948;
    //init dicontinued contract data  
    uint public totalWeiWagered = 10852397031892670514693;    

    /*
     * player vars
    */
    mapping (bytes32 => address) playerAddress;
    mapping (bytes32 => address) playerTempAddress;
    mapping (bytes32 => bytes32) playerBetId;
    mapping (bytes32 => uint) playerBetValue;
    mapping (bytes32 => uint) playerTempBetValue;       
    mapping (bytes32 => uint) playerDieResult;
    mapping (bytes32 => uint) playerNumber;
    mapping (address => uint) playerPendingWithdrawals;      
    mapping (bytes32 => uint) playerProfit;
    mapping (bytes32 => uint) playerTempReward;           

    /*
     * events
    */
    /* log bets + output to web3 for precise 'payout on win' field in UI */
    event LogBet(bytes32 indexed BetID, address indexed PlayerAddress, uint indexed RewardValue, uint ProfitValue, uint BetValue, uint PlayerNumber);      
    /* output to web3 UI on bet result*/
    /* Status: 0=lose, 1=win, 2=win + failed send, 3=refund, 4=refund + failed send*/
	event LogResult(uint indexed ResultSerialNumber, bytes32 indexed BetID, address indexed PlayerAddress, uint PlayerNumber, uint DiceResult, uint Value, int Status, bytes Proof);   
    /* log manual refunds */
    event LogRefund(bytes32 indexed BetID, address indexed PlayerAddress, uint indexed RefundValue);
    /* log owner transfers */
    event LogOwnerTransfer(address indexed SentToAddress, uint indexed AmountTransferred);               


    /*
     * init
    */
    function Etheroll() {

        owner = msg.sender;
        treasury = msg.sender;
        
        oraclize_setNetwork(networkID_auto);        
        /* use TLSNotary for oraclize call */
        oraclize_setProof(proofType_TLSNotary | proofStorage_IPFS);
        /* init 990 = 99% (1% houseEdge)*/
        ownerSetHouseEdge(990);
        /* init 10,000 = 1%  */
        ownerSetMaxProfitAsPercentOfHouse(10000);
        /* init min bet (0.1 ether) */
        ownerSetMinBet(100000000000000000);        
        /* init gas for oraclize */        
        gasForOraclize = 250000;        

    }

    /*
     * public function
     * player submit bet
     * only if game is active & bet is valid can query oraclize and set player vars     
    */
    function playerRollDice(uint rollUnder) public 
        payable
        gameIsActive
        betIsValid(msg.value, rollUnder)
	{        
        

        /* safely update contract balance to account for cost to call oraclize*/
        contractBalance = safeSub(contractBalance, oraclize_getPrice("URL", gasForOraclize));

        /* total number of bets */
        totalBets += 1;

        /* total wagered */
        totalWeiWagered += msg.value; 

        /*
        * assign partially encrypted query to oraclize
        * only the apiKey is encrypted 
        * integer query is in plain text
        */        
        bytes32 rngId = oraclize_query("nested", "[URL] ['json(https://api.random.org/json-rpc/1/invoke).result.random[\"serialNumber\",\"data\"]', '\\n{\"jsonrpc\":\"2.0\",\"method\":\"generateSignedIntegers\",\"params\":{\"apiKey\":${[decrypt] BLTr+ZtMOLP2SQVXx8GRscYuXv+3wY5zdFgrQZNMMY3oO/6C7OoQkgu3KgfBuiJWW1S3U/+ya10XFGHv2P7MB7VYwFIZd3VOMI/Os8o1uJCdGGZgpR0Dkm5QoNH7MbDM0wa2RewBqlVLFGoZX1PJC+igBPNoHC4=},\"n\":1,\"min\":1,\"max\":100,\"replacement\":true,\"base\":10${[identity] \"}\"},\"id\":1${[identity] \"}\"}']", gasForOraclize);
        	    
        /* map bet id to this oraclize query */
		playerBetId[rngId] = rngId;
        /* map player lucky number to this oraclize query */
		playerNumber[rngId] = rollUnder;
        /* map value of wager to this oraclize query */
        playerBetValue[rngId] = msg.value;
        /* map player address to this oraclize query */
        playerAddress[rngId] = msg.sender;
        /* safely map player profit to this oraclize query */                     
        playerProfit[rngId] = ((((msg.value * (100-(safeSub(rollUnder,1)))) / (safeSub(rollUnder,1))+msg.value))*houseEdge/houseEdgeDivisor)-msg.value;        
        /* safely increase maxPendingPayouts liability - calc all pending payouts under assumption they win */
        maxPendingPayouts = safeAdd(maxPendingPayouts, playerProfit[rngId]);
        /* check contract can payout on win */
        if(maxPendingPayouts >= contractBalance) throw;
        /* provides accurate numbers for web3 and allows for manual refunds in case of no oraclize __callback */
        LogBet(playerBetId[rngId], playerAddress[rngId], safeAdd(playerBetValue[rngId], playerProfit[rngId]), playerProfit[rngId], playerBetValue[rngId], playerNumber[rngId]);          

    }   
             

    /*
    * semi-public function - only oraclize can call
    */
    /*TLSNotary for oraclize call */
	function __callback(bytes32 myid, string result, bytes proof) public   
		onlyOraclize
		payoutsAreActive
	{  

        /* player address mapped to query id does not exist */
        if (playerAddress[myid]==0x0) throw;
        
        /* keep oraclize honest by retrieving the serialNumber from random.org result */
        var sl_result = result.toSlice();
        sl_result.beyond("[".toSlice()).until("]".toSlice());
        uint serialNumberOfResult = parseInt(sl_result.split(', '.toSlice()).toString());          

	    /* map result to player */
        playerDieResult[myid] = parseInt(sl_result.beyond("[".toSlice()).until("]".toSlice()).toString());
        
        /* get the playerAddress for this query id */
        playerTempAddress[myid] = playerAddress[myid];
        /* delete playerAddress for this query id */
        delete playerAddress[myid];

        /* map the playerProfit for this query id */
        playerTempReward[myid] = playerProfit[myid];
        /* set  playerProfit for this query id to 0 */
        playerProfit[myid] = 0; 

        /* safely reduce maxPendingPayouts liability */
        maxPendingPayouts = safeSub(maxPendingPayouts, playerTempReward[myid]);         

        /* map the playerBetValue for this query id */
        playerTempBetValue[myid] = playerBetValue[myid];
        /* set  playerBetValue for this query id to 0 */
        playerBetValue[myid] = 0;                                                   

        /*
        * refund
        * if result is 0 result is empty or no proof refund original bet value
        * if refund fails save refund value to playerPendingWithdrawals
        */
        if(playerDieResult[myid]==0 || bytes(result).length == 0 || bytes(proof).length == 0){                                                     

             LogResult(serialNumberOfResult, playerBetId[myid], playerTempAddress[myid], playerNumber[myid], playerDieResult[myid], playerTempBetValue[myid], 3, proof);            

            /*
            * send refund - external call to an untrusted contract
            * if send fails map refund value to playerPendingWithdrawals[address]
            * for withdrawal later via playerWithdrawPendingTransactions
            */
            if(!playerTempAddress[myid].send(playerTempBetValue[myid])){
                LogResult(serialNumberOfResult, playerBetId[myid], playerTempAddress[myid], playerNumber[myid], playerDieResult[myid], playerTempBetValue[myid], 4, proof);              
                /* if send failed let player withdraw via playerWithdrawPendingTransactions */
                playerPendingWithdrawals[playerTempAddress[myid]] = safeAdd(playerPendingWithdrawals[playerTempAddress[myid]], playerTempBetValue[myid]);                        
            }

            return;
        }

        /*
        * pay winner
        * update contract balance to calculate new max bet
        * send reward
        * if send of reward fails save value to playerPendingWithdrawals        
        */
        if(playerDieResult[myid] < playerNumber[myid]){ 

            /* safely reduce contract balance by player profit */
            contractBalance = safeSub(contractBalance, playerTempReward[myid]); 

            /* update total wei won */
            totalWeiWon = safeAdd(totalWeiWon, playerTempReward[myid]);              

            /* safely calculate payout via profit plus original wager */
            playerTempReward[myid] = safeAdd(playerTempReward[myid], playerTempBetValue[myid]); 

            LogResult(serialNumberOfResult, playerBetId[myid], playerTempAddress[myid], playerNumber[myid], playerDieResult[myid], playerTempReward[myid], 1, proof);                            

            /* update maximum profit */
            setMaxProfit();
            
            /*
            * send win - external call to an untrusted contract
            * if send fails map reward value to playerPendingWithdrawals[address]
            * for withdrawal later via playerWithdrawPendingTransactions
            */
            if(!playerTempAddress[myid].send(playerTempReward[myid])){
                LogResult(serialNumberOfResult, playerBetId[myid], playerTempAddress[myid], playerNumber[myid], playerDieResult[myid], playerTempReward[myid], 2, proof);                   
                /* if send failed let player withdraw via playerWithdrawPendingTransactions */
                playerPendingWithdrawals[playerTempAddress[myid]] = safeAdd(playerPendingWithdrawals[playerTempAddress[myid]], playerTempReward[myid]);                               
            }

            return;

        }

        /*
        * no win
        * send 1 wei to a losing bet
        * update contract balance to calculate new max bet
        */
        if(playerDieResult[myid] >= playerNumber[myid]){

            LogResult(serialNumberOfResult, playerBetId[myid], playerTempAddress[myid], playerNumber[myid], playerDieResult[myid], playerTempBetValue[myid], 0, proof);                                

            /*  
            *  safe adjust contractBalance
            *  setMaxProfit
            *  send 1 wei to losing bet
            */
            contractBalance = safeAdd(contractBalance, (playerTempBetValue[myid]-1));                                                                         

            /* update maximum profit */
            setMaxProfit(); 

            /*
            * send 1 wei - external call to an untrusted contract                  
            */
            if(!playerTempAddress[myid].send(1)){
                /* if send failed let player withdraw via playerWithdrawPendingTransactions */                
               playerPendingWithdrawals[playerTempAddress[myid]] = safeAdd(playerPendingWithdrawals[playerTempAddress[myid]], 1);                                
            }                                   

            return;

        }

    }
    
    /*
    * public function
    * in case of a failed refund or win send
    */
    function playerWithdrawPendingTransactions() public 
        payoutsAreActive
        returns (bool)
     {
        uint withdrawAmount = playerPendingWithdrawals[msg.sender];
        playerPendingWithdrawals[msg.sender] = 0;
        /* external call to untrusted contract */
        if (msg.sender.call.value(withdrawAmount)()) {
            return true;
        } else {
            /* if send failed revert playerPendingWithdrawals[msg.sender] = 0; */
            /* player can try to withdraw again later */
            playerPendingWithdrawals[msg.sender] = withdrawAmount;
            return false;
        }
    }

    /* check for pending withdrawals  */
    function playerGetPendingTxByAddress(address addressToCheck) public constant returns (uint) {
        return playerPendingWithdrawals[addressToCheck];
    }

    /*
    * internal function
    * sets max profit
    */
    function setMaxProfit() internal {
        maxProfit = (contractBalance*maxProfitAsPercentOfHouse)/maxProfitDivisor;  
    }   

    /*
    * owner/treasury address only functions
    */
    function ()
        payable
        onlyTreasury
    {
        /* safely update contract balance */
        contractBalance = safeAdd(contractBalance, msg.value);        
        /* update the maximum profit */
        setMaxProfit();
    } 

    /* set gas for oraclize query */
    function ownerSetOraclizeSafeGas(uint32 newSafeGasToOraclize) public 
		onlyOwner
	{
    	gasForOraclize = newSafeGasToOraclize;
    }

    /* only owner adjust contract balance variable (only used for max profit calc) */
    function ownerUpdateContractBalance(uint newContractBalanceInWei) public 
		onlyOwner
    {        
       contractBalance = newContractBalanceInWei;
    }    

    /* only owner address can set houseEdge */
    function ownerSetHouseEdge(uint newHouseEdge) public 
		onlyOwner
    {
        houseEdge = newHouseEdge;
    }

    /* only owner address can set maxProfitAsPercentOfHouse */
    function ownerSetMaxProfitAsPercentOfHouse(uint newMaxProfitAsPercent) public 
		onlyOwner
    {
        /* restrict each bet to a maximum profit of 1% contractBalance */
        if(newMaxProfitAsPercent > 10000) throw;
        maxProfitAsPercentOfHouse = newMaxProfitAsPercent;
        setMaxProfit();
    }

    /* only owner address can set minBet */
    function ownerSetMinBet(uint newMinimumBet) public 
		onlyOwner
    {
        minBet = newMinimumBet;
    }       

    /* only owner address can transfer ether */
    function ownerTransferEther(address sendTo, uint amount) public 
		onlyOwner
    {        
        /* safely update contract balance when sending out funds*/
        contractBalance = safeSub(contractBalance, amount);		
        /* update max profit */
        setMaxProfit();
        if(!sendTo.send(amount)) throw;
        LogOwnerTransfer(sendTo, amount); 
    }

    /* only owner address can do manual refund
    * used only if bet placed + oraclize failed to __callback
    * filter LogBet by address and/or playerBetId:
    * LogBet(playerBetId[rngId], playerAddress[rngId], safeAdd(playerBetValue[rngId], playerProfit[rngId]), playerProfit[rngId], playerBetValue[rngId], playerNumber[rngId]);
    * check the following logs do not exist for playerBetId and/or playerAddress[rngId] before refunding:
    * LogResult or LogRefund
    * if LogResult exists player should use the withdraw pattern playerWithdrawPendingTransactions 
    */
    function ownerRefundPlayer(bytes32 originalPlayerBetId, address sendTo, uint originalPlayerProfit, uint originalPlayerBetValue) public 
		onlyOwner
    {        
        /* safely reduce pendingPayouts by playerProfit[rngId] */
        maxPendingPayouts = safeSub(maxPendingPayouts, originalPlayerProfit);
        /* send refund */
        if(!sendTo.send(originalPlayerBetValue)) throw;
        /* log refunds */
        LogRefund(originalPlayerBetId, sendTo, originalPlayerBetValue);        
    }    

    /* only owner address can set emergency pause #1 */
    function ownerPauseGame(bool newStatus) public 
		onlyOwner
    {
		gamePaused = newStatus;
    }

    /* only owner address can set emergency pause #2 */
    function ownerPausePayouts(bool newPayoutStatus) public 
		onlyOwner
    {
		payoutsPaused = newPayoutStatus;
    } 

    /* only owner address can set treasury address */
    function ownerSetTreasury(address newTreasury) public 
		onlyOwner
	{
        treasury = newTreasury;
    }         

    /* only owner address can set owner address */
    function ownerChangeOwner(address newOwner) public 
		onlyOwner
	{
        owner = newOwner;
    }

    /* only owner address can suicide - emergency */
    function ownerkill() public 
		onlyOwner
	{
		suicide(owner);
	}    


}

  Contract ABI  
[{"constant":true,"inputs":[],"name":"totalWeiWon","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"maxProfitAsPercentOfHouse","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"newHouseEdge","type":"uint256"}],"name":"ownerSetHouseEdge","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"myid","type":"bytes32"},{"name":"result","type":"string"}],"name":"__callback","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"payoutsPaused","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"newTreasury","type":"address"}],"name":"ownerSetTreasury","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"myid","type":"bytes32"},{"name":"result","type":"string"},{"name":"proof","type":"bytes"}],"name":"__callback","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"maxNumber","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"addressToCheck","type":"address"}],"name":"playerGetPendingTxByAddress","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"newContractBalanceInWei","type":"uint256"}],"name":"ownerUpdateContractBalance","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"maxProfitDivisor","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"newPayoutStatus","type":"bool"}],"name":"ownerPausePayouts","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"ownerChangeOwner","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"minNumber","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"newMaxProfitAsPercent","type":"uint256"}],"name":"ownerSetMaxProfitAsPercentOfHouse","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"treasury","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"totalWeiWagered","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"newMinimumBet","type":"uint256"}],"name":"ownerSetMinBet","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"newStatus","type":"bool"}],"name":"ownerPauseGame","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"gasForOraclize","outputs":[{"name":"","type":"uint32"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"sendTo","type":"address"},{"name":"amount","type":"uint256"}],"name":"ownerTransferEther","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"contractBalance","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"minBet","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"playerWithdrawPendingTransactions","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"maxProfit","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"totalBets","outputs":[{"name":"","type":"int256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"gamePaused","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"originalPlayerBetId","type":"bytes32"},{"name":"sendTo","type":"address"},{"name":"originalPlayerProfit","type":"uint256"},{"name":"originalPlayerBetValue","type":"uint256"}],"name":"ownerRefundPlayer","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"newSafeGasToOraclize","type":"uint32"}],"name":"ownerSetOraclizeSafeGas","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"ownerkill","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"houseEdge","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"rollUnder","type":"uint256"}],"name":"playerRollDice","outputs":[],"payable":true,"type":"function"},{"constant":true,"inputs":[],"name":"houseEdgeDivisor","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"maxPendingPayouts","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"inputs":[],"payable":false,"type":"constructor"},{"payable":true,"type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"BetID","type":"bytes32"},{"indexed":true,"name":"PlayerAddress","type":"address"},{"indexed":true,"name":"RewardValue","type":"uint256"},{"indexed":false,"name":"ProfitValue","type":"uint256"},{"indexed":false,"name":"BetValue","type":"uint256"},{"indexed":false,"name":"PlayerNumber","type":"uint256"}],"name":"LogBet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"ResultSerialNumber","type":"uint256"},{"indexed":true,"name":"BetID","type":"bytes32"},{"indexed":true,"name":"PlayerAddress","type":"address"},{"indexed":false,"name":"PlayerNumber","type":"uint256"},{"indexed":false,"name":"DiceResult","type":"uint256"},{"indexed":false,"name":"Value","type":"uint256"},{"indexed":false,"name":"Status","type":"int256"},{"indexed":false,"name":"Proof","type":"bytes"}],"name":"LogResult","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"BetID","type":"bytes32"},{"indexed":true,"name":"PlayerAddress","type":"address"},{"indexed":true,"name":"RefundValue","type":"uint256"}],"name":"LogRefund","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"SentToAddress","type":"address"},{"indexed":true,"name":"AmountTransferred","type":"uint256"}],"name":"LogOwnerTransfer","type":"event"}]

  Contract Creation Code Switch To Opcodes View
60606040526116276009556871633dff56d5e1491c600b5569024c4f43620aea308605600c5534156200002e57fe5b5b60028054600160a060020a033316600160a060020a03199182168117909255600380549091169091179055620000746000640100000000620020b86200013982021704565b50620000ae7f1100000000000000000000000000000000000000000000000000000000000000640100000000620025e1620003a182021704565b620000c96103de6401000000006200071f6200053182021704565b620000e4612710640100000000620012ae6200055882021704565b6200010567016345785d8a000064010000000062001301620005a882021704565b6001805460a860020a63ffffffff0219167703d0900000000000000000000000000000000000000000001790555b620005eb565b60008062000169731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed640100000000620020b0620005cf82021704565b11156200019f575060008054600160a060020a031916731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed17905560016200039c565b6000620001ce73c03a2615d5efaf5f49f60b7bb6583eaec212fdf1640100000000620020b0620005cf82021704565b111562000204575060008054600160a060020a03191673c03a2615d5efaf5f49f60b7bb6583eaec212fdf117905560016200039c565b60006200023373b7a07bcf2ba2f2703b24c0691b5278999c59ac7e640100000000620020b0620005cf82021704565b111562000269575060008054600160a060020a03191673b7a07bcf2ba2f2703b24c0691b5278999c59ac7e17905560016200039c565b600062000298736f485c8bf6fc43ea212e93bbf8ce046c7f1cb475640100000000620020b0620005cf82021704565b1115620002ce575060008054600160a060020a031916736f485c8bf6fc43ea212e93bbf8ce046c7f1cb47517905560016200039c565b6000620002fd7320e12a1f859b3feae5fb2a0a32c18f5a65555bbf640100000000620020b0620005cf82021704565b111562000333575060008054600160a060020a0319167320e12a1f859b3feae5fb2a0a32c18f5a65555bbf17905560016200039c565b6000620003627351efaf4c8b3c9afbd5ab9f4bbc82784ab6ef8faa640100000000620020b0620005cf82021704565b111562000398575060008054600160a060020a0319167351efaf4c8b3c9afbd5ab9f4bbc82784ab6ef8faa17905560016200039c565b5060005b919050565b600054600160a060020a03161580620003dc5750600054620003da90600160a060020a0316640100000000620020b0620005cf82021704565b155b15620003fe57620003fc6000640100000000620020b86200013982021704565b505b600060009054906101000a9004600160a060020a0316600160a060020a03166338cc48316000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401809050602060405180830381600087803b15156200047357fe5b60325a03f115156200048157fe5b505060408051805160018054600160a060020a031916600160a060020a0392831617908190557f688dcfd70000000000000000000000000000000000000000000000000000000083527fff000000000000000000000000000000000000000000000000000000000000008616600484015292519216925063688dcfd791602480830192600092919082900301818387803b15156200051b57fe5b60325a03f115156200052957fe5b5050505b5b50565b60025433600160a060020a039081169116146200054e5760006000fd5b60058190555b5b50565b60025433600160a060020a03908116911614620005755760006000fd5b612710811115620005865760006000fd5b60078190556200052d640100000000620006ff620005d782021704565b5b5b50565b60025433600160a060020a03908116911614620005c55760006000fd5b60088190555b5b50565b803b5b919050565b600754600454620f424091025b046006555b565b61293280620005fb6000396000f3006060604052361561019b5763ffffffff60e060020a60003504166315c12d4d81146101d857806323214fab146101fa578063268d50fe1461021c57806327dc297e14610231578063301cf6e71461028a57806331375242146102ae57806338bbfa50146102cc5780633a4f6999146103625780633c314a91146103845780634025b5a8146103b257806343c1598d146103c75780634b7fcee7146103e95780634f44728d1461040057806355b930311461041e5780635e968a491461044057806361d027b314610455578063666f4cad146104815780636cdf4c90146104a35780636eacd48a146104b85780637072a977146104cf5780637ac37d58146104f85780638b7afe2e146105195780638da5cb5b1461053b5780639619367d14610567578063a5f4af3314610589578063b539cd55146105ad578063befa1e2f146105cf578063c3de1ab9146105f1578063cf832ce214610615578063d207e7571461063c578063d263b7eb14610657578063d667dcd714610669578063dc6dd1521461068b578063e5c774de14610698578063ed62f501146106ba575b6101d65b60035433600160a060020a039081169116146101bb5760006000fd5b6101c7600454346106dc565b6004556101d26106ff565b5b5b565b005b34156101e057fe5b6101e8610713565b60408051918252519081900360200190f35b341561020257fe5b6101e8610719565b60408051918252519081900360200190f35b341561022457fe5b6101d660043561071f565b005b341561023957fe5b60408051602060046024803582810135601f81018590048502860185019096528585526101d6958335959394604494939290920191819084018382808284375094965061074595505050505050565b005b341561029257fe5b61029a610775565b604080519115158252519081900360200190f35b34156102b657fe5b6101d6600160a060020a0360043516610785565b005b34156102d457fe5b60408051602060046024803582810135601f81018590048502860185019096528585526101d6958335959394604494939290920191819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979998810197919650918201945092508291508401838280828437509496506107c195505050505050565b005b341561036a57fe5b6101e86111d3565b60408051918252519081900360200190f35b341561038c57fe5b6101e8600160a060020a03600435166111d8565b60408051918252519081900360200190f35b34156103ba57fe5b6101d66004356111f7565b005b34156103cf57fe5b6101e861121d565b60408051918252519081900360200190f35b34156103f157fe5b6101d66004351515611224565b005b341561040857fe5b6101d6600160a060020a036004351661126d565b005b341561042657fe5b6101e86112a9565b60408051918252519081900360200190f35b341561044857fe5b6101d66004356112ae565b005b341561045d57fe5b6104656112ec565b60408051600160a060020a039092168252519081900360200190f35b341561048957fe5b6101e86112fb565b60408051918252519081900360200190f35b34156104ab57fe5b6101d6600435611301565b005b34156104c057fe5b6101d66004351515611327565b005b34156104d757fe5b6104df611370565b6040805163ffffffff9092168252519081900360200190f35b341561050057fe5b6101d6600160a060020a0360043516602435611383565b005b341561052157fe5b6101e8611423565b60408051918252519081900360200190f35b341561054357fe5b610465611429565b60408051600160a060020a039092168252519081900360200190f35b341561056f57fe5b6101e8611438565b60408051918252519081900360200190f35b341561059157fe5b61029a61143e565b604080519115158252519081900360200190f35b34156105b557fe5b6101e86114cd565b60408051918252519081900360200190f35b34156105d757fe5b6101e86114d3565b60408051918252519081900360200190f35b34156105f957fe5b61029a6114d9565b604080519115158252519081900360200190f35b341561061d57fe5b6101d6600435600160a060020a03602435166044356064356114e9565b005b341561064457fe5b6101d663ffffffff60043516611585565b005b341561065f57fe5b6101d66115d6565b005b341561067157fe5b6101e8611603565b60408051918252519081900360200190f35b6101d6600435611609565b005b34156106a057fe5b6101e86118d9565b60408051918252519081900360200190f35b34156106c257fe5b6101e86118df565b60408051918252519081900360200190f35b60006106e883836118e5565b15156106f45760006000fd5b508181015b92915050565b600754600454620f424091025b046006555b565b600b5481565b60075481565b60025433600160a060020a0390811691161461073b5760006000fd5b60058190555b5b50565b610770828260006040518059106107595750595b908082528060200260200182016040525b506107c1565b5b5050565b60025460a060020a900460ff1681565b60025433600160a060020a039081169116146107a15760006000fd5b60038054600160a060020a031916600160a060020a0383161790555b5b50565b6107c96125a6565b60006107d36118f3565b600160a060020a031633600160a060020a03161415156107f35760006000fd5b60025460a060020a900460ff161515600114156108105760006000fd5b6000858152600d6020526040902054600160a060020a031615156108345760006000fd5b61083d84611a2f565b91506108aa6108686040604051908101604052806001815260200160f860020a605d02815250611a2f565b61089e6108916040604051908101604052806001815260200160f860020a605b02815250611a2f565b859063ffffffff611a5816565b9063ffffffff611ac416565b5061090a6109056109006108f3604060405190810160405280600281526020017f2c20000000000000000000000000000000000000000000000000000000000000815250611a2f565b859063ffffffff611b2d16565b611b48565b611ba4565b905061098761090561090061093b6040604051908101604052806001815260200160f860020a605d02815250611a2f565b61089e6109646040604051908101604052806001815260200160f860020a605b02815250611a2f565b879063ffffffff611a5816565b9063ffffffff611ac416565b611b48565b611ba4565b600086815260126020908152604080832093909355600d81528282208054600e83528484208054600160a060020a03909216600160a060020a0319928316179055815416905560158152828220805460169092529282209081559155600a5490546109f29190611bb9565b600a5560008581526010602090815260408083208054601184528285205583905560129091529020541580610a2657508351155b80610a3057508251155b15610cce576000858152600e6020908152604080832054600f83528184205460138452828520546012855283862054601186529584902054845182815280870188905294850181905260036060860181905260a0608087018181528c51918801919091528b51600160a060020a039096169894978a97600080516020612733833981519152979596958e93919260c0840191908501908083838215610af0575b805182526020831115610af057601f199092019160209182019101610ad0565b505050905090810190601f168015610b1c5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a46000858152600e60209081526040808320546011909252808320549051600160a060020a039092169281156108fc029290818181858888f193505050501515610cc9576000858152600e6020908152604080832054600f83528184205460138452828520546012855283862054601186529584902054845182815280870188905294850181905260046060860181905260a0608087018181528c51918801919091528b51600160a060020a039096169894978a97600080516020612733833981519152979596958e93919260c0840191908501908083838215610c2b575b805182526020831115610c2b57601f199092019160209182019101610c0b565b505050905090810190601f168015610c575780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a46000858152600e6020908152604080832054600160a060020a031683526014825280832054888452601190925290912054610ca391906106dc565b6000868152600e6020908152604080832054600160a060020a0316835260149091529020555b6111c8565b6000858152601360209081526040808320546012909252909120541015610ff957600454600086815260166020526040902054610d0b9190611bb9565b600455600b54600086815260166020526040902054610d2a91906106dc565b600b55600085815260166020908152604080832054601190925290912054610d5291906106dc565b6000868152601660208181526040808420859055600e825280842054600f8352818520546013845282862054601285529583902054948452825186815280850186905292830187905260016060840181905260a0608085018181528c51918601919091528b51600160a060020a039094169892978a9760008051602061273383398151915297919690958e93919260c0840191908501908083838215610e13575b805182526020831115610e1357601f199092019160209182019101610df3565b505050905090810190601f168015610e3f5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a4610e586106ff565b6000858152600e60209081526040808320546016909252808320549051600160a060020a039092169281156108fc029290818181858888f193505050501515610cc9576000858152600e6020908152604080832054600f83528184205460138452828520546012855283862054601686529584902054845182815280870188905294850181905260026060860181905260a0608087018181528c51918801919091528b51600160a060020a039096169894978a97600080516020612733833981519152979596958e93919260c0840191908501908083838215610f56575b805182526020831115610f5657601f199092019160209182019101610f36565b505050905090810190601f168015610f825780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a46000858152600e6020908152604080832054600160a060020a031683526014825280832054888452601690925290912054610ca391906106dc565b6000868152600e6020908152604080832054600160a060020a0316835260149091529020555b6111c8565b600085815260136020908152604080832054601290925290912054106111c8576000858152600e6020908152604080832054600f83528184205460138452828520546012855283862054601186528487205485518381528088018390529586018190526060860188905260a0608087018181528c51918801919091528b51600160a060020a039096169894978a9760008051602061273383398151915297959694959394938e93919260c08401919085019080838382156110d5575b8051825260208311156110d557601f1990920191602091820191016110b5565b505050905090810190601f1680156111015780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a46004546000868152601160205260409020546111329190600019016106dc565b60045561113d6106ff565b6000858152600e6020526040808220549051600160a060020a03909116919060019082818181858883f193505050501515610cc9576000858152600e6020908152604080832054600160a060020a031683526014909152902054610ca39060016106dc565b6000868152600e6020908152604080832054600160a060020a0316835260149091529020555b5b5b5b5b5050505050565b606381565b600160a060020a0381166000908152601460205260409020545b919050565b60025433600160a060020a039081169116146112135760006000fd5b60048190555b5b50565b620f424081565b60025433600160a060020a039081169116146112405760006000fd5b6002805474ff0000000000000000000000000000000000000000191660a060020a831515021790555b5b50565b60025433600160a060020a039081169116146112895760006000fd5b60028054600160a060020a031916600160a060020a0383161790555b5b50565b600281565b60025433600160a060020a039081169116146112ca5760006000fd5b6127108111156112da5760006000fd5b60078190556107416106ff565b5b5b50565b600354600160a060020a031681565b600c5481565b60025433600160a060020a0390811691161461131d5760006000fd5b60088190555b5b50565b60025433600160a060020a039081169116146113435760006000fd5b6001805474ff0000000000000000000000000000000000000000191660a060020a831515021790555b5b50565b60015460a860020a900463ffffffff1681565b60025433600160a060020a0390811691161461139f5760006000fd5b6113ab60045482611bb9565b6004556113b66106ff565b604051600160a060020a0383169082156108fc029083906000818181858888f1935050505015156113e75760006000fd5b6040518190600160a060020a038416907f42c501a185f41a8eb77b0a3e7b72a6435ea7aa752f8a1a0a13ca4628495eca9190600090a35b5b5050565b60045481565b600254600160a060020a031681565b60085481565b60006000600260149054906101000a900460ff1615156001151514156114645760006000fd5b50600160a060020a033316600081815260146020526040808220805490839055905190929183919081818185876185025a03f192505050156114a957600191506114c7565b600160a060020a033316600090815260146020526040812082905591505b5b5b5090565b60065481565b60095481565b60015460a060020a900460ff1681565b60025433600160a060020a039081169116146115055760006000fd5b611511600a5483611bb9565b600a55604051600160a060020a0384169082156108fc029083906000818181858888f1935050505015156115455760006000fd5b6040518190600160a060020a0385169086907f7b6ccf85690b8ce1b7d21a94ca738803a9da7dc74e10140f269efa0d8d6fb85190600090a45b5b50505050565b60025433600160a060020a039081169116146115a15760006000fd5b6001805478ffffffff000000000000000000000000000000000000000000191660a860020a63ffffffff8416021790555b5b50565b60025433600160a060020a039081169116146115f25760006000fd5b600254600160a060020a0316ff5b5b565b60055481565b6001805460009160a060020a90910460ff16151514156116295760006000fd5b3482600654826103e860055485611641866001611bb9565b61164c876001611bb9565b606403880281151561165a57fe5b04010281151561166657fe5b04031180611675575060085482105b806116805750600281105b8061168b5750606381115b156116965760006000fd5b60045460408051808201909152600381527f55524c000000000000000000000000000000000000000000000000000000000060208201526001546116f092916116eb9160a860020a900463ffffffff16611bdc565b611bb9565b600455600980546001019055600c805434019055604080518082018252600681527f6e6573746564000000000000000000000000000000000000000000000000000060208083019190915282516101e081019093526101b480845261176c93916127539083013960015460a860020a900463ffffffff16611d7f565b6000818152600f6020908152604080832084905560138252808320889055601082528083203490819055600d9092529091208054600160a060020a03191633600160a060020a0316179055600554919450906103e890826117ce886001611bb9565b6117d9896001611bb9565b60640334028115156117e757fe5b0401028115156117f357fe5b60008681526015602052604090209190049190910390819055600a54611818916106dc565b600a819055600454901061182c5760006000fd5b60008381526010602090815260408083205460159092529091205461185191906106dc565b6000848152600d6020908152604080832054600f83528184205460158452828520546010855283862054601386529584902054845191825294810195909552848301939093529051600160a060020a03909116927f1cb5bfc4e69cbacf65c8e05bdb84d7a327bd6bb4c034ff82359aefd7443775c4919081900360600190a45b5b50505b5050565b6103e881565b600a5481565b808201829010155b92915050565b60008054600160a060020a0316158061191e575060005461191c90600160a060020a03166120b0565b155b1561192f5761192d60006120b8565b505b600060009054906101000a9004600160a060020a0316600160a060020a03166338cc48316000604051602001526040518163ffffffff1660e060020a028152600401809050602060405180830381600087803b151561198a57fe5b60325a03f1151561199757fe5b505060408051805160018054600160a060020a031916600160a060020a0392831617908190556000602093840181905284517fc281d19e000000000000000000000000000000000000000000000000000000008152945191909216945063c281d19e9360048082019493918390030190829087803b1515611a1457fe5b60325a03f11515611a2157fe5b5050604051519150505b5b90565b611a376125a6565b50604080518082019091528151815260208281019082018190525b50919050565b611a606125a6565b81518351600091901015611a7657839150611abd565b506020808301519084015160019114611a9e5750815160208481015190840151829020919020145b8015611ab95782518451038452825160208501805190910190525b8391505b5092915050565b611acc6125a6565b8151835160009182911015611ae357849250611b25565b50508151835160208086015190850151910191909103906001908214611b13575082516020840151819020908220145b8015611b2157835185510385525b8492505b505092915050565b611b356125a6565b611abd8383836122b5565b505b92915050565b611b506125bd565b611b586125bd565b60008360000151604051805910611b6c5750595b908082528060200260200182016040525b509150602082019050611b998185602001518660000151612329565b8192505b5050919050565b6000611bb1826000612372565b90505b919050565b6000611bc583836124f4565b1515611bd15760006000fd5b508082035b92915050565b60008054600160a060020a03161580611c075750600054611c0590600160a060020a03166120b0565b155b15611c1857611c1660006120b8565b505b600060009054906101000a9004600160a060020a0316600160a060020a03166338cc48316000604051602001526040518163ffffffff1660e060020a028152600401809050602060405180830381600087803b1515611c7357fe5b60325a03f11515611c8057fe5b505060408051805160018054600160a060020a031916600160a060020a0392831617908190556000602093840152835160e260020a630bbceb330281526024810188905260048101948552885160448201528851919092169450632ef3accc938893889391928392606401918601908083838215611d19575b805182526020831115611d1957601f199092019160209182019101611cf9565b505050905090810190601f168015611d455780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b1515611d6157fe5b60325a03f11515611d6e57fe5b5050604051519150505b5b92915050565b600080548190600160a060020a03161580611dac5750600054611daa90600160a060020a03166120b0565b155b15611dbd57611dbb60006120b8565b505b600060009054906101000a9004600160a060020a0316600160a060020a03166338cc48316000604051602001526040518163ffffffff1660e060020a028152600401809050602060405180830381600087803b1515611e1857fe5b60325a03f11515611e2557fe5b505060408051805160018054600160a060020a031916600160a060020a0392831617908190556000602093840152835160e260020a630bbceb3302815260248101899052600481019485528a5160448201528a51919092169450632ef3accc938a93899391928392606401918601908083838215611ebe575b805182526020831115611ebe57601f199092019160209182019101611e9e565b505050905090810190601f168015611eea5780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b1515611f0657fe5b60325a03f11515611f1357fe5b505060405151915050670de0b6b3a76400003a840201811115611f3957600091506120a7565b600160009054906101000a9004600160a060020a0316600160a060020a031663c51be90f8260008888886000604051602001526040518663ffffffff1660e060020a028152600401808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360008314611fd9575b805182526020831115611fd957601f199092019160209182019101611fb9565b505050905090810190601f1680156120055780820380516001836020036101000a031916815260200191505b5083810382528551815285516020918201918701908083838215612044575b80518252602083111561204457601f199092019160209182019101612024565b505050905090810190601f1680156120705780820380516001836020036101000a031916815260200191505b5096505050505050506020604051808303818588803b151561208e57fe5b61235a5a03f1151561209c57fe5b505060405151935050505b5b509392505050565b803b5b919050565b600060006120d9731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed6120b0565b111561210d575060008054600160a060020a031916731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed17905560016111f2565b600061212c73c03a2615d5efaf5f49f60b7bb6583eaec212fdf16120b0565b1115612160575060008054600160a060020a03191673c03a2615d5efaf5f49f60b7bb6583eaec212fdf117905560016111f2565b600061217f73b7a07bcf2ba2f2703b24c0691b5278999c59ac7e6120b0565b11156121b3575060008054600160a060020a03191673b7a07bcf2ba2f2703b24c0691b5278999c59ac7e17905560016111f2565b60006121d2736f485c8bf6fc43ea212e93bbf8ce046c7f1cb4756120b0565b1115612206575060008054600160a060020a031916736f485c8bf6fc43ea212e93bbf8ce046c7f1cb47517905560016111f2565b60006122257320e12a1f859b3feae5fb2a0a32c18f5a65555bbf6120b0565b1115612259575060008054600160a060020a0319167320e12a1f859b3feae5fb2a0a32c18f5a65555bbf17905560016111f2565b60006122787351efaf4c8b3c9afbd5ab9f4bbc82784ab6ef8faa6120b0565b11156122ac575060008054600160a060020a0319167351efaf4c8b3c9afbd5ab9f4bbc82784ab6ef8faa17905560016111f2565b5060005b919050565b6122bd6125a6565b60006122db85600001518660200151866000015187602001516124ff565b60208087018051918601919091528051820385528651905191925001811415612307576000855261231d565b8351835186519101900385528351810160208601525b8291505b509392505050565b60005b6020821061234e5782518452602093840193909201915b60208203915061232c565b6001826020036101000a039050801983511681855116818117865250505b50505050565b600061237c6125bd565b5082600080805b83518110156124d45783517f3000000000000000000000000000000000000000000000000000000000000000908590839081106123bc57fe5b90602001015160f860020a900460f860020a02600160f860020a03191610158015612432575083517f39000000000000000000000000000000000000000000000000000000000000009085908390811061241257fe5b90602001015160f860020a900460f860020a02600160f860020a03191611155b1561248c57811561245157851515612449576124d4565b600019909501945b5b600a830292506030848281518110151561246857fe5b90602001015160f860020a900460f860020a0260f860020a900403830192506124ca565b838181518110151561249a57fe5b90602001015160f860020a900460f860020a02600160f860020a031916602e60f860020a0214156124ca57600191505b5b5b600101612383565b60008611156124e65785600a0a830292505b8294505b5050505092915050565b818111155b92915050565b60008080808088871161259257602087116125565760018760200360080260020a031980875116888b038a018a96505b81838851161461254b57600187019681901061252f578b8b0196505b50505083945061259a565b8686209150879350600092505b86890383116125925750858320818114156125805783945061259a565b6001840193505b600190920191612563565b5b5b88880194505b50505050949350505050565b604080518082019091526000808252602082015290565b60408051602081019091526000815290565b60408051602081019091526000815290565b600054600160a060020a0316158061260b575060005461260990600160a060020a03166120b0565b155b1561261c5761261a60006120b8565b505b600060009054906101000a9004600160a060020a0316600160a060020a03166338cc48316000604051602001526040518163ffffffff1660e060020a028152600401809050602060405180830381600087803b151561267757fe5b60325a03f1151561268457fe5b505060408051805160018054600160a060020a031916600160a060020a0392831617908190557f688dcfd70000000000000000000000000000000000000000000000000000000083527fff000000000000000000000000000000000000000000000000000000000000008616600484015292519216925063688dcfd791602480830192600092919082900301818387803b151561271d57fe5b60325a03f1151561157e57fe5b5050505b5b5056008dd0b145385d04711e29558ceab40b456976a2b9a7d648cc1bcd416161bf97b95b55524c5d205b276a736f6e2868747470733a2f2f6170692e72616e646f6d2e6f72672f6a736f6e2d7270632f312f696e766f6b65292e726573756c742e72616e646f6d5b2273657269616c4e756d626572222c2264617461225d272c20275c6e7b226a736f6e727063223a22322e30222c226d6574686f64223a2267656e65726174655369676e6564496e746567657273222c22706172616d73223a7b226170694b6579223a247b5b646563727970745d20424c54722b5a744d4f4c503253515658783847527363597558762b337759357a64466772515a4e4d4d59336f4f2f3643374f6f516b6775334b67664275694a5757315333552f2b7961313058464748763250374d423756597746495a6433564f4d492f4f73386f31754a436447475a67705230446b6d35516f4e48374d62444d3077613252657742716c564c46476f5a5831504a432b696742504e6f4843343d7d2c226e223a312c226d696e223a312c226d6178223a3130302c227265706c6163656d656e74223a747275652c2262617365223a3130247b5b6964656e746974795d20227d227d2c226964223a31247b5b6964656e746974795d20227d227d275da165627a7a72305820d8db97e41127d33db5325f51e69cbbdc5918174d09fd31abff36f8d0c7fc4d9f0029

   Swarm Source:
bzzr://d8db97e41127d33db5325f51e69cbbdc5918174d09fd31abff36f8d0c7fc4d9f
View All
Block Age txn Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward
Make sure to use the "downvote" button for any spammy posts, and the "upvote" for interesting conversations.