Sponsored Link: Monaco VISA® - World’s Best Cryptocurrency CardICO LIVE NOW
Overview
ETH Balance: 1.81 Ether
ETH USD Value: $356.08 (@ $196.73/ETH)
No Of Transactions: 7972 txns + 7837 internalTxns
Misc QRCODE
Address Watch Add To Watch List
  Latest 25 txns from a total Of 7972 transactions View All

TxHash Block Age From To Value [TxFee]
0x15c0e99d2c8b939ad99cd775e8b43b977d2d267aa4828b7224c4bd4ddb4313c8372294612 days 4 hrs ago0xdda3ff82def15fab2eca2f56229edbf62a1a2dc9  IN   0xfaf4a5fbf621b049215c19a73babd0b94fd9155f0.11 Ether0.00042928
0x316ea29fe637c979727bdde7745b7f2c7208652d95d8498d34e6b52cc91a1874370721215 days 2 hrs ago0xdda3ff82def15fab2eca2f56229edbf62a1a2dc9  IN   0xfaf4a5fbf621b049215c19a73babd0b94fd9155f0.1 Ether0.00042928
0xd748ee2a2f09408397431a5340853d52751e633d98d820490d6e43d85cd5da60359485134 days 23 hrs ago0x77f004e95898be2da9ef32f2a673f12c1306dbdb  IN   0xfaf4a5fbf621b049215c19a73babd0b94fd9155f0.1 Ether0.00042928
0x6516cfbaea178f04b72058f12aaf93427d20cc73e8dd9a1039ef120046c92912359428035 days 1 hr ago0x7770bfe9542cc4287f87ffab99a7244a1ff8873d  IN   0xfaf4a5fbf621b049215c19a73babd0b94fd9155f1.5 Ether0.00042928
0xc3d2e2e33cd9b0f32096ec09f91fb130f29165bdd47aefb1ae1613b3880207c6359215335 days 10 hrs ago0x850d4bfa3c43b9c0c304918bae4ef4b3e6ce704c  IN   0xfaf4a5fbf621b049215c19a73babd0b94fd9155f0 Ether0.00042928
0xe5e1bdb5f7332aa8dd7148303fb77fc2cd7bef4010b31265ad34d0bddd0f7b86359140135 days 13 hrs ago0x73f0ed546cd7893abc5e04284b68522602603dd4  IN   0xfaf4a5fbf621b049215c19a73babd0b94fd9155f0 Ether0.00027674
0x7f1db367f57c34c260e5cfebd37fafa6174f510e993f1eba35a7820938cc6423359138435 days 13 hrs ago0x73f0ed546cd7893abc5e04284b68522602603dd4  IN   0xfaf4a5fbf621b049215c19a73babd0b94fd9155f0 Ether0.00055034
0x7031696e564640d45a84c1f476515ad7b0bf5c816de1a219a50151bc7f7e6b7e359135535 days 13 hrs ago0x73f0ed546cd7893abc5e04284b68522602603dd4  IN   0xfaf4a5fbf621b049215c19a73babd0b94fd9155f0 Ether0.00091522
0x5785ba17a39d56cc1dfeef0a9dc4b1e83a58e2ef274c67d451c44b4f7ece0a49359134735 days 13 hrs ago0x73f0ed546cd7893abc5e04284b68522602603dd4  IN   0xfaf4a5fbf621b049215c19a73babd0b94fd9155f0 Ether0.00055298
0xaf2c8d7257830f49736e4d358900a1b88762fcdfa2f0a0b7ec00a3988e93f41c359125235 days 14 hrs agoOraclize  IN   0xfaf4a5fbf621b049215c19a73babd0b94fd9155f0 Ether0.00313854
0x84eee08aa65dfb087f984cec084b9d6080709a35e3d1ba4ffa8022e565a08755359124835 days 14 hrs ago0x00cb5f65d61d5ead6a99752fcd00d4e3e2066c81  IN   0xfaf4a5fbf621b049215c19a73babd0b94fd9155f0.5 Ether0.00387404
0xbbabb3069dcc88e949c03f57675a05ca0b73cbc31bebfbfd8a8c2ba01787ba16359091835 days 15 hrs agoOraclize  IN   0xfaf4a5fbf621b049215c19a73babd0b94fd9155f0 Ether0.00313982
0x2d1cd89c1babc142797b4c4370552d6d6510718c6d55f029c8e62759b57bfe1d359091335 days 15 hrs ago0x5063629be02cc5cfd71a856d084e6a638e3ce7ce  IN   0xfaf4a5fbf621b049215c19a73babd0b94fd9155f1.18 Ether0.00387404
0xd3824bc9a673a2bc8d64c1c0d4c925de1c35e046c80e4a58627a2dad42dac99f359090935 days 15 hrs agoOraclize  IN   0xfaf4a5fbf621b049215c19a73babd0b94fd9155f0 Ether0.00313982
0xaa41a21c4d1d5d7ec299a9c48371c3f794e279d50784f7d5eec800ec32dfe889359090735 days 15 hrs ago0x5063629be02cc5cfd71a856d084e6a638e3ce7ce  IN   0xfaf4a5fbf621b049215c19a73babd0b94fd9155f2 Ether0.00387404
0xbbd7461aafd1daa67d40aadfd023d39686a3b5f54e64426f40afe0e7a4a337c6359090235 days 15 hrs agoOraclize  IN   0xfaf4a5fbf621b049215c19a73babd0b94fd9155f0 Ether0.00313982
0x12256016748fa78d03c44ddadeb043f524c5906dd41ef1a9c17b56c8dc24aa82359089935 days 15 hrs ago0x5063629be02cc5cfd71a856d084e6a638e3ce7ce  IN   0xfaf4a5fbf621b049215c19a73babd0b94fd9155f2 Ether0.00387404
0x9a639c2cf5b4c8839a06cceefaca40034af5ed68d355a59948704eb1376607f4359084535 days 15 hrs agoOraclize  IN   0xfaf4a5fbf621b049215c19a73babd0b94fd9155f0 Ether0.00335582
0x6159238b3962216a84dedea61a1dbaf021775f63b49d236c08139ece24640270359083935 days 15 hrs ago0x5063629be02cc5cfd71a856d084e6a638e3ce7ce  IN   0xfaf4a5fbf621b049215c19a73babd0b94fd9155f1.54 Ether0.00399263
0x0eb1b98b637ce379afd5da2689518130c7f5fcd5eb3eb61439f1f344c4471bfb359083135 days 15 hrs agoOraclize  IN   0xfaf4a5fbf621b049215c19a73babd0b94fd9155f0 Ether0.00335582
0xf49114531fb587d45f4ca43c8bce3feb6a705a6385712f2fb3df9d5399dcc596359082635 days 15 hrs ago0x5063629be02cc5cfd71a856d084e6a638e3ce7ce  IN   0xfaf4a5fbf621b049215c19a73babd0b94fd9155f2 Ether0.0041375
0x296d4318d9f0c2378b11e119a957a9e5b479d6fb7d7fbca804c79a3d2aa10ec1359081335 days 15 hrs agoOraclize  IN   0xfaf4a5fbf621b049215c19a73babd0b94fd9155f0 Ether0.00335454
0x6ce07c116e0127978b6ff52df3bb8397a0ca587ca3241fc0c14fb7e4b1484042359081035 days 15 hrs ago0x5063629be02cc5cfd71a856d084e6a638e3ce7ce  IN   0xfaf4a5fbf621b049215c19a73babd0b94fd9155f1.9 Ether0.00387404
0xf1edf00e7db1fa627a9f8650e5ac3c529d528e073ed7eddc2522431bac92cdc3359080635 days 15 hrs agoOraclize  IN   0xfaf4a5fbf621b049215c19a73babd0b94fd9155f0 Ether0.00335582
0x19f2ddfc56ff903cdf979279fd3cfe2605e99e911eb2e5533731f249fbd5f6f8359080335 days 15 hrs ago0x5063629be02cc5cfd71a856d084e6a638e3ce7ce  IN   0xfaf4a5fbf621b049215c19a73babd0b94fd9155f1.87 Ether0.00387404

[Download: CSV Export ]    
 Internal Transactions as a result of Contract Execution
  Latest 25 Internal Txns from a total of 7837 View All
ParentTxHash Block Age From To Value
0xe5e1bdb5f7332aa8dd7148303fb77fc2cd7bef4010b31265ad34d0bddd0f7b86359140135 days 13 hrs ago0xfaf4a5fbf621b049215c19a73babd0b94fd9155f0x73f0ed546cd7893abc5e04284b68522602603dd40 Ether
0x7031696e564640d45a84c1f476515ad7b0bf5c816de1a219a50151bc7f7e6b7e359135535 days 13 hrs ago0xfaf4a5fbf621b049215c19a73babd0b94fd9155f0x24c3235558572cff8054b5a419251d3b0d43e91b176.831067832616036395 Ether
0xaf2c8d7257830f49736e4d358900a1b88762fcdfa2f0a0b7ec00a3988e93f41c359125235 days 14 hrs ago0xfaf4a5fbf621b049215c19a73babd0b94fd9155f0x00cb5f65d61d5ead6a99752fcd00d4e3e2066c811 wei
0x84eee08aa65dfb087f984cec084b9d6080709a35e3d1ba4ffa8022e565a08755359124835 days 14 hrs ago0xfaf4a5fbf621b049215c19a73babd0b94fd9155f0x001a589dda0d6be37632925eaf1256986b2c6ad00.0057245901639344 Ether
0xbbabb3069dcc88e949c03f57675a05ca0b73cbc31bebfbfd8a8c2ba01787ba16359091835 days 15 hrs ago0xfaf4a5fbf621b049215c19a73babd0b94fd9155f0x5063629be02cc5cfd71a856d084e6a638e3ce7ce1 wei
0x2d1cd89c1babc142797b4c4370552d6d6510718c6d55f029c8e62759b57bfe1d359091335 days 15 hrs ago0xfaf4a5fbf621b049215c19a73babd0b94fd9155f0x001a589dda0d6be37632925eaf1256986b2c6ad00.0057245901639344 Ether
0xd3824bc9a673a2bc8d64c1c0d4c925de1c35e046c80e4a58627a2dad42dac99f359090935 days 15 hrs ago0xfaf4a5fbf621b049215c19a73babd0b94fd9155f0x5063629be02cc5cfd71a856d084e6a638e3ce7ce1 wei
0xaa41a21c4d1d5d7ec299a9c48371c3f794e279d50784f7d5eec800ec32dfe889359090735 days 15 hrs ago0xfaf4a5fbf621b049215c19a73babd0b94fd9155f0x001a589dda0d6be37632925eaf1256986b2c6ad00.0057245901639344 Ether
0xbbd7461aafd1daa67d40aadfd023d39686a3b5f54e64426f40afe0e7a4a337c6359090235 days 15 hrs ago0xfaf4a5fbf621b049215c19a73babd0b94fd9155f0x5063629be02cc5cfd71a856d084e6a638e3ce7ce1 wei
0x12256016748fa78d03c44ddadeb043f524c5906dd41ef1a9c17b56c8dc24aa82359089935 days 15 hrs ago0xfaf4a5fbf621b049215c19a73babd0b94fd9155f0x001a589dda0d6be37632925eaf1256986b2c6ad00.0057245901639344 Ether
0x9a639c2cf5b4c8839a06cceefaca40034af5ed68d355a59948704eb1376607f4359084535 days 15 hrs ago0xfaf4a5fbf621b049215c19a73babd0b94fd9155f0x5063629be02cc5cfd71a856d084e6a638e3ce7ce3.314347826086956521 Ether
0x6159238b3962216a84dedea61a1dbaf021775f63b49d236c08139ece24640270359083935 days 15 hrs ago0xfaf4a5fbf621b049215c19a73babd0b94fd9155f0x001a589dda0d6be37632925eaf1256986b2c6ad00.0057245901639344 Ether
0x0eb1b98b637ce379afd5da2689518130c7f5fcd5eb3eb61439f1f344c4471bfb359083135 days 15 hrs ago0xfaf4a5fbf621b049215c19a73babd0b94fd9155f0x5063629be02cc5cfd71a856d084e6a638e3ce7ce3.807692307692307691 Ether
0xf49114531fb587d45f4ca43c8bce3feb6a705a6385712f2fb3df9d5399dcc596359082635 days 15 hrs ago0xfaf4a5fbf621b049215c19a73babd0b94fd9155f0x001a589dda0d6be37632925eaf1256986b2c6ad00.0057245901639344 Ether
0x296d4318d9f0c2378b11e119a957a9e5b479d6fb7d7fbca804c79a3d2aa10ec1359081335 days 15 hrs ago0xfaf4a5fbf621b049215c19a73babd0b94fd9155f0x5063629be02cc5cfd71a856d084e6a638e3ce7ce3.762 Ether
0x6ce07c116e0127978b6ff52df3bb8397a0ca587ca3241fc0c14fb7e4b1484042359081035 days 15 hrs ago0xfaf4a5fbf621b049215c19a73babd0b94fd9155f0x001a589dda0d6be37632925eaf1256986b2c6ad00.0057245901639344 Ether
0xf1edf00e7db1fa627a9f8650e5ac3c529d528e073ed7eddc2522431bac92cdc3359080635 days 15 hrs ago0xfaf4a5fbf621b049215c19a73babd0b94fd9155f0x5063629be02cc5cfd71a856d084e6a638e3ce7ce2.89265625 Ether
0x19f2ddfc56ff903cdf979279fd3cfe2605e99e911eb2e5533731f249fbd5f6f8359080335 days 15 hrs ago0xfaf4a5fbf621b049215c19a73babd0b94fd9155f0x001a589dda0d6be37632925eaf1256986b2c6ad00.0057245901639344 Ether
0xbbb60a4f8a19af1b804fa4e4f118845f6aa09a72deed6088d50a2105d5f0dd15359079635 days 15 hrs ago0xfaf4a5fbf621b049215c19a73babd0b94fd9155f0x5063629be02cc5cfd71a856d084e6a638e3ce7ce3.882352941176470588 Ether
0x154dbbf2fca082fec7d8e36990090e1659d8d2e2c4e5f48ccc8b47bfb6c8861b359079235 days 15 hrs ago0xfaf4a5fbf621b049215c19a73babd0b94fd9155f0x001a589dda0d6be37632925eaf1256986b2c6ad00.0057245901639344 Ether
0x86205b8f92c5435644d4b5c50913698e00f6711ff6bee110bead05bdc58b1600359078835 days 15 hrs ago0xfaf4a5fbf621b049215c19a73babd0b94fd9155f0x5063629be02cc5cfd71a856d084e6a638e3ce7ce1 wei
0xde5b5f8b2c1406d6cb3231a03c8264c6cdc5d1e8cdccbe477db7e3a2179e10db359078435 days 15 hrs ago0xfaf4a5fbf621b049215c19a73babd0b94fd9155f0x001a589dda0d6be37632925eaf1256986b2c6ad00.0057245901639344 Ether
0x41415f6817bd4ce5a8f80bd1007f92daa44b34a23d841bb3444f92f319d0a317359078135 days 16 hrs ago0xfaf4a5fbf621b049215c19a73babd0b94fd9155f0x5063629be02cc5cfd71a856d084e6a638e3ce7ce3.526875 Ether
0x72c26d1c3af2b7124aaaa26bb638d830d5bc886a4dc8f790ac81ea602eb31455359077835 days 16 hrs ago0xfaf4a5fbf621b049215c19a73babd0b94fd9155f0x001a589dda0d6be37632925eaf1256986b2c6ad00.0057245901639344 Ether
0x543085c063cfb2ca80b28403f59813088c235c79cb2273c9dd2c1ea2766a1a12359076035 days 16 hrs ago0xfaf4a5fbf621b049215c19a73babd0b94fd9155f0x5063629be02cc5cfd71a856d084e6a638e3ce7ce3.7125 Ether

[Download: CSV Export ]    
Contract SUICIDE called at TxHash 0xe5e1bdb5f7332aa8dd7148303fb77fc2cd7bef4010b31265ad34d0bddd0f7b86

Warning: The compiled contract might be susceptible to ConstantOptimizerSubtraction (low-severity) Solidity compiler bugs.

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



  Contract Source Code   Find Similiar Contracts
pragma solidity ^0.4.2;

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



Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:



The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.



THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/

contract OraclizeI {
    address public cbAddress;
    function query(uint _timestamp, string _datasource, string _arg) payable returns (bytes32 _id);
    function query_withGasLimit(uint _timestamp, string _datasource, string _arg, uint _gaslimit) payable returns (bytes32 _id);
    function query2(uint _timestamp, string _datasource, string _arg1, string _arg2) payable returns (bytes32 _id);
    function query2_withGasLimit(uint _timestamp, string _datasource, string _arg1, string _arg2, uint _gaslimit) payable returns (bytes32 _id);
    function queryN(uint _timestamp, string _datasource, bytes _argN) payable returns (bytes32 _id);
    function queryN_withGasLimit(uint _timestamp, string _datasource, bytes _argN, uint _gaslimit) payable returns (bytes32 _id);
    function getPrice(string _datasource) returns (uint _dsprice);
    function getPrice(string _datasource, uint gaslimit) returns (uint _dsprice);
    function useCoupon(string _coupon);
    function setProofType(byte _proofType);
    function setConfig(bytes32 _config);
    function setCustomGasPrice(uint _gasPrice);
}
contract OraclizeAddrResolverI {
    function getAddress() returns (address _addr);
}
contract usingOraclize {
    uint constant day = 60*60*24;
    uint constant week = 60*60*24*7;
    uint constant month = 60*60*24*30;
    byte constant proofType_NONE = 0x00;
    byte constant proofType_TLSNotary = 0x10;
    byte constant proofStorage_IPFS = 0x01;
    uint8 constant networkID_auto = 0;
    uint8 constant networkID_mainnet = 1;
    uint8 constant networkID_testnet = 2;
    uint8 constant networkID_morden = 2;
    uint8 constant networkID_consensys = 161;

    OraclizeAddrResolverI OAR;

    OraclizeI oraclize;
    modifier oraclizeAPI {
        if((address(OAR)==0)||(getCodeSize(address(OAR))==0)) oraclize_setNetwork(networkID_auto);
        oraclize = OraclizeI(OAR.getAddress());
        _;
    }
    modifier coupon(string code){
        oraclize = OraclizeI(OAR.getAddress());
        oraclize.useCoupon(code);
        _;
    }

    function oraclize_setNetwork(uint8 networkID) internal returns(bool){
        if (getCodeSize(0x1d3B2638a7cC9f2CB3D298A3DA7a90B67E5506ed)>0){ //mainnet
            OAR = OraclizeAddrResolverI(0x1d3B2638a7cC9f2CB3D298A3DA7a90B67E5506ed);
            return true;
        }
        if (getCodeSize(0xc03A2615D5efaf5F49F60B7BB6583eaec212fdf1)>0){ //ropsten testnet
            OAR = OraclizeAddrResolverI(0xc03A2615D5efaf5F49F60B7BB6583eaec212fdf1);
            return true;
        }
        if (getCodeSize(0xB7A07BcF2Ba2f2703b24C0691b5278999C59AC7e)>0){ //kovan testnet
            OAR = OraclizeAddrResolverI(0xB7A07BcF2Ba2f2703b24C0691b5278999C59AC7e);
            return true;
        }
        if (getCodeSize(0x6f485C8BF6fc43eA212E93BBF8ce046C7f1cb475)>0){ //ethereum-bridge
            OAR = OraclizeAddrResolverI(0x6f485C8BF6fc43eA212E93BBF8ce046C7f1cb475);
            return true;
        }
        if (getCodeSize(0x20e12A1F859B3FeaE5Fb2A0A32C18F5a65555bBF)>0){ //ether.camp ide
            OAR = OraclizeAddrResolverI(0x20e12A1F859B3FeaE5Fb2A0A32C18F5a65555bBF);
            return true;
        }
        if (getCodeSize(0x51efaF4c8B3C9AfBD5aB9F4bbC82784Ab6ef8fAA)>0){ //browser-solidity
            OAR = OraclizeAddrResolverI(0x51efaF4c8B3C9AfBD5aB9F4bbC82784Ab6ef8fAA);
            return true;
        }
        return false;
    }

    function __callback(bytes32 myid, string result) {
        __callback(myid, result, new bytes(0));
    }
    function __callback(bytes32 myid, string result, bytes proof) {
    }

    function oraclize_getPrice(string datasource) oraclizeAPI internal returns (uint){
        return oraclize.getPrice(datasource);
    }

    function oraclize_getPrice(string datasource, uint gaslimit) oraclizeAPI internal returns (uint){
        return oraclize.getPrice(datasource, gaslimit);
    }
    
    function oraclize_query(string datasource, string arg) oraclizeAPI internal returns (bytes32 id){
        uint price = oraclize.getPrice(datasource);
        if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price
        return oraclize.query.value(price)(0, datasource, arg);
    }
    function oraclize_query(uint timestamp, string datasource, string arg) oraclizeAPI internal returns (bytes32 id){
        uint price = oraclize.getPrice(datasource);
        if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price
        return oraclize.query.value(price)(timestamp, datasource, arg);
    }
    function oraclize_query(uint timestamp, string datasource, string arg, uint gaslimit) oraclizeAPI internal returns (bytes32 id){
        uint price = oraclize.getPrice(datasource, gaslimit);
        if (price > 1 ether + tx.gasprice*gaslimit) return 0; // unexpectedly high price
        return oraclize.query_withGasLimit.value(price)(timestamp, datasource, arg, gaslimit);
    }
    function oraclize_query(string datasource, string arg, uint gaslimit) oraclizeAPI internal returns (bytes32 id){
        uint price = oraclize.getPrice(datasource, gaslimit);
        if (price > 1 ether + tx.gasprice*gaslimit) return 0; // unexpectedly high price
        return oraclize.query_withGasLimit.value(price)(0, datasource, arg, gaslimit);
    }
    function oraclize_query(string datasource, string arg1, string arg2) oraclizeAPI internal returns (bytes32 id){
        uint price = oraclize.getPrice(datasource);
        if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price
        return oraclize.query2.value(price)(0, datasource, arg1, arg2);
    }
    function oraclize_query(uint timestamp, string datasource, string arg1, string arg2) oraclizeAPI internal returns (bytes32 id){
        uint price = oraclize.getPrice(datasource);
        if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price
        return oraclize.query2.value(price)(timestamp, datasource, arg1, arg2);
    }
    function oraclize_query(uint timestamp, string datasource, string arg1, string arg2, uint gaslimit) oraclizeAPI internal returns (bytes32 id){
        uint price = oraclize.getPrice(datasource, gaslimit);
        if (price > 1 ether + tx.gasprice*gaslimit) return 0; // unexpectedly high price
        return oraclize.query2_withGasLimit.value(price)(timestamp, datasource, arg1, arg2, gaslimit);
    }
    function oraclize_query(string datasource, string arg1, string arg2, uint gaslimit) oraclizeAPI internal returns (bytes32 id){
        uint price = oraclize.getPrice(datasource, gaslimit);
        if (price > 1 ether + tx.gasprice*gaslimit) return 0; // unexpectedly high price
        return oraclize.query2_withGasLimit.value(price)(0, datasource, arg1, arg2, gaslimit);
    }
    function oraclize_query(string datasource, string[] argN) oraclizeAPI internal returns (bytes32 id){
        uint price = oraclize.getPrice(datasource);
        if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price
        bytes memory args = stra2cbor(argN);
        return oraclize.queryN.value(price)(0, datasource, args);
    }
    function oraclize_query(uint timestamp, string datasource, string[] argN) oraclizeAPI internal returns (bytes32 id){
        uint price = oraclize.getPrice(datasource);
        if (price > 1 ether + tx.gasprice*200000) return 0; // unexpectedly high price
        bytes memory args = stra2cbor(argN);
        return oraclize.queryN.value(price)(timestamp, datasource, args);
    }
    function oraclize_query(uint timestamp, string datasource, string[] argN, uint gaslimit) oraclizeAPI internal returns (bytes32 id){
        uint price = oraclize.getPrice(datasource, gaslimit);
        if (price > 1 ether + tx.gasprice*gaslimit) return 0; // unexpectedly high price
        bytes memory args = stra2cbor(argN);
        return oraclize.queryN_withGasLimit.value(price)(timestamp, datasource, args, gaslimit);
    }
    function oraclize_query(string datasource, string[] argN, uint gaslimit) oraclizeAPI internal returns (bytes32 id){
        uint price = oraclize.getPrice(datasource, gaslimit);
        if (price > 1 ether + tx.gasprice*gaslimit) return 0; // unexpectedly high price
        bytes memory args = stra2cbor(argN);
        return oraclize.queryN_withGasLimit.value(price)(0, datasource, args, gaslimit);
    }
    function oraclize_query(string datasource, string[1] args) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](1);
        dynargs[0] = args[0];
        return oraclize_query(datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, string[1] args) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](1);
        dynargs[0] = args[0];
        return oraclize_query(timestamp, datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, string[1] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](1);
        dynargs[0] = args[0];
        return oraclize_query(timestamp, datasource, dynargs, gaslimit);
    }
    function oraclize_query(string datasource, string[1] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](1);
        dynargs[0] = args[0];       
        return oraclize_query(datasource, dynargs, gaslimit);
    }
    
    function oraclize_query(string datasource, string[2] args) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](2);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        return oraclize_query(datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, string[2] args) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](2);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        return oraclize_query(timestamp, datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, string[2] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](2);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        return oraclize_query(timestamp, datasource, dynargs, gaslimit);
    }
    function oraclize_query(string datasource, string[2] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](2);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        return oraclize_query(datasource, dynargs, gaslimit);
    }
    function oraclize_query(string datasource, string[3] args) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](3);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        return oraclize_query(datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, string[3] args) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](3);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        return oraclize_query(timestamp, datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, string[3] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](3);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        return oraclize_query(timestamp, datasource, dynargs, gaslimit);
    }
    function oraclize_query(string datasource, string[3] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](3);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        return oraclize_query(datasource, dynargs, gaslimit);
    }
    
    function oraclize_query(string datasource, string[4] args) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](4);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        dynargs[3] = args[3];
        return oraclize_query(datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, string[4] args) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](4);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        dynargs[3] = args[3];
        return oraclize_query(timestamp, datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, string[4] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](4);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        dynargs[3] = args[3];
        return oraclize_query(timestamp, datasource, dynargs, gaslimit);
    }
    function oraclize_query(string datasource, string[4] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](4);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        dynargs[3] = args[3];
        return oraclize_query(datasource, dynargs, gaslimit);
    }
    function oraclize_query(string datasource, string[5] args) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](5);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        dynargs[3] = args[3];
        dynargs[4] = args[4];
        return oraclize_query(datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, string[5] args) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](5);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        dynargs[3] = args[3];
        dynargs[4] = args[4];
        return oraclize_query(timestamp, datasource, dynargs);
    }
    function oraclize_query(uint timestamp, string datasource, string[5] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](5);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        dynargs[3] = args[3];
        dynargs[4] = args[4];
        return oraclize_query(timestamp, datasource, dynargs, gaslimit);
    }
    function oraclize_query(string datasource, string[5] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
        string[] memory dynargs = new string[](5);
        dynargs[0] = args[0];
        dynargs[1] = args[1];
        dynargs[2] = args[2];
        dynargs[3] = args[3];
        dynargs[4] = args[4];
        return oraclize_query(datasource, dynargs, gaslimit);
    }

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

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

    function parseAddr(string _a) internal returns (address){
        bytes memory tmp = bytes(_a);
        uint160 iaddr = 0;
        uint160 b1;
        uint160 b2;
        for (uint i=2; i<2+2*20; i+=2){
            iaddr *= 256;
            b1 = uint160(tmp[i]);
            b2 = uint160(tmp[i+1]);
            if ((b1 >= 97)&&(b1 <= 102)) b1 -= 87;
            else if ((b1 >= 65)&&(b1 <= 70)) b1 -= 55;
            else if ((b1 >= 48)&&(b1 <= 57)) b1 -= 48;
            if ((b2 >= 97)&&(b2 <= 102)) b2 -= 87;
            else if ((b2 >= 65)&&(b2 <= 70)) b2 -= 55;
            else if ((b2 >= 48)&&(b2 <= 57)) b2 -= 48;
            iaddr += (b1*16+b2);
        }
        return address(iaddr);
    }

    function strCompare(string _a, string _b) internal returns (int) {
        bytes memory a = bytes(_a);
        bytes memory b = bytes(_b);
        uint minLength = a.length;
        if (b.length < minLength) minLength = b.length;
        for (uint i = 0; i < minLength; i ++)
            if (a[i] < b[i])
                return -1;
            else if (a[i] > b[i])
                return 1;
        if (a.length < b.length)
            return -1;
        else if (a.length > b.length)
            return 1;
        else
            return 0;
    }

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

    function strConcat(string _a, string _b, string _c, string _d, string _e) internal returns (string) {
        bytes memory _ba = bytes(_a);
        bytes memory _bb = bytes(_b);
        bytes memory _bc = bytes(_c);
        bytes memory _bd = bytes(_d);
        bytes memory _be = bytes(_e);
        string memory abcde = new string(_ba.length + _bb.length + _bc.length + _bd.length + _be.length);
        bytes memory babcde = bytes(abcde);
        uint k = 0;
        for (uint i = 0; i < _ba.length; i++) babcde[k++] = _ba[i];
        for (i = 0; i < _bb.length; i++) babcde[k++] = _bb[i];
        for (i = 0; i < _bc.length; i++) babcde[k++] = _bc[i];
        for (i = 0; i < _bd.length; i++) babcde[k++] = _bd[i];
        for (i = 0; i < _be.length; i++) babcde[k++] = _be[i];
        return string(babcde);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        return ret;
    }

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

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

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

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

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

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

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

        return self;
    }

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

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

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

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

        return equal;
    }

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

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

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

        return self;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        return ret;
    }
}


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

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

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



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

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

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

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

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

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

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

    /*
     * game vars
    */ 
    uint constant public maxProfitDivisor = 1000000;
    uint constant public houseEdgeDivisor = 1000;    
    uint constant public maxNumber = 99; 
    uint constant public minNumber = 2;
	bool public gamePaused;
    uint32 public gasForOraclize;
    address public owner;
    bool public payoutsPaused; 
    address public treasury;
    uint public contractBalance;
    uint public houseEdge;     
    uint public maxProfit;   
    uint public maxProfitAsPercentOfHouse;                    
    uint public minBet;       
    int public totalBets;
    uint public maxPendingPayouts;
    uint public costToCallOraclizeInWei;
    uint public totalWeiWon;

    /*
     * 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)
	{        
        
        /*
        * 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] BGTHWM0eEfofomIQf6Yh0YwRS47jhBH19wfMIQEnth4KbVg+wC8V220JO04JisgluUoDyDdI/sv4mAlRNcTyZg6lP6l+ociWxEsN9R9K3iygXAna2Q6yYqnhYvPoxxg5cqzR8MCkpAJ/AQm0M0VldM77Hzz31Cw=},\"n\":1,\"min\":1,\"max\":100,\"replacement\":true,\"base\":10${[identity] \"}\"},\"id\":1${[identity] \"}\"}']", gasForOraclize);
        
        /* safely update contract balance to account for cost to call oraclize*/
        contractBalance = safeSub(contractBalance, costToCallOraclizeInWei);	        
        /* total number of bets */
        totalBets += 1;
        /* 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;
    }

    /* set house cost to call oraclize query */
    function ownerUpdateCostToCallOraclize(uint newCostToCallOraclizeInWei) public 
		onlyOwner
    {        
       costToCallOraclizeInWei = newCostToCallOraclizeInWei;
    }     

    /* 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":"newCostToCallOraclizeInWei","type":"uint256"}],"name":"ownerUpdateCostToCallOraclize","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":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":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"},{"constant":true,"inputs":[],"name":"costToCallOraclizeInWei","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
606060405234156200000d57fe5b5b60028054600160a060020a033316600160a060020a0319918216811790925560038054909116909117905562000053600064010000000062001f576200011882021704565b506200008d7f1100000000000000000000000000000000000000000000000000000000000000640100000000620024806200038082021704565b620000a86103de6401000000006200071f6200051082021704565b620000c3612710640100000000620013256200053782021704565b620000e467016345785d8a0000640100000000620013726200058782021704565b6001805460a860020a63ffffffff0219167703d0900000000000000000000000000000000000000000001790555b620005ca565b60008062000148731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed64010000000062001f4f620005ae82021704565b11156200017e575060008054600160a060020a031916731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed17905560016200037b565b6000620001ad73c03a2615d5efaf5f49f60b7bb6583eaec212fdf164010000000062001f4f620005ae82021704565b1115620001e3575060008054600160a060020a03191673c03a2615d5efaf5f49f60b7bb6583eaec212fdf117905560016200037b565b60006200021273b7a07bcf2ba2f2703b24c0691b5278999c59ac7e64010000000062001f4f620005ae82021704565b111562000248575060008054600160a060020a03191673b7a07bcf2ba2f2703b24c0691b5278999c59ac7e17905560016200037b565b600062000277736f485c8bf6fc43ea212e93bbf8ce046c7f1cb47564010000000062001f4f620005ae82021704565b1115620002ad575060008054600160a060020a031916736f485c8bf6fc43ea212e93bbf8ce046c7f1cb47517905560016200037b565b6000620002dc7320e12a1f859b3feae5fb2a0a32c18f5a65555bbf64010000000062001f4f620005ae82021704565b111562000312575060008054600160a060020a0319167320e12a1f859b3feae5fb2a0a32c18f5a65555bbf17905560016200037b565b6000620003417351efaf4c8b3c9afbd5ab9f4bbc82784ab6ef8faa64010000000062001f4f620005ae82021704565b111562000377575060008054600160a060020a0319167351efaf4c8b3c9afbd5ab9f4bbc82784ab6ef8faa17905560016200037b565b5060005b919050565b600054600160a060020a03161580620003bb5750600054620003b990600160a060020a031664010000000062001f4f620005ae82021704565b155b15620003dd57620003db600064010000000062001f576200011882021704565b505b600060009054906101000a9004600160a060020a0316600160a060020a03166338cc48316000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401809050602060405180830381600087803b15156200045257fe5b60325a03f115156200046057fe5b505060408051805160018054600160a060020a031916600160a060020a0392831617908190557f688dcfd70000000000000000000000000000000000000000000000000000000083527fff000000000000000000000000000000000000000000000000000000000000008616600484015292519216925063688dcfd791602480830192600092919082900301818387803b1515620004fa57fe5b60325a03f115156200050857fe5b5050505b5b50565b60025433600160a060020a039081169116146200052d5760006000fd5b60058190555b5b50565b60025433600160a060020a03908116911614620005545760006000fd5b612710811115620005655760006000fd5b60078190556200050c640100000000620006ff620005b682021704565b5b5b50565b60025433600160a060020a03908116911614620005a45760006000fd5b60088190555b5b50565b803b5b919050565b600754600454620f424091025b046006555b565b6127d180620005da6000396000f3006060604052361561019b5763ffffffff60e060020a60003504166315c12d4d81146101d857806323214fab146101fa578063268d50fe1461021c57806326da8e171461023157806327dc297e14610246578063301cf6e71461029f57806331375242146102c357806338bbfa50146102e15780633a4f6999146103775780633c314a911461039957806343c1598d146103c75780634b7fcee7146103e95780634f44728d1461040057806355b930311461041e5780635e968a491461044057806361d027b3146104555780636cdf4c90146104815780636eacd48a146104965780637072a977146104ad5780637ac37d58146104d65780638b7afe2e146104f75780638da5cb5b146105195780639619367d14610545578063a5f4af3314610567578063b539cd551461058b578063befa1e2f146105ad578063c3de1ab9146105cf578063cf832ce2146105f3578063d207e7571461061a578063d263b7eb14610635578063d667dcd714610647578063dc6dd15214610669578063e5c774de14610676578063ed62f50114610698578063fec5438c146106ba575b6101d65b60035433600160a060020a039081169116146101bb5760006000fd5b6101c7600454346106dc565b6004556101d26106ff565b5b5b565b005b34156101e057fe5b6101e8610713565b60408051918252519081900360200190f35b341561020257fe5b6101e8610719565b60408051918252519081900360200190f35b341561022457fe5b6101d660043561071f565b005b341561023957fe5b6101d6600435610745565b005b341561024e57fe5b60408051602060046024803582810135601f81018590048502860185019096528585526101d6958335959394604494939290920191819084018382808284375094965061076b95505050505050565b005b34156102a757fe5b6102af61079b565b604080519115158252519081900360200190f35b34156102cb57fe5b6101d6600160a060020a03600435166107ab565b005b34156102e957fe5b60408051602060046024803582810135601f81018590048502860185019096528585526101d6958335959394604494939290920191819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979998810197919650918201945092508291508401838280828437509496506107e795505050505050565b005b341561037f57fe5b6101e8611270565b60408051918252519081900360200190f35b34156103a157fe5b6101e8600160a060020a0360043516611275565b60408051918252519081900360200190f35b34156103cf57fe5b6101e8611294565b60408051918252519081900360200190f35b34156103f157fe5b6101d6600435151561129b565b005b341561040857fe5b6101d6600160a060020a03600435166112e4565b005b341561042657fe5b6101e8611320565b60408051918252519081900360200190f35b341561044857fe5b6101d6600435611325565b005b341561045d57fe5b610465611363565b60408051600160a060020a039092168252519081900360200190f35b341561048957fe5b6101d6600435611372565b005b341561049e57fe5b6101d66004351515611398565b005b34156104b557fe5b6104bd6113e1565b6040805163ffffffff9092168252519081900360200190f35b34156104de57fe5b6101d6600160a060020a03600435166024356113f4565b005b34156104ff57fe5b6101e8611494565b60408051918252519081900360200190f35b341561052157fe5b61046561149a565b60408051600160a060020a039092168252519081900360200190f35b341561054d57fe5b6101e86114a9565b60408051918252519081900360200190f35b341561056f57fe5b6102af6114af565b604080519115158252519081900360200190f35b341561059357fe5b6101e861153e565b60408051918252519081900360200190f35b34156105b557fe5b6101e8611544565b60408051918252519081900360200190f35b34156105d757fe5b6102af61154a565b604080519115158252519081900360200190f35b34156105fb57fe5b6101d6600435600160a060020a036024351660443560643561155a565b005b341561062257fe5b6101d663ffffffff600435166115f6565b005b341561063d57fe5b6101d6611647565b005b341561064f57fe5b6101e8611674565b60408051918252519081900360200190f35b6101d660043561167a565b005b341561067e57fe5b6101e86118ff565b60408051918252519081900360200190f35b34156106a057fe5b6101e8611905565b60408051918252519081900360200190f35b34156106c257fe5b6101e861190b565b60408051918252519081900360200190f35b60006106e88383611911565b15156106f45760006000fd5b508181015b92915050565b600754600454620f424091025b046006555b565b600c5481565b60075481565b60025433600160a060020a0390811691161461073b5760006000fd5b60058190555b5b50565b60025433600160a060020a039081169116146107615760006000fd5b600b8190555b5b50565b6107968282600060405180591061077f5750595b908082528060200260200182016040525b506107e7565b5b5050565b60025460a060020a900460ff1681565b60025433600160a060020a039081169116146107c75760006000fd5b60038054600160a060020a031916600160a060020a0383161790555b5b50565b6107ef612445565b60006107f961191f565b600160a060020a031633600160a060020a03161415156108195760006000fd5b60025460a060020a900460ff161515600114156108365760006000fd5b6000858152600d6020526040902054600160a060020a0316151561085a5760006000fd5b61086384611a5b565b91506108d061088e6040604051908101604052806001815260200160f860020a605d02815250611a5b565b6108c46108b76040604051908101604052806001815260200160f860020a605b02815250611a5b565b859063ffffffff611a8416565b9063ffffffff611af016565b5061093061092b610926610919604060405190810160405280600281526020017f2c20000000000000000000000000000000000000000000000000000000000000815250611a5b565b859063ffffffff611b5916565b611b74565b611bd0565b90506109ad61092b6109266109616040604051908101604052806001815260200160f860020a605d02815250611a5b565b6108c461098a6040604051908101604052806001815260200160f860020a605b02815250611a5b565b879063ffffffff611a8416565b9063ffffffff611af016565b611b74565b611bd0565b6000868152601260209081526040918290208390559051828152855160649392879291828201918401908083835b602083106109fa5780518252601f1990920191602091820191016109db565b5181516020939093036101000a60001901801990911692169190911790526040519201829003909120935050508215159050610a3257fe5b600087815260136020908152604080832094909306600101909355600d83528181208054600e85528383208054600160a060020a03909216600160a060020a0319928316179055815416905560168352818120805460179094529181209283559055600a549054610aa39190611be5565b600a5560008581526010602090815260408083208054601184528285205583905560139091529020541515610d6b576000858152600e6020908152604080832054600f83528184205460148452828520546013855283862054601186529584902054845182815280870188905294850181905260036060860181905260a0608087018181528c51918801919091528b51600160a060020a039096169894978a976000805160206125d2833981519152979596958e93919260c0840191908501908083838215610b8d575b805182526020831115610b8d57601f199092019160209182019101610b6d565b505050905090810190601f168015610bb95780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a46000858152600e60209081526040808320546011909252808320549051600160a060020a039092169281156108fc029290818181858888f193505050501515610d66576000858152600e6020908152604080832054600f83528184205460148452828520546013855283862054601186529584902054845182815280870188905294850181905260046060860181905260a0608087018181528c51918801919091528b51600160a060020a039096169894978a976000805160206125d2833981519152979596958e93919260c0840191908501908083838215610cc8575b805182526020831115610cc857601f199092019160209182019101610ca8565b505050905090810190601f168015610cf45780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a46000858152600e6020908152604080832054600160a060020a031683526015825280832054888452601190925290912054610d4091906106dc565b6000868152600e6020908152604080832054600160a060020a0316835260159091529020555b611265565b600085815260146020908152604080832054601390925290912054101561109657600454600086815260176020526040902054610da89190611be5565b600455600c54600086815260176020526040902054610dc791906106dc565b600c55600085815260176020908152604080832054601190925290912054610def91906106dc565b6000868152601760208181526040808420859055600e825280842054600f8352818520546014845282862054601385529583902054948452825186815280850186905292830187905260016060840181905260a0608085018181528c51918601919091528b51600160a060020a039094169892978a976000805160206125d283398151915297919690958e93919260c0840191908501908083838215610eb0575b805182526020831115610eb057601f199092019160209182019101610e90565b505050905090810190601f168015610edc5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a4610ef56106ff565b6000858152600e60209081526040808320546017909252808320549051600160a060020a039092169281156108fc029290818181858888f193505050501515610d66576000858152600e6020908152604080832054600f83528184205460148452828520546013855283862054601786529584902054845182815280870188905294850181905260026060860181905260a0608087018181528c51918801919091528b51600160a060020a039096169894978a976000805160206125d2833981519152979596958e93919260c0840191908501908083838215610ff3575b805182526020831115610ff357601f199092019160209182019101610fd3565b505050905090810190601f16801561101f5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a46000858152600e6020908152604080832054600160a060020a031683526015825280832054888452601790925290912054610d4091906106dc565b6000868152600e6020908152604080832054600160a060020a0316835260159091529020555b611265565b60008581526014602090815260408083205460139092529091205410611265576000858152600e6020908152604080832054600f83528184205460148452828520546013855283862054601186528487205485518381528088018390529586018190526060860188905260a0608087018181528c51918801919091528b51600160a060020a039096169894978a976000805160206125d283398151915297959694959394938e93919260c0840191908501908083838215611172575b80518252602083111561117257601f199092019160209182019101611152565b505050905090810190601f16801561119e5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a46004546000868152601160205260409020546111cf9190600019016106dc565b6004556111da6106ff565b6000858152600e6020526040808220549051600160a060020a03909116919060019082818181858883f193505050501515610d66576000858152600e6020908152604080832054600160a060020a031683526015909152902054610d409060016106dc565b6000868152600e6020908152604080832054600160a060020a0316835260159091529020555b5b5b5b5b5050505050565b606381565b600160a060020a0381166000908152601560205260409020545b919050565b620f424081565b60025433600160a060020a039081169116146112b75760006000fd5b6002805474ff0000000000000000000000000000000000000000191660a060020a831515021790555b5b50565b60025433600160a060020a039081169116146113005760006000fd5b60028054600160a060020a031916600160a060020a0383161790555b5b50565b600281565b60025433600160a060020a039081169116146113415760006000fd5b6127108111156113515760006000fd5b60078190556107416106ff565b5b5b50565b600354600160a060020a031681565b60025433600160a060020a0390811691161461138e5760006000fd5b60088190555b5b50565b60025433600160a060020a039081169116146113b45760006000fd5b6001805474ff0000000000000000000000000000000000000000191660a060020a831515021790555b5b50565b60015460a860020a900463ffffffff1681565b60025433600160a060020a039081169116146114105760006000fd5b61141c60045482611be5565b6004556114276106ff565b604051600160a060020a0383169082156108fc029083906000818181858888f1935050505015156114585760006000fd5b6040518190600160a060020a038416907f42c501a185f41a8eb77b0a3e7b72a6435ea7aa752f8a1a0a13ca4628495eca9190600090a35b5b5050565b60045481565b600254600160a060020a031681565b60085481565b60006000600260149054906101000a900460ff1615156001151514156114d55760006000fd5b50600160a060020a033316600081815260156020526040808220805490839055905190929183919081818185876185025a03f1925050501561151a5760019150611538565b600160a060020a033316600090815260156020526040812082905591505b5b5b5090565b60065481565b60095481565b60015460a060020a900460ff1681565b60025433600160a060020a039081169116146115765760006000fd5b611582600a5483611be5565b600a55604051600160a060020a0384169082156108fc029083906000818181858888f1935050505015156115b65760006000fd5b6040518190600160a060020a0385169086907f7b6ccf85690b8ce1b7d21a94ca738803a9da7dc74e10140f269efa0d8d6fb85190600090a45b5b50505050565b60025433600160a060020a039081169116146116125760006000fd5b6001805478ffffffff000000000000000000000000000000000000000000191660a860020a63ffffffff8416021790555b5b50565b60025433600160a060020a039081169116146116635760006000fd5b600254600160a060020a0316ff5b5b565b60055481565b6001805460009160a060020a90910460ff161515141561169a5760006000fd5b3482600654826103e8600554856116b2866001611be5565b6116bd876001611be5565b60640388028115156116cb57fe5b0401028115156116d757fe5b040311806116e6575060085482105b806116f15750600281105b806116fc5750606381115b156117075760006000fd5b611773604060405190810160405280600681526020017f6e657374656400000000000000000000000000000000000000000000000000008152506101e0604051908101604052806101b481526020016125f26101b4913960015460a860020a900463ffffffff16611c08565b9250611783600454600b54611be5565b6004556009805460019081019091556000848152600f6020908152604080832087905560148252808320889055601082528083203490819055600d9092529091208054600160a060020a03191633600160a060020a031617905560055490916103e8919083906117f4908990611be5565b6117ff896001611be5565b606403340281151561180d57fe5b04010281151561181957fe5b60008681526016602052604090209190049190910390819055600a5461183e916106dc565b600a81905560045490106118525760006000fd5b60008381526010602090815260408083205460169092529091205461187791906106dc565b6000848152600d6020908152604080832054600f83528184205460168452828520546010855283862054601486529584902054845191825294810195909552848301939093529051600160a060020a03909116927f1cb5bfc4e69cbacf65c8e05bdb84d7a327bd6bb4c034ff82359aefd7443775c4919081900360600190a45b5b50505b5050565b6103e881565b600a5481565b600b5481565b808201829010155b92915050565b60008054600160a060020a0316158061194a575060005461194890600160a060020a0316611f4f565b155b1561195b576119596000611f57565b505b600060009054906101000a9004600160a060020a0316600160a060020a03166338cc48316000604051602001526040518163ffffffff1660e060020a028152600401809050602060405180830381600087803b15156119b657fe5b60325a03f115156119c357fe5b505060408051805160018054600160a060020a031916600160a060020a0392831617908190556000602093840181905284517fc281d19e000000000000000000000000000000000000000000000000000000008152945191909216945063c281d19e9360048082019493918390030190829087803b1515611a4057fe5b60325a03f11515611a4d57fe5b5050604051519150505b5b90565b611a63612445565b50604080518082019091528151815260208281019082018190525b50919050565b611a8c612445565b81518351600091901015611aa257839150611ae9565b506020808301519084015160019114611aca5750815160208481015190840151829020919020145b8015611ae55782518451038452825160208501805190910190525b8391505b5092915050565b611af8612445565b8151835160009182911015611b0f57849250611b51565b50508151835160208086015190850151910191909103906001908214611b3f575082516020840151819020908220145b8015611b4d57835185510385525b8492505b505092915050565b611b61612445565b611ae9838383612154565b505b92915050565b611b7c61245c565b611b8461245c565b60008360000151604051805910611b985750595b908082528060200260200182016040525b509150602082019050611bc581856020015186600001516121c8565b8192505b5050919050565b6000611bdd826000612211565b90505b919050565b6000611bf18383612393565b1515611bfd5760006000fd5b508082035b92915050565b600080548190600160a060020a03161580611c355750600054611c3390600160a060020a0316611f4f565b155b15611c4657611c446000611f57565b505b600060009054906101000a9004600160a060020a0316600160a060020a03166338cc48316000604051602001526040518163ffffffff1660e060020a028152600401809050602060405180830381600087803b1515611ca157fe5b60325a03f11515611cae57fe5b505060408051805160018054600160a060020a031916600160a060020a039283161790819055600060209384015283517f2ef3accc00000000000000000000000000000000000000000000000000000000815260248101899052600481019485528a5160448201528a51919092169450632ef3accc938a93899391928392606401918601908083838215611d5d575b805182526020831115611d5d57601f199092019160209182019101611d3d565b505050905090810190601f168015611d895780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b1515611da557fe5b60325a03f11515611db257fe5b505060405151915050670de0b6b3a76400003a840201811115611dd85760009150611f46565b600160009054906101000a9004600160a060020a0316600160a060020a031663c51be90f8260008888886000604051602001526040518663ffffffff1660e060020a028152600401808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360008314611e78575b805182526020831115611e7857601f199092019160209182019101611e58565b505050905090810190601f168015611ea45780820380516001836020036101000a031916815260200191505b5083810382528551815285516020918201918701908083838215611ee3575b805182526020831115611ee357601f199092019160209182019101611ec3565b505050905090810190601f168015611f0f5780820380516001836020036101000a031916815260200191505b5096505050505050506020604051808303818588803b1515611f2d57fe5b61235a5a03f11515611f3b57fe5b505060405151935050505b5b509392505050565b803b5b919050565b60006000611f78731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed611f4f565b1115611fac575060008054600160a060020a031916731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed179055600161128f565b6000611fcb73c03a2615d5efaf5f49f60b7bb6583eaec212fdf1611f4f565b1115611fff575060008054600160a060020a03191673c03a2615d5efaf5f49f60b7bb6583eaec212fdf1179055600161128f565b600061201e73b7a07bcf2ba2f2703b24c0691b5278999c59ac7e611f4f565b1115612052575060008054600160a060020a03191673b7a07bcf2ba2f2703b24c0691b5278999c59ac7e179055600161128f565b6000612071736f485c8bf6fc43ea212e93bbf8ce046c7f1cb475611f4f565b11156120a5575060008054600160a060020a031916736f485c8bf6fc43ea212e93bbf8ce046c7f1cb475179055600161128f565b60006120c47320e12a1f859b3feae5fb2a0a32c18f5a65555bbf611f4f565b11156120f8575060008054600160a060020a0319167320e12a1f859b3feae5fb2a0a32c18f5a65555bbf179055600161128f565b60006121177351efaf4c8b3c9afbd5ab9f4bbc82784ab6ef8faa611f4f565b111561214b575060008054600160a060020a0319167351efaf4c8b3c9afbd5ab9f4bbc82784ab6ef8faa179055600161128f565b5060005b919050565b61215c612445565b600061217a856000015186602001518660000151876020015161239e565b602080870180519186019190915280518203855286519051919250018114156121a657600085526121bc565b8351835186519101900385528351810160208601525b8291505b509392505050565b60005b602082106121ed5782518452602093840193909201915b6020820391506121cb565b6001826020036101000a039050801983511681855116818117865250505b50505050565b600061221b61245c565b5082600080805b83518110156123735783517f30000000000000000000000000000000000000000000000000000000000000009085908390811061225b57fe5b90602001015160f860020a900460f860020a02600160f860020a031916101580156122d1575083517f3900000000000000000000000000000000000000000000000000000000000000908590839081106122b157fe5b90602001015160f860020a900460f860020a02600160f860020a03191611155b1561232b5781156122f0578515156122e857612373565b600019909501945b5b600a830292506030848281518110151561230757fe5b90602001015160f860020a900460f860020a0260f860020a90040383019250612369565b838181518110151561233957fe5b90602001015160f860020a900460f860020a02600160f860020a031916602e60f860020a02141561236957600191505b5b5b600101612222565b60008611156123855785600a0a830292505b8294505b5050505092915050565b818111155b92915050565b60008080808088871161243157602087116123f55760018760200360080260020a031980875116888b038a018a96505b8183885116146123ea5760018701968190106123ce578b8b0196505b505050839450612439565b8686209150879350600092505b868903831161243157508583208181141561241f57839450612439565b6001840193505b600190920191612402565b5b5b88880194505b50505050949350505050565b604080518082019091526000808252602082015290565b60408051602081019091526000815290565b60408051602081019091526000815290565b600054600160a060020a031615806124aa57506000546124a890600160a060020a0316611f4f565b155b156124bb576124b96000611f57565b505b600060009054906101000a9004600160a060020a0316600160a060020a03166338cc48316000604051602001526040518163ffffffff1660e060020a028152600401809050602060405180830381600087803b151561251657fe5b60325a03f1151561252357fe5b505060408051805160018054600160a060020a031916600160a060020a0392831617908190557f688dcfd70000000000000000000000000000000000000000000000000000000083527fff000000000000000000000000000000000000000000000000000000000000008616600484015292519216925063688dcfd791602480830192600092919082900301818387803b15156125bc57fe5b60325a03f115156115ef57fe5b5050505b5b5056008dd0b145385d04711e29558ceab40b456976a2b9a7d648cc1bcd416161bf97b95b55524c5d205b276a736f6e2868747470733a2f2f6170692e72616e646f6d2e6f72672f6a736f6e2d7270632f312f696e766f6b65292e726573756c742e72616e646f6d5b2273657269616c4e756d626572222c2264617461225d272c20275c6e7b226a736f6e727063223a22322e30222c226d6574686f64223a2267656e65726174655369676e6564496e746567657273222c22706172616d73223a7b226170694b6579223a247b5b646563727970745d2042475448574d306545666f666f6d495166365968305977525334376a684248313977664d4951456e7468344b6256672b774338563232304a4f30344a6973676c75556f44794464492f7376346d416c524e6354795a67366c50366c2b6f6369577845734e3952394b3369796758416e613251367959716e685976506f7878673563717a52384d436b70414a2f41516d304d30566c644d3737487a7a333143773d7d2c226e223a312c226d696e223a312c226d6178223a3130302c227265706c6163656d656e74223a747275652c2262617365223a3130247b5b6964656e746974795d20227d227d2c226964223a31247b5b6964656e746974795d20227d227d275da165627a7a7230582082b0f4a65cc8bfcb7251d17ea31b1c37efc4559b78564a4bb16027e95af5093b0029

   Swarm Source:
bzzr://82b0f4a65cc8bfcb7251d17ea31b1c37efc4559b78564a4bb16027e95af5093b
View All
Block Age txn Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward