Sponsored:   Ubex.com - Additional 17% of tokens are available for purchase! Trading on exchanges already started.
Contract Overview
Balance: 56.939709999999999998 Ether
Ether Value: $15,676.07 (@ $275.31/ETH)
Transactions: 12 txns
 Latest 12 txns

TxHash Age From To Value [TxFee]
0xdcfa018c5123dc506d2bf80f3c7e2f78638e9dbdf818486feb620681626503af49 days 7 hrs ago0xaefa723998e0d99b81120169ce1ffe684a360178  IN   0x6de3cc59152e19f108378984f45e20a34c9f63380.04162916 Ether0.000107575
0x17cb1c760bb43bec29a94a85a8543af8e1201d03b0d2cad1ede69292c677bbda139 days 6 hrs agoOraclize  IN   0x6de3cc59152e19f108378984f45e20a34c9f63380 Ether0.00162754
0x5fabfd7d0aa47baa754d900851f5137d6d05300a4166f62d82dd7cdc2ac094cc139 days 6 hrs ago0xe2ff2fbc3149fdfcff839703be5fcdf44805b720  IN   0x6de3cc59152e19f108378984f45e20a34c9f63380.1 Ether0.00898895
0x696b552e51bc5eabe9fb68ae11f83d16a04401ba388fdaeda776649eaf1b814b142 days 18 hrs agoOraclize  IN   0x6de3cc59152e19f108378984f45e20a34c9f63380 Ether0.00163922
0xe657ac3d54e9803be2f85dce09ef787c5edf512c67b9eebb6654b26bc10bd6a3142 days 22 hrs ago0x4539809f766a0ee7c8614c7a55331871a1fffaee  IN   0x6de3cc59152e19f108378984f45e20a34c9f63380.1 Ether0.0007370939
0xcd6501e3530346aac7c73ec0151106709d687205c31754064ed79c9da3cc37dc186 days 2 hrs agoOraclize  IN   0x6de3cc59152e19f108378984f45e20a34c9f63380 Ether0.00202734
0x903671273d241fae53a6c4defc020bb108b1d33962dc8833d6b28560034f10e3186 days 2 hrs ago0x004ce63f3edcd6087665f7bf2ff9f64ff90ae47c  IN   0x6de3cc59152e19f108378984f45e20a34c9f63380.15 Ether0.00359558
0x6ae5377e0b8d8c5e478d4d16d3b031ddad35eb723e61c9d485bbfddfd62bb568186 days 2 hrs agoOraclize  IN   0x6de3cc59152e19f108378984f45e20a34c9f63380 Ether0.00321212
0xf4b16930c75a6344af84a09b4ef5557e0585f5c11274e7d4c64b39d2c1648719186 days 2 hrs ago0x004ce63f3edcd6087665f7bf2ff9f64ff90ae47c  IN   0x6de3cc59152e19f108378984f45e20a34c9f63380.1 Ether0.00389558
0xcc634f4529cea3a77331a4f7d9cdf1388389e94fe8f908078570d0c00f5b0b7f186 days 2 hrs ago0x004ce63f3edcd6087665f7bf2ff9f64ff90ae47c  IN   0x6de3cc59152e19f108378984f45e20a34c9f63380.1 Ether0.00042
0x67693fa7eba0682962cc35312501554fbeb3e760e3410a85166c3506ecf4fe85186 days 2 hrs ago0x004ce63f3edcd6087665f7bf2ff9f64ff90ae47c  IN   0x6de3cc59152e19f108378984f45e20a34c9f633857 Ether0.00043234
0x1c2d390f6cc71993872bbb97da29d7813bfa4da301ebb500f44c30a22e4a4b90186 days 2 hrs ago0x004ce63f3edcd6087665f7bf2ff9f64ff90ae47c  IN    Contract Creation0 Ether0.069661671699
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
 Latest 8 Internal Transactions

ParentTxHash Block Age From To Value
0x17cb1c760bb43bec29a94a85a8543af8e1201d03b0d2cad1ede69292c677bbda5338315139 days 6 hrs ago0x6de3cc59152e19f108378984f45e20a34c9f63380xe2ff2fbc3149fdfcff839703be5fcdf44805b7201 wei
0x5fabfd7d0aa47baa754d900851f5137d6d05300a4166f62d82dd7cdc2ac094cc5338313139 days 6 hrs ago0x6de3cc59152e19f108378984f45e20a34c9f63380x3dbdc81a6edc94c720b0b88fb65dbd7e395fdcf60.005099 Ether
0x696b552e51bc5eabe9fb68ae11f83d16a04401ba388fdaeda776649eaf1b814b5317325142 days 18 hrs ago0x6de3cc59152e19f108378984f45e20a34c9f63380x4539809f766a0ee7c8614c7a55331871a1fffaee0.195 Ether
0xe657ac3d54e9803be2f85dce09ef787c5edf512c67b9eebb6654b26bc10bd6a35316321142 days 22 hrs ago0x6de3cc59152e19f108378984f45e20a34c9f63380x3dbdc81a6edc94c720b0b88fb65dbd7e395fdcf60.005099 Ether
0xcd6501e3530346aac7c73ec0151106709d687205c31754064ed79c9da3cc37dc5061129186 days 2 hrs ago0x6de3cc59152e19f108378984f45e20a34c9f63380x004ce63f3edcd6087665f7bf2ff9f64ff90ae47c0.295 Ether
0x903671273d241fae53a6c4defc020bb108b1d33962dc8833d6b28560034f10e35061127186 days 2 hrs ago0x6de3cc59152e19f108378984f45e20a34c9f63380x3dbdc81a6edc94c720b0b88fb65dbd7e395fdcf60.005046 Ether
0x6ae5377e0b8d8c5e478d4d16d3b031ddad35eb723e61c9d485bbfddfd62bb5685061115186 days 2 hrs ago0x6de3cc59152e19f108378984f45e20a34c9f63380x004ce63f3edcd6087665f7bf2ff9f64ff90ae47c1 wei
0xf4b16930c75a6344af84a09b4ef5557e0585f5c11274e7d4c64b39d2c16487195061104186 days 2 hrs ago0x6de3cc59152e19f108378984f45e20a34c9f63380x3dbdc81a6edc94c720b0b88fb65dbd7e395fdcf60.005046 Ether
[ Download CSV Export  ] 
Contract Source Code Verified (Exact match)
Contract Name: EtherSpin
Compiler Version: v0.4.19+commit.c4cbbb05
Optimization Enabled: Yes
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts

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

pragma solidity ^0.4.0;//please import oraclizeAPI_pre0.4.sol when solidity < 0.4.0

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);
    function randomDS_getSessionPubKeyHash() returns(bytes32);
}
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 proofType_Android = 0x20;
    byte constant proofType_Ledger = 0x30;
    byte constant proofType_Native = 0xF0;
    byte constant proofStorage_IPFS = 0x01;
    uint8 constant networkID_auto = 0;
    uint8 constant networkID_mainnet = 1;
    uint8 constant networkID_testnet = 2;
    uint8 constant networkID_morden = 2;
    uint8 constant networkID_consensys = 161;

    OraclizeAddrResolverI OAR;

    OraclizeI oraclize;
    modifier oraclizeAPI {
        if((address(OAR)==0)||(getCodeSize(address(OAR))==0))
            oraclize_setNetwork(networkID_auto);

        if(address(oraclize) != OAR.getAddress())
            oraclize = OraclizeI(OAR.getAddress());

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

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

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

    function oraclize_useCoupon(string code) oraclizeAPI internal {
        oraclize.useCoupon(code);
    }

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

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

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

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

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

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

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

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

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

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

    function parseAddr(string _a) internal 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;
        }

    function ba2cbor(bytes[] 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;
        }


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

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

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

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

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

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

        bytes32 sigr;
        bytes32 sigs;

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

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


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

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

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

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

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

        if (sigok == false) return false;


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

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

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

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

        return sigok;
    }

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

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

        _;
    }

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

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

        return 0;
    }

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

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

        return match_;
    }

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

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

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

        // Step 3: we assume sig1 is valid (it will be verified during step 5) and we verify if 'result' is the prefix of sha256(sig1)
        if (!matchBytes32Prefix(sha256(sig1), result, uint(proof[ledgerProofLength+32+8]))) return false;

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

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

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


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

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

        return oraclize_randomDS_sessionKeysHashVerified[sessionPubkeyHash];
    }


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

        if (to.length < minLength) {
            // Buffer too small
            throw; // Should be a better way?
        }

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

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

        return to;
    }

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

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

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

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

        return (ret, addr);
    }

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

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

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

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

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

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

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

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

}
// </ORACLIZE_API>


/**
 * @title SafeMath
 * @dev Math operations with safety checks that throw on error
 */
contract SafeMath {

  /**
  * @dev Multiplies two numbers, throws on overflow.
  */
  function mul(uint256 a, uint256 b) internal pure returns (uint256) {
    if (a == 0) {
      return 0;
    }
    uint256 c = a * b;
    assert(c / a == b);
    return c;
  }

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

  /**
  * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
  */
  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    assert(b <= a);
    return a - b;
  }

  /**
  * @dev Adds two numbers, throws on overflow.
  */
  function add(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a + b;
    assert(c >= a);
    return c;
  }
}

contract EtherSpin is usingOraclize, SafeMath {
    address public owner;

    uint public betCount;
    uint public minBet;
    uint public maxBet;
    uint public edgeRange;
    uint public payoutMultiplier;
    uint public gasLimit;
    uint public standardFee;
    uint public minimumNumber;
    uint public totalPlayerWinnings;
    uint public totalHouseWinnings;

    mapping (bytes32 => address) playerAddy;
    mapping (bytes32 => uint) playerBetSize;
    mapping (bytes32 => bool) playerHiLo;


    event LogBet(address indexed playerAddy, bool indexed HiLo, uint ActualRNGNumber, uint betSizing, bool WinLossResult);
    event LogErr(uint errcode);

    // --- Mods --- //
    modifier onlyOwner {
         if (msg.sender != owner) throw;
         _;
    }

    modifier onlyOraclize {
        if (msg.sender != oraclize_cbAddress()) throw;
        _;
    }

    function EtherSpin() {
        owner = msg.sender;
        oraclize_setProof(proofType_Ledger);
        ownerSetLimits(100000000000000000, 2000000000000000000);
        ownerSetEdgeRangeAndPayout(2, 2, 2);
        ownerSetGasLimit(250000);
        ownerSetStandardFee(5000000000000000);
    }

    function roll() public payable {
        if (msg.value > maxBet || msg.value < minBet) throw;
        bytes32 queryId = oraclize_newRandomDSQuery(0, 2, gasLimit);
        playerAddy[queryId] = msg.sender;
        playerBetSize[queryId] = msg.value;
        playerHiLo[queryId] = false; // Default the game to roll low
    }

    function () public payable {
        // Default betting function
        roll();
    }

    function rollLo() public payable {
        if (msg.value > maxBet || msg.value < minBet) throw;
        bytes32 queryId = oraclize_newRandomDSQuery(0, 2, gasLimit);
        playerAddy[queryId] = msg.sender;
        playerBetSize[queryId] = msg.value;
        playerHiLo[queryId] = false;
    }

    function __callback(bytes32 _queryId, string _result, bytes _proof) onlyOraclize {
        betCount = add(betCount, 1);
        uint betAmount = playerBetSize[_queryId];
        if (oraclize_randomDS_proofVerify__returnCode(_queryId, _result, _proof) != 0 || _proof.length == 0) {

        }
        else {
            uint playerNum = uint(sha3(_result)) % 2**(2*8) * 100 / ( 2**(2*8) );
            if (playerHiLo[_queryId] == false ) {
                if (playerNum + minimumNumber < ( 100 / 2 ) - edgeRange) {
                    // Player Wins
                    LogBet(playerAddy[_queryId], playerHiLo[_queryId], playerNum + minimumNumber, betAmount, true);
                    playerAddy[_queryId].transfer((betAmount) * payoutMultiplier - standardFee);
                    totalPlayerWinnings = add(totalHouseWinnings,(betAmount) * payoutMultiplier);
                }
                else {
                    // Player Loses
                    LogBet(playerAddy[_queryId], playerHiLo[_queryId], playerNum + minimumNumber, betAmount, false);
                    playerAddy[_queryId].transfer(1 wei);
                    totalHouseWinnings = add(totalHouseWinnings,(betAmount) * payoutMultiplier);
                }
            }
        }

        delete playerAddy[_queryId];
        delete playerBetSize[_queryId];
        delete playerHiLo[_queryId];
    }

    function ownerDeposit() public payable {
        // Simply allows owner to deposit funds into the house bankroll
    }

    function ownerSetGasLimit(uint gasValue) public onlyOwner {
        gasLimit = gasValue;
    }

    function ownerSetLimits(uint min, uint max) public onlyOwner {
        // Set the minimum and maximum bet size
        minBet = min * 1 wei;
        maxBet = max * 1 wei;
    }

    function ownerSetEdgeRangeAndPayout(uint value, uint value2, uint value3) public onlyOwner {
        edgeRange = value;
        payoutMultiplier = value2;
        minimumNumber = value3;
    }

    function ownerSetStandardFee(uint fee) public onlyOwner {
        standardFee = fee;
    }

    function ownerTransferEther(address addy, uint value) public onlyOwner {
      if(!addy.send(value)) throw;
    }

    function ownerKillContract() public onlyOwner {
        suicide(owner);
    }
}

    Contract ABI  
[{"constant":false,"inputs":[{"name":"myid","type":"bytes32"},{"name":"result","type":"string"}],"name":"__callback","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalPlayerWinnings","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"rollLo","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"maxBet","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_queryId","type":"bytes32"},{"name":"_result","type":"string"},{"name":"_proof","type":"bytes"}],"name":"__callback","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"ownerKillContract","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"payoutMultiplier","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"addy","type":"address"},{"name":"value","type":"uint256"}],"name":"ownerTransferEther","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"ownerDeposit","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"minBet","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"fee","type":"uint256"}],"name":"ownerSetStandardFee","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"min","type":"uint256"},{"name":"max","type":"uint256"}],"name":"ownerSetLimits","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalHouseWinnings","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"minimumNumber","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"value","type":"uint256"},{"name":"value2","type":"uint256"},{"name":"value3","type":"uint256"}],"name":"ownerSetEdgeRangeAndPayout","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"roll","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"betCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"edgeRange","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"gasLimit","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"standardFee","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"gasValue","type":"uint256"}],"name":"ownerSetGasLimit","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"playerAddy","type":"address"},{"indexed":true,"name":"HiLo","type":"bool"},{"indexed":false,"name":"ActualRNGNumber","type":"uint256"},{"indexed":false,"name":"betSizing","type":"uint256"},{"indexed":false,"name":"WinLossResult","type":"bool"}],"name":"LogBet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"errcode","type":"uint256"}],"name":"LogErr","type":"event"}]

  Contract Creation Code Switch To Opcodes View
606060405234156200001057600080fd5b60058054600160a060020a03191633600160a060020a0316179055620000647f3000000000000000000000000000000000000000000000000000000000000000640100000000620000ec810262002a741704565b6200008e67016345785d8a0000671bc16d674ec800006401000000006200080a6200031882021704565b620000aa600280806401000000006200083c6200033f82021704565b620000c66203d0906401000000006200087d6200036982021704565b620000e66611c37937e08000640100000000620007ea6200038a82021704565b6200084f565b600054600160a060020a031615806200012757506000546200012590600160a060020a0316640100000000620011fa620003ab82021704565b155b156200014957620001476000640100000000620011fe620003af82021704565b505b60008054600160a060020a0316906338cc483190604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515620001ac57600080fd5b6102c65a03f11515620001be57600080fd5b5050506040518051600154600160a060020a0390811691161490506200027d5760008054600160a060020a0316906338cc483190604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156200024157600080fd5b6102c65a03f115156200025357600080fd5b505050604051805160018054600160a060020a031916600160a060020a0392909216919091179055505b600154600160a060020a031663688dcfd7826040517c010000000000000000000000000000000000000000000000000000000063ffffffff84160281527fff000000000000000000000000000000000000000000000000000000000000009091166004820152602401600060405180830381600087803b15156200030057600080fd5b6102c65a03f115156200031257600080fd5b50505050565b60055433600160a060020a039081169116146200033457600080fd5b600791909155600855565b60055433600160a060020a039081169116146200035b57600080fd5b600992909255600a55600d55565b60055433600160a060020a039081169116146200038557600080fd5b600b55565b60055433600160a060020a03908116911614620003a657600080fd5b600c55565b3b90565b600080620003df731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed640100000000620011fa620003ab82021704565b1115620004615760008054600160a060020a031916731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed1790556200045860408051908101604052600b81527f6574685f6d61696e6e6574000000000000000000000000000000000000000000602082015264010000000062001ef76200079182021704565b5060016200078c565b60006200049073c03a2615d5efaf5f49f60b7bb6583eaec212fdf1640100000000620011fa620003ab82021704565b1115620005095760008054600160a060020a03191673c03a2615d5efaf5f49f60b7bb6583eaec212fdf11790556200045860408051908101604052600c81527f6574685f726f707374656e330000000000000000000000000000000000000000602082015264010000000062001ef76200079182021704565b60006200053873b7a07bcf2ba2f2703b24c0691b5278999c59ac7e640100000000620011fa620003ab82021704565b1115620005b15760008054600160a060020a03191673b7a07bcf2ba2f2703b24c0691b5278999c59ac7e1790556200045860408051908101604052600981527f6574685f6b6f76616e0000000000000000000000000000000000000000000000602082015264010000000062001ef76200079182021704565b6000620005e073146500cfd35b22e4a392fe0adc06de1a1368ed48640100000000620011fa620003ab82021704565b1115620006595760008054600160a060020a03191673146500cfd35b22e4a392fe0adc06de1a1368ed481790556200045860408051908101604052600b81527f6574685f72696e6b656279000000000000000000000000000000000000000000602082015264010000000062001ef76200079182021704565b600062000688736f485c8bf6fc43ea212e93bbf8ce046c7f1cb475640100000000620011fa620003ab82021704565b1115620006be575060008054600160a060020a031916736f485c8bf6fc43ea212e93bbf8ce046c7f1cb47517905560016200078c565b6000620006ed7320e12a1f859b3feae5fb2a0a32c18f5a65555bbf640100000000620011fa620003ab82021704565b111562000723575060008054600160a060020a0319167320e12a1f859b3feae5fb2a0a32c18f5a65555bbf17905560016200078c565b6000620007527351efaf4c8b3c9afbd5ab9f4bbc82784ab6ef8faa640100000000620011fa620003ab82021704565b111562000788575060008054600160a060020a0319167351efaf4c8b3c9afbd5ab9f4bbc82784ab6ef8faa17905560016200078c565b5060005b919050565b6002818051620007a6929160200190620007aa565b5050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620007ed57805160ff19168380011785556200081d565b828001600101855582156200081d579182015b828111156200081d57825182559160200191906001019062000800565b506200082b9291506200082f565b5090565b6200084c91905b808211156200082b576000815560010162000836565b90565b612c58806200085f6000396000f30060606040526004361061010e5763ffffffff60e060020a60003504166327dc297e81146101185780632cca664b1461016e5780632d462dbb1461010e5780632e5b21681461019357806338bbfa50146101a6578063497148151461023e5780635c812737146102515780637ac37d58146102645780637b1aa45f146102865780638da5cb5b1461028e5780639619367d146102bd57806396834e36146102d057806398a1e1ba146102e6578063b5a02db1146102ff578063c91cd9d014610312578063c9660d0714610325578063cd5e3c5d1461010e578063cf09449714610341578063ed81a68e14610354578063f68016b714610367578063f8140a7e1461037a578063f9befdef1461038d575b6101166103a3565b005b341561012357600080fd5b610116600480359060446024803590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061041595505050505050565b341561017957600080fd5b610181610447565b60405190815260200160405180910390f35b341561019e57600080fd5b61018161044d565b34156101b157600080fd5b610116600480359060446024803590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284375094965061045395505050505050565b341561024957600080fd5b610116610758565b341561025c57600080fd5b610181610781565b341561026f57600080fd5b610116600160a060020a0360043516602435610787565b6101166107d3565b341561029957600080fd5b6102a16107d5565b604051600160a060020a03909116815260200160405180910390f35b34156102c857600080fd5b6101816107e4565b34156102db57600080fd5b6101166004356107ea565b34156102f157600080fd5b61011660043560243561080a565b341561030a57600080fd5b610181610830565b341561031d57600080fd5b610181610836565b341561033057600080fd5b61011660043560243560443561083c565b341561034c57600080fd5b610181610865565b341561035f57600080fd5b61018161086b565b341561037257600080fd5b610181610871565b341561038557600080fd5b610181610877565b341561039857600080fd5b61011660043561087d565b60006008543411806103b6575060075434105b156103c057600080fd5b6103cf60006002600b5461089d565b60009081526010602090815260408083208054600160a060020a03191633600160a060020a03161790556011825280832034905560129091529020805460ff1916905550565b610443828260006040518059106104295750595b818152601f19601f83011681016020016040529050610453565b5050565b600e5481565b60085481565b60008061045e610b91565b600160a060020a031633600160a060020a031614151561047d57600080fd5b61048a6006546001610d32565b60065560008581526011602052604090205491506104a9858585610d48565b60ff161515806104b857508251155b156104c25761071a565b6201000080856040518082805190602001908083835b602083106104f75780518252601f1990920191602091820191016104d8565b6001836020036101000a038019825116818451161790925250505091909101925060409150505190819003902081151561052d57fe5b0660640281151561053a57fe5b600087815260126020526040902054919004915060ff16151561071a57600954603203600d548201101561064d5760008581526012602090815260408083205460109092529182902054600d5460ff909216151592600160a060020a03909116917f7865f6116ad9c4556523ded997c85b71d9debf96b7ef58b865f988a7fe4860cd9190850190869060019051928352602083019190915215156040808301919091526060909101905180910390a36000858152601060205260409081902054600c54600a54600160a060020a03909216929185020380156108fc029151600060405180830381858888f19350505050151561063557600080fd5b610645600f54600a548402610d32565b600e5561071a565b600085815260126020908152604080832054601090925280832054600d5460ff909316151593600160a060020a03909116927f7865f6116ad9c4556523ded997c85b71d9debf96b7ef58b865f988a7fe4860cd9290860191879151928352602083019190915215156040808301919091526060909101905180910390a360008581526010602052604080822054600160a060020a0316919060019051600060405180830381858888f19350505050151561070657600080fd5b610716600f54600a548402610d32565b600f555b5050506000918252506010602090815260408083208054600160a060020a03191690556011825280832083905560129091529020805460ff19169055565b60055433600160a060020a0390811691161461077357600080fd5b600554600160a060020a0316ff5b600a5481565b60055433600160a060020a039081169116146107a257600080fd5b600160a060020a03821681156108fc0282604051600060405180830381858888f19350505050151561044357600080fd5b565b600554600160a060020a031681565b60075481565b60055433600160a060020a0390811691161461080557600080fd5b600c55565b60055433600160a060020a0390811691161461082557600080fd5b600791909155600855565b600f5481565b600d5481565b60055433600160a060020a0390811691161461085757600080fd5b600992909255600a55600d55565b60065481565b60095481565b600b5481565b600c5481565b60055433600160a060020a0390811691161461089857600080fd5b600b55565b60006108a761299d565b6108af61299d565b6108b761299d565b60006108c16129af565b60008815806108d05750602089115b156108da57600080fd5b60016040518059106108e95750595b818152601f19601f8301168101602001604052905095508860f860020a028660008151811061091457fe5b906020010190600160f860020a031916908160001a905350602060405180591061093b5750595b818152601f19601f83011681016020016040529050945060206040518059106109615750595b818152601f19601f830116810160200160405290509350610980610e72565b9250602085524241186001430340186020860152602084528260208501526060604051908101604052808681526020018781526020018581525091506109fb8a60408051908101604052600681527f72616e646f6d00000000000000000000000000000000000000000000000000006020820152848b610ff3565b9050610b848178010000000000000000000000000000000000000000000000008c026020850151600286516000604051602001526040518082805190602001908083835b60208310610a5e5780518252601f199092019160209182019101610a3f565b6001836020036101000a03801982511681845116808217855250505050505090500191505060206040518083038160008661646e5a03f11515610aa057600080fd5b505060405180519050604087015160405177ffffffffffffffffffffffffffffffffffffffffffffffff19851681526008810184805190602001908083835b60208310610afe5780518252601f199092019160209182019101610adf565b6001836020036101000a038019825116818451161790925250505091909101848152602001905082805190602001908083835b60208310610b505780518252601f199092019160209182019101610b31565b6001836020036101000a038019825116818451161790925250505091909101955060409450505050505180910390206111e8565b9998505050505050505050565b60008054600160a060020a03161580610bbc5750600054610bba90600160a060020a03166111fa565b155b15610bcd57610bcb60006111fe565b505b60008054600160a060020a0316906338cc483190604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610c1657600080fd5b6102c65a03f11515610c2757600080fd5b5050506040518051600154600160a060020a039081169116149050610cca5760008054600160a060020a0316906338cc483190604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610c8f57600080fd5b6102c65a03f11515610ca057600080fd5b505050604051805160018054600160a060020a031916600160a060020a0392909216919091179055505b600154600160a060020a031663c281d19e6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610d1257600080fd5b6102c65a03f11515610d2357600080fd5b50505060405180519150505b90565b600082820183811015610d4157fe5b9392505050565b60008082600081518110610d5857fe5b016020015160f860020a900460f860020a02600160f860020a0319167f4c00000000000000000000000000000000000000000000000000000000000000141580610dea575082600181518110610daa57fe5b016020015160f860020a900460f860020a02600160f860020a0319167f500000000000000000000000000000000000000000000000000000000000000014155b80610e32575082600281518110610dfd57fe5b01602001517fff0000000000000000000000000000000000000000000000000000000000000060f860020a9182900482021614155b15610e405760019150610e6a565b610e53838686610e4e611525565b6115cd565b9050801515610e655760029150610e6a565b600091505b509392505050565b60008054600160a060020a03161580610e9d5750600054610e9b90600160a060020a03166111fa565b155b15610eae57610eac60006111fe565b505b60008054600160a060020a0316906338cc483190604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610ef757600080fd5b6102c65a03f11515610f0857600080fd5b5050506040518051600154600160a060020a039081169116149050610fab5760008054600160a060020a0316906338cc483190604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610f7057600080fd5b6102c65a03f11515610f8157600080fd5b505050604051805160018054600160a060020a031916600160a060020a0392909216919091179055505b600154600160a060020a031663abaa5f3e6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610d1257600080fd5b6000610ffd61299d565b600054600160a060020a03161580611027575060005461102590600160a060020a03166111fa565b155b156110385761103660006111fe565b505b60008054600160a060020a0316906338cc483190604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561108157600080fd5b6102c65a03f1151561109257600080fd5b5050506040518051600154600160a060020a0390811691161490506111355760008054600160a060020a0316906338cc483190604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156110fa57600080fd5b6102c65a03f1151561110b57600080fd5b505050604051805160018054600160a060020a031916600160a060020a0392909216919091179055505b60036040518059106111445750595b90808252806020026020018201604052801561117a57816020015b61116761299d565b81526020019060019003908161115f5790505b50905083518160008151811061118c57fe5b602090810290910101528360016020020151816001815181106111ab57fe5b60209081029190910101526040840151816002815181106111c857fe5b602090810290910101526111de86868386611b5b565b9695505050505050565b60009182526003602052604090912055565b3b90565b60008061121e731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed6111fa565b111561128e5760008054600160a060020a031916731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed17905561128660408051908101604052600b81527f6574685f6d61696e6e65740000000000000000000000000000000000000000006020820152611ef7565b506001611520565b60006112ad73c03a2615d5efaf5f49f60b7bb6583eaec212fdf16111fa565b11156113155760008054600160a060020a03191673c03a2615d5efaf5f49f60b7bb6583eaec212fdf117905561128660408051908101604052600c81527f6574685f726f707374656e3300000000000000000000000000000000000000006020820152611ef7565b600061133473b7a07bcf2ba2f2703b24c0691b5278999c59ac7e6111fa565b111561139c5760008054600160a060020a03191673b7a07bcf2ba2f2703b24c0691b5278999c59ac7e17905561128660408051908101604052600981527f6574685f6b6f76616e00000000000000000000000000000000000000000000006020820152611ef7565b60006113bb73146500cfd35b22e4a392fe0adc06de1a1368ed486111fa565b11156114235760008054600160a060020a03191673146500cfd35b22e4a392fe0adc06de1a1368ed4817905561128660408051908101604052600b81527f6574685f72696e6b6562790000000000000000000000000000000000000000006020820152611ef7565b6000611442736f485c8bf6fc43ea212e93bbf8ce046c7f1cb4756111fa565b1115611476575060008054600160a060020a031916736f485c8bf6fc43ea212e93bbf8ce046c7f1cb4751790556001611520565b60006114957320e12a1f859b3feae5fb2a0a32c18f5a65555bbf6111fa565b11156114c9575060008054600160a060020a0319167320e12a1f859b3feae5fb2a0a32c18f5a65555bbf1790556001611520565b60006114e87351efaf4c8b3c9afbd5ab9f4bbc82784ab6ef8faa6111fa565b111561151c575060008054600160a060020a0319167351efaf4c8b3c9afbd5ab9f4bbc82784ab6ef8faa1790556001611520565b5060005b919050565b61152d61299d565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156115c35780601f10611598576101008083540402835291602001916115c3565b820191906000526020600020905b8154815290600101906020018083116115a657829003601f168201915b5050505050905090565b6000806115d861299d565b6115e061299d565b6115e861299d565b6115f061299d565b6000806115fb61299d565b8c60458151811061160857fe5b016020015160f860020a908190048102046066019750602060405180591061162d5750595b818152601f19601f8301168101602001604052905096506116538d8960208a6000611f0a565b5060028a8d6000604051602001526040518083805190602001908083835b602083106116905780518252601f199092019160209182019101611671565b6001836020036101000a0380198251168184511617909252505050919091019283525050602090810191506040518083038160008661646e5a03f115156116d657600080fd5b505060405180519050604051908152602001604051908190039020876040518082805190602001908083835b602083106117215780518252601f199092019160209182019101611702565b6001836020036101000a03801982511681845116179092525050509190910192506040915050519081900390201461175c5760009850611b4b565b8c604a89018151811061176b57fe5b016020015160f860020a900460f860020a0260f860020a90046002016040518059106117945750595b818152601f19601f8301168101602001604052905095506117bd8d896049018851896000611f0a565b506118756002876000604051602001526040518082805190602001908083835b602083106117fc5780518252601f1990920191602091820191016117dd565b6001836020036101000a03801982511681845116808217855250505050505090500191505060206040518083038160008661646e5a03f1151561183e57600080fd5b5050604051805190508c8f60288c018151811061185757fe5b016020015160f860020a900460f860020a0260f860020a9004611f5f565b15156118845760009850611b4b565b60296040518059106118935750595b818152601f19601f8301168101602001604052905094506118bc8d896020016029886000611f0a565b50604080518059106118cb5750595b818152601f19601f8301168101602001604052905093508551886020016029010160410192506119038d604085036040876000611f0a565b506002846000604051602001526040518082805190602001908083835b6020831061193f5780518252601f199092019160209182019101611920565b6001836020036101000a03801982511681845116808217855250505050505090500191505060206040518083038160008661646e5a03f1151561198157600080fd5b505060405180519050915084826040518083805190602001908083835b602083106119bd5780518252601f19909201916020918201910161199e565b6001836020036101000a0380198251168184511617909252505050919091019283525050602001905060405190819003902060008d8152600360205260409020541415611a185760008c815260036020526040812055611a21565b60009850611b4b565b6049604051805910611a305750595b818152601f19601f830116810160200160405290509050611a568d896049846000611f0a565b50611ae76002826000604051602001526040518082805190602001908083835b60208310611a955780518252601f199092019160209182019101611a76565b6001836020036101000a03801982511681845116808217855250505050505090500191505060206040518083038160008661646e5a03f11515611ad757600080fd5b5050604051805190508786611fd1565b1515611af65760009850611b4b565b60008281526004602052604090205460ff161515611b3657611b188d846121ea565b6000838152600460205260409020805460ff19169115159190911790555b60008281526004602052604090205460ff1698505b5050505050505050949350505050565b600080611b6661299d565b600054600160a060020a03161580611b905750600054611b8e90600160a060020a03166111fa565b155b15611ba157611b9f60006111fe565b505b60008054600160a060020a0316906338cc483190604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515611bea57600080fd5b6102c65a03f11515611bfb57600080fd5b5050506040518051600154600160a060020a039081169116149050611c9e5760008054600160a060020a0316906338cc483190604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515611c6357600080fd5b6102c65a03f11515611c7457600080fd5b505050604051805160018054600160a060020a031916600160a060020a0392909216919091179055505b600154600160a060020a0316632ef3accc87866000604051602001526040518363ffffffff1660e060020a0281526004018080602001838152602001828103825284818151815260200191508051906020019080838360005b83811015611d0f578082015183820152602001611cf7565b50505050905090810190601f168015611d3c5780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b1515611d5b57600080fd5b6102c65a03f11515611d6c57600080fd5b5050506040518051925050670de0b6b3a76400003a850201821115611d945760009250611eed565b611d9d856125e6565b600154909150600160a060020a031663c55c1cb683898985896000604051602001526040518663ffffffff1660e060020a028152600401808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015611e1e578082015183820152602001611e06565b50505050905090810190601f168015611e4b5780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b83811015611e81578082015183820152602001611e69565b50505050905090810190601f168015611eae5780820380516001836020036101000a031916815260200191505b5096505050505050506020604051808303818588803b1515611ecf57600080fd5b6125ee5a03f11515611ee057600080fd5b5050505060405180519350505b5050949350505050565b60028180516104439291602001906129dc565b611f1261299d565b8382016000808286511015611f2657600080fd5b505060208087019084015b868860200101821015611f5257818901518682015260209182019101611f31565b5093979650505050505050565b60006001815b83811015611fc857848181518110611f7957fe5b016020015160f860020a900460f860020a02600160f860020a0319168682602081101515611fa357fe5b1a60f860020a02600160f860020a031916141515611fc057600091505b600101611f65565b50949350505050565b6000806000806000611fe161299d565b6000611feb61299d565b6020604051805910611ffa5750595b8181526020601f909201601f19168101820160405293508a60038151811061201e57fe5b016020015160f860020a900460f860020a0260f860020a900403600401915061204c8a836020866000611f0a565b9250602060405180591061205d5750595b818152601f19601f8301168101602001604052905090506022820191506120b58a60208c600186038151811061208f57fe5b016020015160f860020a900460f860020a0260f860020a90040384016020846000611f0a565b905060208301519450602081015193506120d28b601b878761295d565b9097509550600160a060020a038616896040518082805190602001908083835b602083106121115780518252601f1990920191602091820191016120f2565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051908190039020600160a060020a0316141561215657600197506121dc565b6121638b601c878761295d565b9097509550600160a060020a038616896040518082805190602001908083835b602083106121a25780518252601f199092019160209182019101612183565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051908190039020600160a060020a03161497505b505050505050509392505050565b6000806121f561299d565b6121fd61299d565b61220561299d565b61220d61299d565b61221561299d565b61221d61299d565b61222561299d565b8a8a6001018151811061223457fe5b016020015160f860020a900460f860020a0260f860020a900460020160405180591061225d5750595b818152601f19601f8301168101602001604052905096506122838b8b89518a6000611f0a565b50604080518059106122925750595b818152601f19601f8301168101602001604052905095506122b98b60046040896000611f0a565b5060626040518059106122c95750595b818152601f19601f83011681016020016040529050945060f860020a856000815181106122f257fe5b906020010190600160f860020a031916908160001a90535061231c8b60418c036041886001611f0a565b506040805190810160405280602081526020017ffd94fa71bc0ba10d39d464d0d8f465efeef0a2764e3887fcc9df41ded20f505c81525093506123658460006020886042611f0a565b506123f66002866000604051602001526040518082805190602001908083835b602083106123a45780518252601f199092019160209182019101612385565b6001836020036101000a03801982511681845116808217855250505050505090500191505060206040518083038160008661646e5a03f115156123e657600080fd5b5050604051805190508888611fd1565b975087151561240857600098506125d8565b606060405190810160405280604081526020017f7fb956469c5c9b89840d55b43537e66a98dd4811ea0a27224272c2e5622911e881526020017f537a2f8e86a46baec82864e98dd01e9ccc2f8bc5dfc9cbe5a91a290498dd96e4815250925060426040518059106124765750595b818152601f19601f8301168101602001604052905091507ffe00000000000000000000000000000000000000000000000000000000000000826000815181106124bb57fe5b906020010190600160f860020a031916908160001a9053506124e38b60036041856001611f0a565b508a6045815181106124f157fe5b016020015160f860020a900460f860020a0260f860020a900460020160405180591061251a5750595b818152601f19601f8301168101602001604052905090506125418b60448351846000611f0a565b506125d26002836000604051602001526040518082805190602001908083835b602083106125805780518252601f199092019160209182019101612561565b6001836020036101000a03801982511681845116808217855250505050505090500191505060206040518083038160008661646e5a03f115156125c257600080fd5b5050604051805190508285611fd1565b97508798505b505050505050505092915050565b6125ee61299d565b6000806125f961299d565b600080600061260661299d565b60008060008b51995060009850896040518059106126215750595b90808252806020026020018201604052801561265757816020015b61264461299d565b81526020019060019003908161263c5790505b509750600096505b898710156126e4578b878151811061267357fe5b9060200190602002015188888151811061268957fe5b60209081029091010152601760018989815181106126a357fe5b9060200190602002015151038115156126b857fe5b048888815181106126c557fe5b906020019060200201515101989098016003019760019096019561265f565b600198909801976000955060808a019450886040518059106127035750595b818152601f19601f8301168101602001604052905093505b60018690111561276d5760f860020a8502866001811061273757fe5b1a60f860020a0284878151811061274a57fe5b906020010190600160f860020a031916908160001a90535060019095019461271b565b600096505b8987101561294d577f5f000000000000000000000000000000000000000000000000000000000000008487815181106127a757fe5b906020010190600160f860020a031916908160001a905350600190950194600092505b8787815181106127d657fe5b90602001906020020151518310156128f9576017830615156128925760188389898151811061280157fe5b9060200190602002015151031015612831578288888151811061282057fe5b906020019060200201515103612834565b60175b60400191508590505b808603600111156128925760f860020a82028187036001811061285c57fe5b1a60f860020a0284878151811061286f57fe5b906020010190600160f860020a031916908160001a90535060019095019461283d565b87878151811061289e57fe5b9060200190602002015183815181106128b357fe5b016020015160f860020a900460f860020a028487815181106128d157fe5b906020010190600160f860020a031916908160001a90535060019586019592909201916127ca565b7fff0000000000000000000000000000000000000000000000000000000000000084878151811061292657fe5b906020010190600160f860020a031916908160001a90535060019687019690950194612772565b50919a9950505050505050505050565b60008060008060405188815287602082015286604082015285606082015260208160808360006001610bb8f1925080519299929850919650505050505050565b60206040519081016040526000815290565b60606040519081016040526003815b6129c661299d565b8152602001906001900390816129be5790505090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10612a1d57805160ff1916838001178555612a4a565b82800160010185558215612a4a579182015b82811115612a4a578251825591602001919060010190612a2f565b50612a56929150612a5a565b5090565b610d2f91905b80821115612a565760008155600101612a60565b600054600160a060020a03161580612a9e5750600054612a9c90600160a060020a03166111fa565b155b15612aaf57612aad60006111fe565b505b60008054600160a060020a0316906338cc483190604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515612af857600080fd5b6102c65a03f11515612b0957600080fd5b5050506040518051600154600160a060020a039081169116149050612bac5760008054600160a060020a0316906338cc483190604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515612b7157600080fd5b6102c65a03f11515612b8257600080fd5b505050604051805160018054600160a060020a031916600160a060020a0392909216919091179055505b600154600160a060020a031663688dcfd78260405160e060020a63ffffffff84160281527fff000000000000000000000000000000000000000000000000000000000000009091166004820152602401600060405180830381600087803b1515612c1557600080fd5b6102c65a03f11515612c2657600080fd5b505050505600a165627a7a72305820b1e6cb16d161043cf12aa25ffa3f126201abcaf86c4bc37793b26a7db468a04e0029

   Swarm Source:
bzzr://b1e6cb16d161043cf12aa25ffa3f126201abcaf86c4bc37793b26a7db468a04e

 

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