Sponsored Link:   ARNA Genomics - FIRST BLOCKCHAIN BIOTECH ECOSYSTEM. Join ICO Now!
Contract Overview
ETH Balance: 0 Ether
ETH USD Value: $0
No Of Transactions: 11407 txns
  Latest 25 txns from a total Of 11407 transactions View All

TxHash Age From To Value [TxFee]
0x82be73b98dd3fcc155db8effad2900c90f0819e9a8c0fe6436d0041b5e7ef1a3178 days 15 hrs ago0x73f0ed546cd7893abc5e04284b68522602603dd4  IN   0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5470 Ether0.00045784
0x35750f81b4eb1f11a7c151020c26f674b3736535d334bf1257b00f80cfe86f0a178 days 15 hrs ago0x73f0ed546cd7893abc5e04284b68522602603dd4  IN   0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5470 Ether0.00091182
0x6da535d3c0f4e7777c586f75eb1e7ee7890e2139094a994660b2c3a666e36175179 days 12 hrs ago0x1c2d3e0d445db289f3874dbb13441fbcb77a62f9  IN   0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5470.2 Ether0.005
0xd7607c4a0ae5b904562c29eb89abe49eb514824cfb5eb368d8a0e12ce9d908f3180 days 7 hrs ago0x33497eded4c3bf6aa93dee5b75f5241ff1a20f58  IN   0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5470.5 Ether0.0025
0x3cb2014db50cdec72cd4d370eaa1e57dab7bfbe06afbb97397da0c663c717645180 days 7 hrs ago0xd3a3eb0de0ffbb27fa32f2cebf38f8814b7af62f  IN   0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5470.1 Ether0.00523826605
0xed40872137dd267b13cc10788442a6ac07bfd17ca0f553a891e696973114803e180 days 9 hrs ago0x00906d6d3eecbfde91dbbedde5bcf6ae18f6cfd5  IN   0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5470.2 Ether0.00523826605
0xa5ea73b9cd5519354bfdffc751144bced00d51dc4b6d9ad2ca9eb4fd37ea2c76180 days 23 hrs ago0x78bb1fb490ef48a9c866d01eaabe72903804c4cb  IN   0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5470.2 Ether0.00525
0x482322de226b583d66956d819b19f30bccad46d91102fb6b0355bd14d192c774181 days 13 hrs ago0xb48035e79426beb7e339cdec787bac375b3c24cf  IN   0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5470.3 Ether0.00525
0x87600c330709e389b3892d1d625f5e68b0ed59d98aa62cec4adb9d8b4841b049182 days 33 mins ago0x008906f387b7e7e588ad0a237bf2b275cf66722a  IN   0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5470.2 Ether0.005020547279
0x805b127fdd403b153ca49869ef64687d18e177d3b6832891e568a949dcc1c3ed182 days 4 hrs ago0xcebdc0d3e784dea5a4080e02acb49987b22271a6  IN   0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5470.2 Ether0.00525
0x482d4162a106b1d9cbd791f8309186d27ccbc890441c92fda90ef0cc6d89b4a1182 days 8 hrs ago0x5acfaf158a56bdb6e628517c1bb088ea7097144f  IN   0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5470.2 Ether0.00525
0x729db8edb3b5e3d3ce9b458d10ff97dab7d5daa547c0b7827cac371d1126a2d1182 days 9 hrs ago0x16d1b4fee59364041e58ce3d1d6e24d3d2b6853a  IN   0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5470.2 Ether0.00525
0x8e4528dde8d677d0c7c905f76cf5ca21c7d2650f210883ea581f32a2be102106182 days 11 hrs ago0xc4b3f4622c7c7526f9721d8687c3ce07a99d5624  IN   0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5471 Ether0.00525
0xc2d04a6eb61501453e51b1a97989992eb9e8c294d5849f7b9b536d319ac1f6e2183 days 1 hr ago0x12810af05bb00073859766d073e86977d3f5c8ed  IN   0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5470.5 Ether0.005
0x1ec76b1f14ea9e9d745c11f7deb5705f941cb0e00fecb66bf37f7f07366ae372183 days 9 hrs ago0xfc411e57b9236bea554cf1f894c8da878aeb93a6  IN   0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5475 Ether0.005
0x72c4059bb0a79888d541fa85df08aaa09f79b000c869fe411708fff99bcde918183 days 10 hrs ago0x3b1c28f44f763bb987d38483a00ae83f211c41fd  IN   0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5471 Ether0.005
0x87dba6f7c22e7a6c5ad52340bc63eb7b1a56b75c600b77a6f03b534c0cccb295183 days 12 hrs ago0xbbd5ca4e4603f00f3d929bf561c08de0cf9a4953  IN   0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5470.2 Ether0.005
0x25a3574b7bc4404bf9a4c17cec76a13b515f52af6c4cc52cf28206ddef4302b3184 days 3 hrs ago0x73f0ed546cd7893abc5e04284b68522602603dd4  IN   0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5470 Ether0.00055034
0x61142eee371d2ec8224b09cdaaee13adf1ec2e0cdca79d4c75190a0010a0416d184 days 3 hrs ago0x4bdc6cc6362b5c0b7ff2b61dbc20c8f545a9a850  IN   0x8f3d6447a647ecf3c185ecbb165d2e6c41fad54710 Ether0.00525
0xe53eb93e1fddbdead6e41f4b0b7cace28bf808edc786b36465716d9a22068082184 days 3 hrs ago0x4bdc6cc6362b5c0b7ff2b61dbc20c8f545a9a850  IN   0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5471 Ether0.005188859846
0x58faaf6a009cd17b3783734b936ca8daa81809fdd970143381d287847871103c184 days 3 hrs agoOraclize  IN   0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5470 Ether0.00251986
0x4c1dd187e4e8aa3ff2b05b27f0ca388bbd514247a1eee67487869b7d05d9a45a184 days 3 hrs ago0x73f0ed546cd7893abc5e04284b68522602603dd4  IN   0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5470 Ether0.00055342
0x3a449b6e3165c583667fde16f78499ff49fbe82dcd9300b90ad70cbfb406d2aa184 days 3 hrs agoOraclize  IN   0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5470 Ether0.00281986
0xc8551dd36d8158ca7dbdb412cc56515ab9939820b9f1c67601dc722defc0b32a184 days 3 hrs ago0x4bdc6cc6362b5c0b7ff2b61dbc20c8f545a9a850  IN   0x8f3d6447a647ecf3c185ecbb165d2e6c41fad54712 Ether0.004461153385
0x453aa2e2f5f93af0ab43930c2546e96c1ecfc209c38e42288f534d3626257eaa184 days 3 hrs agoOraclize  IN   0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5470 Ether0.00281986
[ 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
0x82be73b98dd3fcc155db8effad2900c90f0819e9a8c0fe6436d0041b5e7ef1a33753974178 days 15 hrs ago0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5470x24c3235558572cff8054b5a419251d3b0d43e91b1,241.958676131674263592 Ether
0x35750f81b4eb1f11a7c151020c26f674b3736535d334bf1257b00f80cfe86f0a3753961178 days 15 hrs ago0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5470x24c3235558572cff8054b5a419251d3b0d43e91b1 Ether
0x58faaf6a009cd17b3783734b936ca8daa81809fdd970143381d287847871103c3724137184 days 3 hrs ago0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5470x4bdc6cc6362b5c0b7ff2b61dbc20c8f545a9a85023.76 Ether
0x3a449b6e3165c583667fde16f78499ff49fbe82dcd9300b90ad70cbfb406d2aa3724135184 days 3 hrs ago0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5470xb5cbb1b8a20a086857a95b7f157d3349a130490924.244897959183673468 Ether
0xc8551dd36d8158ca7dbdb412cc56515ab9939820b9f1c67601dc722defc0b32a3724135184 days 3 hrs ago0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5470x001a589dda0d6be37632925eaf1256986b2c6ad00.00541154119823535 Ether
0x453aa2e2f5f93af0ab43930c2546e96c1ecfc209c38e42288f534d3626257eaa3724129184 days 3 hrs ago0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5470x4bdc6cc6362b5c0b7ff2b61dbc20c8f545a9a85025.74 Ether
0x1665108815392b502136b82035af942aa9063bfe02699a6383571ad75a9a20033724128184 days 3 hrs ago0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5470x001a589dda0d6be37632925eaf1256986b2c6ad00.00541154119823535 Ether
0x06d844abec4e87ad8762944128c9d5579888e99a26ab5b0c068ec3b74398b3953724127184 days 3 hrs ago0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5470x001a589dda0d6be37632925eaf1256986b2c6ad00.00541154119823535 Ether
0x0cd0e1040d43dc00c5ee688d919c1fb1f8b6c8de74753e9fa30cdb33b6b1fa473724122184 days 3 hrs ago0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5470xb5cbb1b8a20a086857a95b7f157d3349a130490924.244897959183673468 Ether
0xa5b98cc8edb61f03acecb75154c2c9cf7edf3869f3fea12a618c34eed677bcf03724120184 days 3 hrs ago0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5470x4bdc6cc6362b5c0b7ff2b61dbc20c8f545a9a85025.74 Ether
0x7756bd6f1b181a813deaaccad0d6465bc9a69a7d0ea82071c7118cf48b793d323724120184 days 3 hrs ago0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5470x001a589dda0d6be37632925eaf1256986b2c6ad00.00541154119823535 Ether
0x64eefb188a00a3c2969a08d9e61a9c3e2a3e5f8f98aa118663133889e5bbb6583724118184 days 3 hrs ago0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5470x001a589dda0d6be37632925eaf1256986b2c6ad00.00541154119823535 Ether
0x0dbd6310f5c5d42b2179f3dc8b6534c6064770b0aa0b49c9ef35c3e7be2b70323724116184 days 3 hrs ago0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5470xb5cbb1b8a20a086857a95b7f157d3349a130490922.846153846153846153 Ether
0xaa4d1893e672fdb97d0e48c926c7fe4095573ebeeb412df0b8c6919858373a7e3724115184 days 3 hrs ago0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5470x4bdc6cc6362b5c0b7ff2b61dbc20c8f545a9a85026.265306122448979591 Ether
0x21bb1358aa8fffd384b9a6c79b5084823f314351b240cbf4245873d7d52a98b83724114184 days 3 hrs ago0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5470x001a589dda0d6be37632925eaf1256986b2c6ad00.00541154119823535 Ether
0x795761eb36cc02d248283a4a53cd21bb7f723559256aec9e3042b06a9bd2f90a3724113184 days 3 hrs ago0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5470x001a589dda0d6be37632925eaf1256986b2c6ad00.00541154119823535 Ether
0xd6e5ed7533ce7fb6a2da380861b1757471561f973296e3fb6c3a269744ac4e8d3724111184 days 3 hrs ago0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5470x4bdc6cc6362b5c0b7ff2b61dbc20c8f545a9a85026.265306122448979591 Ether
0xe4c25994702f67d921665d268ad1c190f13729a5e0228be3a316dbb891cc682c3724111184 days 3 hrs ago0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5470xb5cbb1b8a20a086857a95b7f157d3349a130490919.038461538461538461 Ether
0xbff94b833e88078a72dc959ef2f76b88fece47498ce72e1f26c68992f00953853724109184 days 3 hrs ago0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5470x001a589dda0d6be37632925eaf1256986b2c6ad00.00541154119823535 Ether
0x8c5fef0ec9ba2959d88faf81fd4fd6d7f8b65fab3bc86b9f25da493606c2752e3724109184 days 3 hrs ago0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5470x001a589dda0d6be37632925eaf1256986b2c6ad00.00541154119823535 Ether
0xade8290969b80fcb38e34e37c2c092346a1b83eb2251a21197b04bdb93916cc33724107184 days 3 hrs ago0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5470x4bdc6cc6362b5c0b7ff2b61dbc20c8f545a9a85026.265306122448979591 Ether
0x7e467f31ce04aef3e4b06e631913a23539dfd7ada1b57d5392955b24de7b379a3724105184 days 3 hrs ago0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5470x001a589dda0d6be37632925eaf1256986b2c6ad00.00541154119823535 Ether
0xa406314217da7b7079f35d7bbfa6d4002e213acc907481d1b0d0cb442a3e86e43724103184 days 3 hrs ago0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5470x4bdc6cc6362b5c0b7ff2b61dbc20c8f545a9a85026.265306122448979591 Ether
0xe4220e7fc8c5161f762f0b1b776453b5b7a62892ac20913542c5536a08d8813d3724103184 days 3 hrs ago0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5470xb5cbb1b8a20a086857a95b7f157d3349a130490913.588235294117647058 Ether
0xb4fffb7fe4c763d0d9ca91209f431ea70f9be2a596a1d61ff5e079bf8dc34dab3724099184 days 3 hrs ago0x8f3d6447a647ecf3c185ecbb165d2e6c41fad5470x001a589dda0d6be37632925eaf1256986b2c6ad00.00541154119823535 Ether
[ Download CSV Export  ] 
Contract Name: Etheroll
Compiler Version: v0.4.10+commit.f0d539ae
Optimization Enabled: Yes
Runs (Optimiser):  200



  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;       
    int public totalBets;
    uint public maxPendingPayouts;
    uint public totalWeiWon;
    uint public totalWeiWagered;    

    /*
     * 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) playerRandomResult;     
    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] BHrsuMrqGYGRVo6Kfrnim4uIpUHvMfSZ7Guzh5RynW9VHmIspBaRyBsl/ZtGW94TgTyxDr9c8Zkv5Iivc0HaYv47jhB5Dte8/IiYiBFjk5X8ujtZsqlBOVDY9P5HbawfSP11iYZwPkhZc2PyS4Nfe0aOoyVZKiA=},\"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 */
        playerRandomResult[myid] = parseInt(sl_result.beyond("[".toSlice()).until("]".toSlice()).toString());
        
        /* produce integer bounded to 1-100 inclusive
        *  via sha3 result from random.org and proof (IPFS address of TLSNotary proof)
        */
        playerDieResult[myid] = uint(sha3(playerRandomResult[myid], proof)) % 100 + 1;
        
        /* 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 from oraclize is 0 refund only the original bet value
        * if refund fails save refund value to playerPendingWithdrawals
        */
        if(playerDieResult[myid]==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
606060405234156200000d57fe5b5b60028054600160a060020a033316600160a060020a031991821681179092556003805490911690911790556200005360006401000000006200212f6200011882021704565b506200008d7f1100000000000000000000000000000000000000000000000000000000000000640100000000620026586200038082021704565b620000a86103de6401000000006200071f6200051082021704565b620000c3612710640100000000620013256200053782021704565b620000e467016345785d8a0000640100000000620013786200058782021704565b6001805460a860020a63ffffffff0219167703d0900000000000000000000000000000000000000000001790555b620005ca565b60008062000148731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed64010000000062002127620005ae82021704565b11156200017e575060008054600160a060020a031916731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed17905560016200037b565b6000620001ad73c03a2615d5efaf5f49f60b7bb6583eaec212fdf164010000000062002127620005ae82021704565b1115620001e3575060008054600160a060020a03191673c03a2615d5efaf5f49f60b7bb6583eaec212fdf117905560016200037b565b60006200021273b7a07bcf2ba2f2703b24c0691b5278999c59ac7e64010000000062002127620005ae82021704565b111562000248575060008054600160a060020a03191673b7a07bcf2ba2f2703b24c0691b5278999c59ac7e17905560016200037b565b600062000277736f485c8bf6fc43ea212e93bbf8ce046c7f1cb47564010000000062002127620005ae82021704565b1115620002ad575060008054600160a060020a031916736f485c8bf6fc43ea212e93bbf8ce046c7f1cb47517905560016200037b565b6000620002dc7320e12a1f859b3feae5fb2a0a32c18f5a65555bbf64010000000062002127620005ae82021704565b111562000312575060008054600160a060020a0319167320e12a1f859b3feae5fb2a0a32c18f5a65555bbf17905560016200037b565b6000620003417351efaf4c8b3c9afbd5ab9f4bbc82784ab6ef8faa64010000000062002127620005ae82021704565b111562000377575060008054600160a060020a0319167351efaf4c8b3c9afbd5ab9f4bbc82784ab6ef8faa17905560016200037b565b5060005b919050565b600054600160a060020a03161580620003bb5750600054620003b990600160a060020a031664010000000062002127620005ae82021704565b155b15620003dd57620003db60006401000000006200212f6200011882021704565b505b600060009054906101000a9004600160a060020a0316600160a060020a03166338cc48316000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401809050602060405180830381600087803b15156200045257fe5b60325a03f115156200046057fe5b505060408051805160018054600160a060020a031916600160a060020a0392831617908190557f688dcfd70000000000000000000000000000000000000000000000000000000083527fff000000000000000000000000000000000000000000000000000000000000008616600484015292519216925063688dcfd791602480830192600092919082900301818387803b1515620004fa57fe5b60325a03f115156200050857fe5b5050505b5b50565b60025433600160a060020a039081169116146200052d5760006000fd5b60058190555b5b50565b60025433600160a060020a03908116911614620005545760006000fd5b612710811115620005655760006000fd5b60078190556200050c640100000000620006ff620005b682021704565b5b5b50565b60025433600160a060020a03908116911614620005a45760006000fd5b60088190555b5b50565b803b5b919050565b600754600454620f424091025b046006555b565b6129a980620005da6000396000f3006060604052361561019b5763ffffffff60e060020a60003504166315c12d4d81146101d857806323214fab146101fa578063268d50fe1461021c57806327dc297e14610231578063301cf6e71461028a57806331375242146102ae57806338bbfa50146102cc5780633a4f6999146103625780633c314a91146103845780634025b5a8146103b257806343c1598d146103c75780634b7fcee7146103e95780634f44728d1461040057806355b930311461041e5780635e968a491461044057806361d027b314610455578063666f4cad146104815780636cdf4c90146104a35780636eacd48a146104b85780637072a977146104cf5780637ac37d58146104f85780638b7afe2e146105195780638da5cb5b1461053b5780639619367d14610567578063a5f4af3314610589578063b539cd55146105ad578063befa1e2f146105cf578063c3de1ab9146105f1578063cf832ce214610615578063d207e7571461063c578063d263b7eb14610657578063d667dcd714610669578063dc6dd1521461068b578063e5c774de14610698578063ed62f501146106ba575b6101d65b60035433600160a060020a039081169116146101bb5760006000fd5b6101c7600454346106dc565b6004556101d26106ff565b5b5b565b005b34156101e057fe5b6101e8610713565b60408051918252519081900360200190f35b341561020257fe5b6101e8610719565b60408051918252519081900360200190f35b341561022457fe5b6101d660043561071f565b005b341561023957fe5b60408051602060046024803582810135601f81018590048502860185019096528585526101d6958335959394604494939290920191819084018382808284375094965061074595505050505050565b005b341561029257fe5b61029a610775565b604080519115158252519081900360200190f35b34156102b657fe5b6101d6600160a060020a0360043516610785565b005b34156102d457fe5b60408051602060046024803582810135601f81018590048502860185019096528585526101d6958335959394604494939290920191819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979998810197919650918201945092508291508401838280828437509496506107c195505050505050565b005b341561036a57fe5b6101e861124a565b60408051918252519081900360200190f35b341561038c57fe5b6101e8600160a060020a036004351661124f565b60408051918252519081900360200190f35b34156103ba57fe5b6101d660043561126e565b005b34156103cf57fe5b6101e8611294565b60408051918252519081900360200190f35b34156103f157fe5b6101d6600435151561129b565b005b341561040857fe5b6101d6600160a060020a03600435166112e4565b005b341561042657fe5b6101e8611320565b60408051918252519081900360200190f35b341561044857fe5b6101d6600435611325565b005b341561045d57fe5b610465611363565b60408051600160a060020a039092168252519081900360200190f35b341561048957fe5b6101e8611372565b60408051918252519081900360200190f35b34156104ab57fe5b6101d6600435611378565b005b34156104c057fe5b6101d6600435151561139e565b005b34156104d757fe5b6104df6113e7565b6040805163ffffffff9092168252519081900360200190f35b341561050057fe5b6101d6600160a060020a03600435166024356113fa565b005b341561052157fe5b6101e861149a565b60408051918252519081900360200190f35b341561054357fe5b6104656114a0565b60408051600160a060020a039092168252519081900360200190f35b341561056f57fe5b6101e86114af565b60408051918252519081900360200190f35b341561059157fe5b61029a6114b5565b604080519115158252519081900360200190f35b34156105b557fe5b6101e8611544565b60408051918252519081900360200190f35b34156105d757fe5b6101e861154a565b60408051918252519081900360200190f35b34156105f957fe5b61029a611550565b604080519115158252519081900360200190f35b341561061d57fe5b6101d6600435600160a060020a0360243516604435606435611560565b005b341561064457fe5b6101d663ffffffff600435166115fc565b005b341561065f57fe5b6101d661164d565b005b341561067157fe5b6101e861167a565b60408051918252519081900360200190f35b6101d6600435611680565b005b34156106a057fe5b6101e8611950565b60408051918252519081900360200190f35b34156106c257fe5b6101e8611956565b60408051918252519081900360200190f35b60006106e8838361195c565b15156106f45760006000fd5b508181015b92915050565b600754600454620f424091025b046006555b565b600b5481565b60075481565b60025433600160a060020a0390811691161461073b5760006000fd5b60058190555b5b50565b610770828260006040518059106107595750595b908082528060200260200182016040525b506107c1565b5b5050565b60025460a060020a900460ff1681565b60025433600160a060020a039081169116146107a15760006000fd5b60038054600160a060020a031916600160a060020a0383161790555b5b50565b6107c961261d565b60006107d361196a565b600160a060020a031633600160a060020a03161415156107f35760006000fd5b60025460a060020a900460ff161515600114156108105760006000fd5b6000858152600d6020526040902054600160a060020a031615156108345760006000fd5b61083d84611aa6565b91506108aa6108686040604051908101604052806001815260200160f860020a605d02815250611aa6565b61089e6108916040604051908101604052806001815260200160f860020a605b02815250611aa6565b859063ffffffff611acf16565b9063ffffffff611b3b16565b5061090a6109056109006108f3604060405190810160405280600281526020017f2c20000000000000000000000000000000000000000000000000000000000000815250611aa6565b859063ffffffff611ba416565b611bbf565b611c1b565b905061098761090561090061093b6040604051908101604052806001815260200160f860020a605d02815250611aa6565b61089e6109646040604051908101604052806001815260200160f860020a605b02815250611aa6565b879063ffffffff611acf16565b9063ffffffff611b3b16565b611bbf565b611c1b565b6000868152601260209081526040918290208390559051828152855160649392879291828201918401908083835b602083106109d45780518252601f1990920191602091820191016109b5565b5181516020939093036101000a60001901801990911692169190911790526040519201829003909120935050508215159050610a0c57fe5b600087815260136020908152604080832094909306600101909355600d83528181208054600e85528383208054600160a060020a03909216600160a060020a0319928316179055815416905560168352818120805460179094529181209283559055600a549054610a7d9190611c30565b600a5560008581526010602090815260408083208054601184528285205583905560139091529020541515610d45576000858152600e6020908152604080832054600f83528184205460148452828520546013855283862054601186529584902054845182815280870188905294850181905260036060860181905260a0608087018181528c51918801919091528b51600160a060020a039096169894978a976000805160206127aa833981519152979596958e93919260c0840191908501908083838215610b67575b805182526020831115610b6757601f199092019160209182019101610b47565b505050905090810190601f168015610b935780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a46000858152600e60209081526040808320546011909252808320549051600160a060020a039092169281156108fc029290818181858888f193505050501515610d40576000858152600e6020908152604080832054600f83528184205460148452828520546013855283862054601186529584902054845182815280870188905294850181905260046060860181905260a0608087018181528c51918801919091528b51600160a060020a039096169894978a976000805160206127aa833981519152979596958e93919260c0840191908501908083838215610ca2575b805182526020831115610ca257601f199092019160209182019101610c82565b505050905090810190601f168015610cce5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a46000858152600e6020908152604080832054600160a060020a031683526015825280832054888452601190925290912054610d1a91906106dc565b6000868152600e6020908152604080832054600160a060020a0316835260159091529020555b61123f565b600085815260146020908152604080832054601390925290912054101561107057600454600086815260176020526040902054610d829190611c30565b600455600b54600086815260176020526040902054610da191906106dc565b600b55600085815260176020908152604080832054601190925290912054610dc991906106dc565b6000868152601760208181526040808420859055600e825280842054600f8352818520546014845282862054601385529583902054948452825186815280850186905292830187905260016060840181905260a0608085018181528c51918601919091528b51600160a060020a039094169892978a976000805160206127aa83398151915297919690958e93919260c0840191908501908083838215610e8a575b805182526020831115610e8a57601f199092019160209182019101610e6a565b505050905090810190601f168015610eb65780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a4610ecf6106ff565b6000858152600e60209081526040808320546017909252808320549051600160a060020a039092169281156108fc029290818181858888f193505050501515610d40576000858152600e6020908152604080832054600f83528184205460148452828520546013855283862054601786529584902054845182815280870188905294850181905260026060860181905260a0608087018181528c51918801919091528b51600160a060020a039096169894978a976000805160206127aa833981519152979596958e93919260c0840191908501908083838215610fcd575b805182526020831115610fcd57601f199092019160209182019101610fad565b505050905090810190601f168015610ff95780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a46000858152600e6020908152604080832054600160a060020a031683526015825280832054888452601790925290912054610d1a91906106dc565b6000868152600e6020908152604080832054600160a060020a0316835260159091529020555b61123f565b6000858152601460209081526040808320546013909252909120541061123f576000858152600e6020908152604080832054600f83528184205460148452828520546013855283862054601186528487205485518381528088018390529586018190526060860188905260a0608087018181528c51918801919091528b51600160a060020a039096169894978a976000805160206127aa83398151915297959694959394938e93919260c084019190850190808383821561114c575b80518252602083111561114c57601f19909201916020918201910161112c565b505050905090810190601f1680156111785780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a46004546000868152601160205260409020546111a99190600019016106dc565b6004556111b46106ff565b6000858152600e6020526040808220549051600160a060020a03909116919060019082818181858883f193505050501515610d40576000858152600e6020908152604080832054600160a060020a031683526015909152902054610d1a9060016106dc565b6000868152600e6020908152604080832054600160a060020a0316835260159091529020555b5b5b5b5b5050505050565b606381565b600160a060020a0381166000908152601560205260409020545b919050565b60025433600160a060020a0390811691161461128a5760006000fd5b60048190555b5b50565b620f424081565b60025433600160a060020a039081169116146112b75760006000fd5b6002805474ff0000000000000000000000000000000000000000191660a060020a831515021790555b5b50565b60025433600160a060020a039081169116146113005760006000fd5b60028054600160a060020a031916600160a060020a0383161790555b5b50565b600281565b60025433600160a060020a039081169116146113415760006000fd5b6127108111156113515760006000fd5b60078190556107416106ff565b5b5b50565b600354600160a060020a031681565b600c5481565b60025433600160a060020a039081169116146113945760006000fd5b60088190555b5b50565b60025433600160a060020a039081169116146113ba5760006000fd5b6001805474ff0000000000000000000000000000000000000000191660a060020a831515021790555b5b50565b60015460a860020a900463ffffffff1681565b60025433600160a060020a039081169116146114165760006000fd5b61142260045482611c30565b60045561142d6106ff565b604051600160a060020a0383169082156108fc029083906000818181858888f19350505050151561145e5760006000fd5b6040518190600160a060020a038416907f42c501a185f41a8eb77b0a3e7b72a6435ea7aa752f8a1a0a13ca4628495eca9190600090a35b5b5050565b60045481565b600254600160a060020a031681565b60085481565b60006000600260149054906101000a900460ff1615156001151514156114db5760006000fd5b50600160a060020a033316600081815260156020526040808220805490839055905190929183919081818185876185025a03f19250505015611520576001915061153e565b600160a060020a033316600090815260156020526040812082905591505b5b5b5090565b60065481565b60095481565b60015460a060020a900460ff1681565b60025433600160a060020a0390811691161461157c5760006000fd5b611588600a5483611c30565b600a55604051600160a060020a0384169082156108fc029083906000818181858888f1935050505015156115bc5760006000fd5b6040518190600160a060020a0385169086907f7b6ccf85690b8ce1b7d21a94ca738803a9da7dc74e10140f269efa0d8d6fb85190600090a45b5b50505050565b60025433600160a060020a039081169116146116185760006000fd5b6001805478ffffffff000000000000000000000000000000000000000000191660a860020a63ffffffff8416021790555b5b50565b60025433600160a060020a039081169116146116695760006000fd5b600254600160a060020a0316ff5b5b565b60055481565b6001805460009160a060020a90910460ff16151514156116a05760006000fd5b3482600654826103e8600554856116b8866001611c30565b6116c3876001611c30565b60640388028115156116d157fe5b0401028115156116dd57fe5b040311806116ec575060085482105b806116f75750600281105b806117025750606381115b1561170d5760006000fd5b60045460408051808201909152600381527f55524c0000000000000000000000000000000000000000000000000000000000602082015260015461176792916117629160a860020a900463ffffffff16611c53565b611c30565b600455600980546001019055600c805434019055604080518082018252600681527f6e6573746564000000000000000000000000000000000000000000000000000060208083019190915282516101e081019093526101b48084526117e393916127ca9083013960015460a860020a900463ffffffff16611df6565b6000818152600f6020908152604080832084905560148252808320889055601082528083203490819055600d9092529091208054600160a060020a03191633600160a060020a0316179055600554919450906103e89082611845886001611c30565b611850896001611c30565b606403340281151561185e57fe5b04010281151561186a57fe5b60008681526016602052604090209190049190910390819055600a5461188f916106dc565b600a81905560045490106118a35760006000fd5b6000838152601060209081526040808320546016909252909120546118c891906106dc565b6000848152600d6020908152604080832054600f83528184205460168452828520546010855283862054601486529584902054845191825294810195909552848301939093529051600160a060020a03909116927f1cb5bfc4e69cbacf65c8e05bdb84d7a327bd6bb4c034ff82359aefd7443775c4919081900360600190a45b5b50505b5050565b6103e881565b600a5481565b808201829010155b92915050565b60008054600160a060020a03161580611995575060005461199390600160a060020a0316612127565b155b156119a6576119a4600061212f565b505b600060009054906101000a9004600160a060020a0316600160a060020a03166338cc48316000604051602001526040518163ffffffff1660e060020a028152600401809050602060405180830381600087803b1515611a0157fe5b60325a03f11515611a0e57fe5b505060408051805160018054600160a060020a031916600160a060020a0392831617908190556000602093840181905284517fc281d19e000000000000000000000000000000000000000000000000000000008152945191909216945063c281d19e9360048082019493918390030190829087803b1515611a8b57fe5b60325a03f11515611a9857fe5b5050604051519150505b5b90565b611aae61261d565b50604080518082019091528151815260208281019082018190525b50919050565b611ad761261d565b81518351600091901015611aed57839150611b34565b506020808301519084015160019114611b155750815160208481015190840151829020919020145b8015611b305782518451038452825160208501805190910190525b8391505b5092915050565b611b4361261d565b8151835160009182911015611b5a57849250611b9c565b50508151835160208086015190850151910191909103906001908214611b8a575082516020840151819020908220145b8015611b9857835185510385525b8492505b505092915050565b611bac61261d565b611b3483838361232c565b505b92915050565b611bc7612634565b611bcf612634565b60008360000151604051805910611be35750595b908082528060200260200182016040525b509150602082019050611c1081856020015186600001516123a0565b8192505b5050919050565b6000611c288260006123e9565b90505b919050565b6000611c3c838361256b565b1515611c485760006000fd5b508082035b92915050565b60008054600160a060020a03161580611c7e5750600054611c7c90600160a060020a0316612127565b155b15611c8f57611c8d600061212f565b505b600060009054906101000a9004600160a060020a0316600160a060020a03166338cc48316000604051602001526040518163ffffffff1660e060020a028152600401809050602060405180830381600087803b1515611cea57fe5b60325a03f11515611cf757fe5b505060408051805160018054600160a060020a031916600160a060020a0392831617908190556000602093840152835160e260020a630bbceb330281526024810188905260048101948552885160448201528851919092169450632ef3accc938893889391928392606401918601908083838215611d90575b805182526020831115611d9057601f199092019160209182019101611d70565b505050905090810190601f168015611dbc5780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b1515611dd857fe5b60325a03f11515611de557fe5b5050604051519150505b5b92915050565b600080548190600160a060020a03161580611e235750600054611e2190600160a060020a0316612127565b155b15611e3457611e32600061212f565b505b600060009054906101000a9004600160a060020a0316600160a060020a03166338cc48316000604051602001526040518163ffffffff1660e060020a028152600401809050602060405180830381600087803b1515611e8f57fe5b60325a03f11515611e9c57fe5b505060408051805160018054600160a060020a031916600160a060020a0392831617908190556000602093840152835160e260020a630bbceb3302815260248101899052600481019485528a5160448201528a51919092169450632ef3accc938a93899391928392606401918601908083838215611f35575b805182526020831115611f3557601f199092019160209182019101611f15565b505050905090810190601f168015611f615780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b1515611f7d57fe5b60325a03f11515611f8a57fe5b505060405151915050670de0b6b3a76400003a840201811115611fb0576000915061211e565b600160009054906101000a9004600160a060020a0316600160a060020a031663c51be90f8260008888886000604051602001526040518663ffffffff1660e060020a028152600401808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360008314612050575b80518252602083111561205057601f199092019160209182019101612030565b505050905090810190601f16801561207c5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838382156120bb575b8051825260208311156120bb57601f19909201916020918201910161209b565b505050905090810190601f1680156120e75780820380516001836020036101000a031916815260200191505b5096505050505050506020604051808303818588803b151561210557fe5b61235a5a03f1151561211357fe5b505060405151935050505b5b509392505050565b803b5b919050565b60006000612150731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed612127565b1115612184575060008054600160a060020a031916731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed1790556001611269565b60006121a373c03a2615d5efaf5f49f60b7bb6583eaec212fdf1612127565b11156121d7575060008054600160a060020a03191673c03a2615d5efaf5f49f60b7bb6583eaec212fdf11790556001611269565b60006121f673b7a07bcf2ba2f2703b24c0691b5278999c59ac7e612127565b111561222a575060008054600160a060020a03191673b7a07bcf2ba2f2703b24c0691b5278999c59ac7e1790556001611269565b6000612249736f485c8bf6fc43ea212e93bbf8ce046c7f1cb475612127565b111561227d575060008054600160a060020a031916736f485c8bf6fc43ea212e93bbf8ce046c7f1cb4751790556001611269565b600061229c7320e12a1f859b3feae5fb2a0a32c18f5a65555bbf612127565b11156122d0575060008054600160a060020a0319167320e12a1f859b3feae5fb2a0a32c18f5a65555bbf1790556001611269565b60006122ef7351efaf4c8b3c9afbd5ab9f4bbc82784ab6ef8faa612127565b1115612323575060008054600160a060020a0319167351efaf4c8b3c9afbd5ab9f4bbc82784ab6ef8faa1790556001611269565b5060005b919050565b61233461261d565b60006123528560000151866020015186600001518760200151612576565b6020808701805191860191909152805182038552865190519192500181141561237e5760008552612394565b8351835186519101900385528351810160208601525b8291505b509392505050565b60005b602082106123c55782518452602093840193909201915b6020820391506123a3565b6001826020036101000a039050801983511681855116818117865250505b50505050565b60006123f3612634565b5082600080805b835181101561254b5783517f30000000000000000000000000000000000000000000000000000000000000009085908390811061243357fe5b90602001015160f860020a900460f860020a02600160f860020a031916101580156124a9575083517f39000000000000000000000000000000000000000000000000000000000000009085908390811061248957fe5b90602001015160f860020a900460f860020a02600160f860020a03191611155b156125035781156124c8578515156124c05761254b565b600019909501945b5b600a83029250603084828151811015156124df57fe5b90602001015160f860020a900460f860020a0260f860020a90040383019250612541565b838181518110151561251157fe5b90602001015160f860020a900460f860020a02600160f860020a031916602e60f860020a02141561254157600191505b5b5b6001016123fa565b600086111561255d5785600a0a830292505b8294505b5050505092915050565b818111155b92915050565b60008080808088871161260957602087116125cd5760018760200360080260020a031980875116888b038a018a96505b8183885116146125c25760018701968190106125a6578b8b0196505b505050839450612611565b8686209150879350600092505b86890383116126095750858320818114156125f757839450612611565b6001840193505b6001909201916125da565b5b5b88880194505b50505050949350505050565b604080518082019091526000808252602082015290565b60408051602081019091526000815290565b60408051602081019091526000815290565b600054600160a060020a03161580612682575060005461268090600160a060020a0316612127565b155b1561269357612691600061212f565b505b600060009054906101000a9004600160a060020a0316600160a060020a03166338cc48316000604051602001526040518163ffffffff1660e060020a028152600401809050602060405180830381600087803b15156126ee57fe5b60325a03f115156126fb57fe5b505060408051805160018054600160a060020a031916600160a060020a0392831617908190557f688dcfd70000000000000000000000000000000000000000000000000000000083527fff000000000000000000000000000000000000000000000000000000000000008616600484015292519216925063688dcfd791602480830192600092919082900301818387803b151561279457fe5b60325a03f115156115f557fe5b5050505b5b5056008dd0b145385d04711e29558ceab40b456976a2b9a7d648cc1bcd416161bf97b95b55524c5d205b276a736f6e2868747470733a2f2f6170692e72616e646f6d2e6f72672f6a736f6e2d7270632f312f696e766f6b65292e726573756c742e72616e646f6d5b2273657269616c4e756d626572222c2264617461225d272c20275c6e7b226a736f6e727063223a22322e30222c226d6574686f64223a2267656e65726174655369676e6564496e746567657273222c22706172616d73223a7b226170694b6579223a247b5b646563727970745d2042487273754d727147594752566f364b66726e696d347549705548764d66535a3747757a683552796e573956486d4973704261527942736c2f5a7447573934546754797844723963385a6b763549697663304861597634376a684235447465382f4969596942466a6b355838756a745a73716c424f56445939503548626177665350313169595a77506b685a6332507953344e666530614f6f79565a4b69413d7d2c226e223a312c226d696e223a312c226d6178223a3130302c227265706c6163656d656e74223a747275652c2262617365223a3130247b5b6964656e746974795d20227d227d2c226964223a31247b5b6964656e746974795d20227d227d275da165627a7a723058209416f8be3f8aed6fc7b5c98ebe68059b5cc440fcc21e30a60a9ddcafb50803730029

   Swarm Source:
bzzr://9416f8be3f8aed6fc7b5c98ebe68059b5cc440fcc21e30a60a9ddcafb5080373
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.