ETH Price: $2,775.87 (+3.62%)

Contract

0xb3556fc2aaBea46b73FD635Aa5c4e5b8Fda950dD
 

Overview

ETH Balance

0.000071960229864104 ETH

Eth Value

$0.20 (@ $2,775.87/ETH)

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Withdraw Reward65595352018-10-22 0:54:282315 days ago1540169668IN
0xb3556fc2...8Fda950dD
0 ETH0.000376998
Bet65586872018-10-21 21:32:222315 days ago1540157542IN
0xb3556fc2...8Fda950dD
0.001 ETH0.000146376
Bet65584632018-10-21 20:40:122315 days ago1540154412IN
0xb3556fc2...8Fda950dD
0.002 ETH0.000048792
Bet65584492018-10-21 20:36:372315 days ago1540154197IN
0xb3556fc2...8Fda950dD
0.01 ETH0.000048792
Bet65584492018-10-21 20:36:372315 days ago1540154197IN
0xb3556fc2...8Fda950dD
0.003 ETH0.000048792
Withdraw Reward65583732018-10-21 20:21:462315 days ago1540153306IN
0xb3556fc2...8Fda950dD
0 ETH0.000221694
Bet65583732018-10-21 20:21:462315 days ago1540153306IN
0xb3556fc2...8Fda950dD
0.011 ETH0.000074913
Bet65583562018-10-21 20:16:442315 days ago1540153004IN
0xb3556fc2...8Fda950dD
0.012 ETH0.000128065
Bet65583542018-10-21 20:16:172315 days ago1540152977IN
0xb3556fc2...8Fda950dD
0.007 ETH0.000048792
Bet65577792018-10-21 18:02:462316 days ago1540144966IN
0xb3556fc2...8Fda950dD
0.002 ETH0.000073183
Withdraw Reward65575672018-10-21 17:13:302316 days ago1540142010IN
0xb3556fc2...8Fda950dD
0 ETH0.000235625
Withdraw Reward65572202018-10-21 15:55:532316 days ago1540137353IN
0xb3556fc2...8Fda950dD
0 ETH0.000235625
Withdraw Reward65571822018-10-21 15:47:302316 days ago1540136850IN
0xb3556fc2...8Fda950dD
0 ETH0.000188494
Withdraw Reward65571392018-10-21 15:36:002316 days ago1540136160IN
0xb3556fc2...8Fda950dD
0 ETH0.000188494
Withdraw Reward65571362018-10-21 15:34:582316 days ago1540136098IN
0xb3556fc2...8Fda950dD
0 ETH0.000188494
Withdraw Reward65571252018-10-21 15:32:262316 days ago1540135946IN
0xb3556fc2...8Fda950dD
0 ETH0.0009424820
Withdraw Reward65571192018-10-21 15:30:012316 days ago1540135801IN
0xb3556fc2...8Fda950dD
0 ETH0.000188494
__callback65571082018-10-21 15:28:192316 days ago1540135699IN
0xb3556fc2...8Fda950dD
0 ETH0.0083034421
Oraclize Set Win...65571052018-10-21 15:27:522316 days ago1540135672IN
0xb3556fc2...8Fda950dD
0.0171 ETH0.000975947
Bet65569012018-10-21 14:42:112316 days ago1540132931IN
0xb3556fc2...8Fda950dD
0.01 ETH0.000073183
Bet65566532018-10-21 13:42:042316 days ago1540129324IN
0xb3556fc2...8Fda950dD
0.01 ETH0.000074913
Bet65566532018-10-21 13:42:042316 days ago1540129324IN
0xb3556fc2...8Fda950dD
0.004 ETH0.000073183
Bet65566532018-10-21 13:42:042316 days ago1540129324IN
0xb3556fc2...8Fda950dD
0.004 ETH0.000073183
Bet65566532018-10-21 13:42:042316 days ago1540129324IN
0xb3556fc2...8Fda950dD
0.002 ETH0.000073183
Bet65566422018-10-21 13:38:342316 days ago1540129114IN
0xb3556fc2...8Fda950dD
0.002 ETH0.000073183
View all transactions

Latest 9 internal transactions

Advanced mode:
Parent Transaction Hash Block
From
To
65595352018-10-22 0:54:282315 days ago1540169668
0xb3556fc2...8Fda950dD
0.35689284 ETH
65575672018-10-21 17:13:302316 days ago1540142010
0xb3556fc2...8Fda950dD
0.35689284 ETH
65572202018-10-21 15:55:532316 days ago1540137353
0xb3556fc2...8Fda950dD
0.08922321 ETH
65571822018-10-21 15:47:302316 days ago1540136850
0xb3556fc2...8Fda950dD
0.00892232 ETH
65571392018-10-21 15:36:002316 days ago1540136160
0xb3556fc2...8Fda950dD
0.0446116 ETH
65571362018-10-21 15:34:582316 days ago1540136098
0xb3556fc2...8Fda950dD
0.15167945 ETH
65571252018-10-21 15:32:262316 days ago1540135946
0xb3556fc2...8Fda950dD
0.17844642 ETH
65571192018-10-21 15:30:012316 days ago1540135801
0xb3556fc2...8Fda950dD
0.03568928 ETH
65571052018-10-21 15:27:522316 days ago1540135672
0xb3556fc2...8Fda950dD
0.01702803 ETH
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0xB7cF3ce9...BfF208a6d
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
Bet0xgame

Compiler Version
v0.4.24+commit.e67f0147

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2018-10-02
*/

pragma solidity ^0.4.18;
// <ORACLIZE_API>
/*
Copyright (c) 2015-2016 Oraclize SRL
Copyright (c) 2016 Oraclize LTD



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



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



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

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

contract OraclizeI {
    address public cbAddress;
    function query(uint _timestamp, string _datasource, string _arg) external payable returns (bytes32 _id);
    function query_withGasLimit(uint _timestamp, string _datasource, string _arg, uint _gaslimit) external payable returns (bytes32 _id);
    function query2(uint _timestamp, string _datasource, string _arg1, string _arg2) public payable returns (bytes32 _id);
    function query2_withGasLimit(uint _timestamp, string _datasource, string _arg1, string _arg2, uint _gaslimit) external payable returns (bytes32 _id);
    function queryN(uint _timestamp, string _datasource, bytes _argN) public payable returns (bytes32 _id);
    function queryN_withGasLimit(uint _timestamp, string _datasource, bytes _argN, uint _gaslimit) external payable returns (bytes32 _id);
    function getPrice(string _datasource) public returns (uint _dsprice);
    function getPrice(string _datasource, uint gaslimit) public returns (uint _dsprice);
    function setProofType(byte _proofType) external;
    function setCustomGasPrice(uint _gasPrice) external;
    function randomDS_getSessionPubKeyHash() external constant returns(bytes32);
}

contract OraclizeAddrResolverI {
    function getAddress() public returns (address _addr);
}

/*
Begin solidity-cborutils

https://github.com/smartcontractkit/solidity-cborutils

MIT License

Copyright (c) 2018 SmartContract ChainLink, 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.
 */

library Buffer {
    struct buffer {
        bytes buf;
        uint capacity;
    }

    function init(buffer memory buf, uint capacity) internal pure {
        if(capacity % 32 != 0) capacity += 32 - (capacity % 32);
        // Allocate space for the buffer data
        buf.capacity = capacity;
        assembly {
            let ptr := mload(0x40)
            mstore(buf, ptr)
            mstore(0x40, add(ptr, capacity))
        }
    }

    function resize(buffer memory buf, uint capacity) private pure {
        bytes memory oldbuf = buf.buf;
        init(buf, capacity);
        append(buf, oldbuf);
    }

    function max(uint a, uint b) private pure returns(uint) {
        if(a > b) {
            return a;
        }
        return b;
    }

    /**
     * @dev Appends a byte array to the end of the buffer. Reverts if doing so
     *      would exceed the capacity of the buffer.
     * @param buf The buffer to append to.
     * @param data The data to append.
     * @return The original buffer.
     */
    function append(buffer memory buf, bytes data) internal pure returns(buffer memory) {
        if(data.length + buf.buf.length > buf.capacity) {
            resize(buf, max(buf.capacity, data.length) * 2);
        }

        uint dest;
        uint src;
        uint len = data.length;
        assembly {
            // Memory address of the buffer data
            let bufptr := mload(buf)
            // Length of existing buffer data
            let buflen := mload(bufptr)
            // Start address = buffer address + buffer length + sizeof(buffer length)
            dest := add(add(bufptr, buflen), 32)
            // Update buffer length
            mstore(bufptr, add(buflen, mload(data)))
            src := add(data, 32)
        }

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

        return buf;
    }

    /**
     * @dev Appends a byte to the end of the buffer. Reverts if doing so would
     * exceed the capacity of the buffer.
     * @param buf The buffer to append to.
     * @param data The data to append.
     * @return The original buffer.
     */
    function append(buffer memory buf, uint8 data) internal pure {
        if(buf.buf.length + 1 > buf.capacity) {
            resize(buf, buf.capacity * 2);
        }

        assembly {
            // Memory address of the buffer data
            let bufptr := mload(buf)
            // Length of existing buffer data
            let buflen := mload(bufptr)
            // Address = buffer address + buffer length + sizeof(buffer length)
            let dest := add(add(bufptr, buflen), 32)
            mstore8(dest, data)
            // Update buffer length
            mstore(bufptr, add(buflen, 1))
        }
    }

    /**
     * @dev Appends a byte to the end of the buffer. Reverts if doing so would
     * exceed the capacity of the buffer.
     * @param buf The buffer to append to.
     * @param data The data to append.
     * @return The original buffer.
     */
    function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {
        if(len + buf.buf.length > buf.capacity) {
            resize(buf, max(buf.capacity, len) * 2);
        }

        uint mask = 256 ** len - 1;
        assembly {
            // Memory address of the buffer data
            let bufptr := mload(buf)
            // Length of existing buffer data
            let buflen := mload(bufptr)
            // Address = buffer address + buffer length + sizeof(buffer length) + len
            let dest := add(add(bufptr, buflen), len)
            mstore(dest, or(and(mload(dest), not(mask)), data))
            // Update buffer length
            mstore(bufptr, add(buflen, len))
        }
        return buf;
    }
}

library CBOR {
    using Buffer for Buffer.buffer;

    uint8 private constant MAJOR_TYPE_INT = 0;
    uint8 private constant MAJOR_TYPE_NEGATIVE_INT = 1;
    uint8 private constant MAJOR_TYPE_BYTES = 2;
    uint8 private constant MAJOR_TYPE_STRING = 3;
    uint8 private constant MAJOR_TYPE_ARRAY = 4;
    uint8 private constant MAJOR_TYPE_MAP = 5;
    uint8 private constant MAJOR_TYPE_CONTENT_FREE = 7;

    function encodeType(Buffer.buffer memory buf, uint8 major, uint value) private pure {
        if(value <= 23) {
            buf.append(uint8((major << 5) | value));
        } else if(value <= 0xFF) {
            buf.append(uint8((major << 5) | 24));
            buf.appendInt(value, 1);
        } else if(value <= 0xFFFF) {
            buf.append(uint8((major << 5) | 25));
            buf.appendInt(value, 2);
        } else if(value <= 0xFFFFFFFF) {
            buf.append(uint8((major << 5) | 26));
            buf.appendInt(value, 4);
        } else if(value <= 0xFFFFFFFFFFFFFFFF) {
            buf.append(uint8((major << 5) | 27));
            buf.appendInt(value, 8);
        }
    }

    function encodeIndefiniteLengthType(Buffer.buffer memory buf, uint8 major) private pure {
        buf.append(uint8((major << 5) | 31));
    }

    function encodeUInt(Buffer.buffer memory buf, uint value) internal pure {
        encodeType(buf, MAJOR_TYPE_INT, value);
    }

    function encodeInt(Buffer.buffer memory buf, int value) internal pure {
        if(value >= 0) {
            encodeType(buf, MAJOR_TYPE_INT, uint(value));
        } else {
            encodeType(buf, MAJOR_TYPE_NEGATIVE_INT, uint(-1 - value));
        }
    }

    function encodeBytes(Buffer.buffer memory buf, bytes value) internal pure {
        encodeType(buf, MAJOR_TYPE_BYTES, value.length);
        buf.append(value);
    }

    function encodeString(Buffer.buffer memory buf, string value) internal pure {
        encodeType(buf, MAJOR_TYPE_STRING, bytes(value).length);
        buf.append(bytes(value));
    }

    function startArray(Buffer.buffer memory buf) internal pure {
        encodeIndefiniteLengthType(buf, MAJOR_TYPE_ARRAY);
    }

    function startMap(Buffer.buffer memory buf) internal pure {
        encodeIndefiniteLengthType(buf, MAJOR_TYPE_MAP);
    }

    function endSequence(Buffer.buffer memory buf) internal pure {
        encodeIndefiniteLengthType(buf, MAJOR_TYPE_CONTENT_FREE);
    }
}

/*
End solidity-cborutils
 */

contract usingOraclize {
    uint constant day = 60*60*24;
    uint constant week = 60*60*24*7;
    uint constant month = 60*60*24*30;
    byte constant proofType_NONE = 0x00;
    byte constant proofType_TLSNotary = 0x10;
    byte constant proofType_Android = 0x20;
    byte constant proofType_Ledger = 0x30;
    byte constant proofType_Native = 0xF0;
    byte constant proofStorage_IPFS = 0x01;
    uint8 constant networkID_auto = 0;
    uint8 constant networkID_mainnet = 1;
    uint8 constant networkID_testnet = 2;
    uint8 constant networkID_morden = 2;
    uint8 constant networkID_consensys = 161;

    OraclizeAddrResolverI OAR;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    using CBOR for Buffer.buffer;
    function stra2cbor(string[] arr) internal pure returns (bytes) {
        Buffer.buffer memory buf;
        Buffer.init(buf, 1024);
        buf.startArray();
        for (uint i = 0; i < arr.length; i++) {
            buf.encodeString(arr[i]);
        }
        buf.endSequence();
        return buf.buf;
    }

    function ba2cbor(bytes[] arr) internal pure returns (bytes) {
        Buffer.buffer memory buf;
        Buffer.init(buf, 1024);
        buf.startArray();
        for (uint i = 0; i < arr.length; i++) {
            buf.encodeBytes(arr[i]);
        }
        buf.endSequence();
        return buf.buf;
    }

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

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

    function oraclize_newRandomDSQuery(uint _delay, uint _nbytes, uint _customGasLimit) internal returns (bytes32){
        require((_nbytes > 0) && (_nbytes <= 32));
        // Convert from seconds to ledger timer ticks
        _delay *= 10;
        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)
            // the following variables can be relaxed
            // check relaxed random contract under ethereum-examples repo
            // for an idea on how to override and replace comit hash vars
            mstore(add(unonce, 0x20), xor(blockhash(sub(number, 1)), xor(coinbase, timestamp)))
            mstore(sessionKeyHash, 0x20)
            mstore(add(sessionKeyHash, 0x20), sessionKeyHash_bytes32)
        }
        bytes memory delay = new bytes(32);
        assembly {
            mstore(add(delay, 0x20), _delay)
        }

        bytes memory delay_bytes8 = new bytes(8);
        copyBytes(delay, 24, 8, delay_bytes8, 0);

        bytes[4] memory args = [unonce, nbytes, sessionKeyHash, delay];
        bytes32 queryId = oraclize_query("random", args, _customGasLimit);

        bytes memory delay_bytes8_left = new bytes(8);

        assembly {
            let x := mload(add(delay_bytes8, 0x20))
            mstore8(add(delay_bytes8_left, 0x27), div(x, 0x100000000000000000000000000000000000000000000000000000000000000))
            mstore8(add(delay_bytes8_left, 0x26), div(x, 0x1000000000000000000000000000000000000000000000000000000000000))
            mstore8(add(delay_bytes8_left, 0x25), div(x, 0x10000000000000000000000000000000000000000000000000000000000))
            mstore8(add(delay_bytes8_left, 0x24), div(x, 0x100000000000000000000000000000000000000000000000000000000))
            mstore8(add(delay_bytes8_left, 0x23), div(x, 0x1000000000000000000000000000000000000000000000000000000))
            mstore8(add(delay_bytes8_left, 0x22), div(x, 0x10000000000000000000000000000000000000000000000000000))
            mstore8(add(delay_bytes8_left, 0x21), div(x, 0x100000000000000000000000000000000000000000000000000))
            mstore8(add(delay_bytes8_left, 0x20), div(x, 0x1000000000000000000000000000000000000000000000000))

        }

        oraclize_randomDS_setCommitment(queryId, keccak256(delay_bytes8_left, args[1], sha256(args[0]), args[2]));
        return queryId;
    }

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

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

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

        bytes32 sigr;
        bytes32 sigs;

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

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


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

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

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

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

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

        if (sigok == false) return false;


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

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

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

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

        return sigok;
    }

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

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

        _;
    }

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

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

        return 0;
    }

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

        require(prefix.length == n_random_bytes);

        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 (!(keccak256(keyhash) == keccak256(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, keccak256(delay, nbytes, unonce, sessionKeyHash) == commitment in storage.
        // This is to verify that the computed args match with the ones specified in the query.
        bytes memory commitmentSlice1 = new bytes(8+1+32);
        copyBytes(proof, ledgerProofLength+32, 8+1+32, commitmentSlice1, 0);

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

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


        // Step 5: validity verification for sig1 (keyhash and args signed with the sessionKey)
        bytes memory tosign1 = new bytes(32+8+1+32);
        copyBytes(proof, ledgerProofLength, 32+8+1+32, tosign1, 0);
        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 pure returns (bytes) {
        uint minLength = length + toOffset;

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

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

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

        return to;
    }

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

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

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

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

        return (ret, addr);
    }

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

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

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

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

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

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

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

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

}
// </ORACLIZE_API>

contract Bet0xgame is usingOraclize {
  address public owner;
  string public oraclizeSource;

  mapping(string => mapping(address => uint)) book;
  mapping(string => uint) oddsMapping;
  mapping(bytes32 => bool) validQueryIds;

  mapping(string => uint) teamMapping;
  mapping(bool => uint) boolMapping;

  mapping(address => mapping(string => Player)) playerData;
  struct Player {
    uint betAmount;
    string team;
    bool withdrawn;
  }

  string public WINNER;
  string public loserOne;
  string public loserTwo;

  string public teamOne;
  string public teamTwo;
  string public draw;

  uint public betsCloseAt;
  uint public endsAt;

  event PlayerJoined(
    address indexed playerAddress,
    uint indexed betAmount,
    string indexed team
  );

  event RewardWithdrawn(
    address indexed withdrawer,
    uint indexed withdrawnAmount
  );

  event WinningTeamSet(string indexed team);
  event OraclizeQuery(string indexed description);

  modifier onlyOwner {
    require(msg.sender == address(owner));
    _;
  }

  modifier onlyValidTeam(string _team) {
    require(
      keccak256(bytes(_team)) == keccak256(bytes(teamOne)) ||
        keccak256(bytes(_team)) == keccak256(bytes(teamTwo)) ||
          keccak256(bytes(_team)) == keccak256(bytes(draw))
    );
    _;
  }

  modifier onlyAfterEndTime() {
    require(now >= endsAt);
    _;
  }

  modifier onlyIfWinnerIsMissing() {
    bytes memory winnerBytes = bytes(WINNER);
    require(winnerBytes.length == 0);
    _;
  }

  modifier onlyIfWinnerIsSet() {
    bytes memory winnerBytes = bytes(WINNER);
    require(winnerBytes.length != 0);
    _;
  }

  modifier endsAtAfterBetsCloseAt(uint _betsCloseAt, uint _endsAt) {
    require(_betsCloseAt < _endsAt);
    _;
  }

  modifier onlyBeforeBetsCloseAt() {
    require(now < betsCloseAt);
    _;
  }

  function Bet0xgame(string _teamOne, string _teamTwo, uint _endsAt, uint _betsCloseAt, string _oraclizeSource) public
    endsAtAfterBetsCloseAt(_betsCloseAt, _endsAt)
  {
    oraclize_setProof(proofType_TLSNotary);
    owner = msg.sender;

    teamOne = _teamOne;
    teamTwo = _teamTwo;
    draw = "draw";
    oraclizeSource = _oraclizeSource;

    buildTeamMapping(teamOne, teamTwo, draw);
    buildBoolMapping();

    betsCloseAt = _betsCloseAt;
    endsAt = _endsAt;
  }

  function bet(string _team) public payable
    onlyValidTeam(_team)
    onlyBeforeBetsCloseAt()
  {
    book[_team][msg.sender] += msg.value;
    oddsMapping[_team] += msg.value;

    if (playerData[msg.sender][_team].betAmount == 0) {
      playerData[msg.sender][_team] = Player(msg.value, _team, false);
    } else {
      playerData[msg.sender][_team].betAmount += msg.value;
    }

    PlayerJoined(msg.sender, msg.value, _team);
  }

  function withdrawReward() public onlyAfterEndTime() onlyIfWinnerIsSet() {
    uint betAmount = book[WINNER][msg.sender];
    uint reward = betAmount + (betAmount * (oddsMapping[loserOne] + oddsMapping[loserTwo]) / oddsMapping[WINNER]);

    address(msg.sender).transfer(reward);

    playerData[msg.sender][WINNER].withdrawn = true;
    book[WINNER][msg.sender] = 0;

    RewardWithdrawn(msg.sender, reward);
  }

  function __callback(bytes32 _queryId, string _result, bytes _proof) public
    onlyValidTeam(_result)
  {
    if (!validQueryIds[_queryId]) revert();
    if (msg.sender != oraclize_cbAddress()) revert();

    WINNER = _result;
    delete validQueryIds[_queryId];

    WinningTeamSet(_result);
    setLosers();
  }

  function oraclizeSetWinner(uint _callback_wei, uint _callback_gas_limit) public payable
    onlyAfterEndTime
    onlyIfWinnerIsMissing
  {
    require(oraclize_getPrice("URL", _callback_gas_limit) < msg.value);

    oraclize_setCustomGasPrice(_callback_wei);

    if (oraclize_getPrice("URL") > address(this).balance) {
      OraclizeQuery("Oraclize query not sent, balance too low");
    } else {
      bytes32 queryId = oraclize_query("URL", oraclizeSource, _callback_gas_limit);
      validQueryIds[queryId] = true;

      OraclizeQuery("Oraclize query sent!");
    }
  }

  //  see private method buildTeamMapping, buildBoolMapping
  //  first element in the nested array represents the team user betted on:
  //    (teamOne -> 0, teamTwo -> 1, draw -> 2)
  //  second element in nested array is the bet amount
  //  third element in nested array represents withdrawal status:
  //    (false -> 0, true -> 1)
  //  additionally (applies to first level elements):
  //    first array holds player data for teamOne
  //    second array holds player data for teamTwo
  //    third array holds pleyer data for draw
  function getPlayerData(address _playerAddress) public view returns(uint[3][3]) {
    return [
      [
        teamMapping[playerData[_playerAddress][teamOne].team],
        playerData[_playerAddress][teamOne].betAmount,
        boolMapping[playerData[_playerAddress][teamOne].withdrawn]
      ],
      [
        teamMapping[playerData[_playerAddress][teamTwo].team],
        playerData[_playerAddress][teamTwo].betAmount,
        boolMapping[playerData[_playerAddress][teamTwo].withdrawn]
      ],
      [
        teamMapping[playerData[_playerAddress][draw].team],
        playerData[_playerAddress][draw].betAmount,
        boolMapping[playerData[_playerAddress][draw].withdrawn]
      ]
    ];
  }

  function getPoolAmounts() public view returns(uint[3]) {
    return [oddsMapping[teamOne], oddsMapping[teamTwo], oddsMapping[draw]];
  }

  function withdrawRemainingRewards() public
    onlyOwner
    onlyAfterEndTime
    onlyIfWinnerIsSet
  {
    address(owner).transfer(address(this).balance);
  }

  function setLosers() private returns(string) {
    if (keccak256(bytes(WINNER)) == keccak256(bytes(teamOne))) {
      loserOne = teamTwo;
      loserTwo = draw;
    } else if (keccak256(bytes(WINNER)) == keccak256(bytes(teamTwo))) {
      loserOne = teamOne;
      loserTwo = draw;
    } else if (keccak256(bytes(WINNER)) == keccak256(bytes(draw))) {
      loserOne = teamOne;
      loserTwo = teamTwo;
    }
  }

  function buildTeamMapping(string _teamOne, string _teamTwo, string _draw) private {
    teamMapping[_teamOne] = 0;
    teamMapping[_teamTwo] = 1;
    teamMapping[_draw] = 2;
  }

  function buildBoolMapping() private {
    boolMapping[false] = 0;
    boolMapping[true] = 1;
  }

  function () public payable {}
}

Contract Security Audit

Contract ABI

[{"constant":true,"inputs":[],"name":"endsAt","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"draw","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getPoolAmounts","outputs":[{"name":"","type":"uint256[3]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_callback_wei","type":"uint256"},{"name":"_callback_gas_limit","type":"uint256"}],"name":"oraclizeSetWinner","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"loserOne","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"myid","type":"bytes32"},{"name":"result","type":"string"}],"name":"__callback","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_playerAddress","type":"address"}],"name":"getPlayerData","outputs":[{"name":"","type":"uint256[3][3]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"withdrawRemainingRewards","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"teamOne","outputs":[{"name":"","type":"string"}],"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":true,"inputs":[],"name":"betsCloseAt","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_team","type":"string"}],"name":"bet","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":"WINNER","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"oraclizeSource","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"withdrawReward","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"teamTwo","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"loserTwo","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_teamOne","type":"string"},{"name":"_teamTwo","type":"string"},{"name":"_endsAt","type":"uint256"},{"name":"_betsCloseAt","type":"uint256"},{"name":"_oraclizeSource","type":"string"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"playerAddress","type":"address"},{"indexed":true,"name":"betAmount","type":"uint256"},{"indexed":true,"name":"team","type":"string"}],"name":"PlayerJoined","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"withdrawer","type":"address"},{"indexed":true,"name":"withdrawnAmount","type":"uint256"}],"name":"RewardWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"team","type":"string"}],"name":"WinningTeamSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"description","type":"string"}],"name":"OraclizeQuery","type":"event"}]

Deployed Bytecode

0x6080604052600436106100e25763ffffffff60e060020a6000350416630a09284a81146100e45780630eecae211461010b578063126d5b8314610195578063215f1cd1146101e2578063252f34a7146101f057806327dc297e146102055780632aa531d91461026357806330865362146102de578063356c22ec146102f357806338bbfa50146103085780636304335b146103a457806374030531146103b95780638da5cb5b14610405578063b108501f14610436578063b83d3f2c1461044b578063c885bc5814610460578063d8e4f9d914610475578063d9feb8ce1461048a575b005b3480156100f057600080fd5b506100f961049f565b60408051918252519081900360200190f35b34801561011757600080fd5b506101206104a5565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561015a578181015183820152602001610142565b50505050905090810190601f1680156101875780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101a157600080fd5b506101aa610533565b6040518082606080838360005b838110156101cf5781810151838201526020016101b7565b5050505090500191505060405180910390f35b6100e26004356024356106b2565b3480156101fc57600080fd5b506101206109c4565b34801561021157600080fd5b5060408051602060046024803582810135601f81018590048502860185019096528585526100e2958335953695604494919390910191908190840183828082843750949750610a1f9650505050505050565b34801561026f57600080fd5b50610284600160a060020a0360043516610a3f565b6040516000826003835b818410156102ce5760208402830151606080838360005b838110156102bd5781810151838201526020016102a5565b50505050905001926001019261028e565b9250505091505060405180910390f35b3480156102ea57600080fd5b506100e26111c1565b3480156102ff57600080fd5b506101206112c5565b34801561031457600080fd5b5060408051602060046024803582810135601f81018590048502860185019096528585526100e295833595369560449491939091019190819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a9998810197919650918201945092508291508401838280828437509497506113209650505050505050565b3480156103b057600080fd5b506100f9611696565b6040805160206004803580820135601f81018490048402850184019095528484526100e294369492936024939284019190819084018382808284375094975061169c9650505050505050565b34801561041157600080fd5b5061041a611c55565b60408051600160a060020a039092168252519081900360200190f35b34801561044257600080fd5b50610120611c64565b34801561045757600080fd5b50610120611cbf565b34801561046c57600080fd5b506100e2611d1a565b34801561048157600080fd5b50610120612155565b34801561049657600080fd5b506101206121b0565b60145481565b6012805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561052b5780601f106105005761010080835404028352916020019161052b565b820191906000526020600020905b81548152906001019060200180831161050e57829003601f168201915b505050505081565b61053b613566565b6060604051908101604052806008601060405180828054600181600116156101000203166002900480156105a65780601f106105845761010080835404028352918201916105a6565b820191906000526020600020905b815481529060010190602001808311610592575b5050915050908152602001604051809103902054815260200160086011604051808280546001816001161561010002031660029004801561061e5780601f106105fc57610100808354040283529182019161061e565b820191906000526020600020905b81548152906001019060200180831161060a575b505091505090815260200160405180910390205481526020016008601260405180828054600181600116156101000203166002900480156106965780601f10610674576101008083540402835291820191610696565b820191906000526020600020905b815481529060010190602001808311610682575b5050928352505060405190819003602001902054905290505b90565b6014546000904210156106c457600080fd5b600d8054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156107505780601f1061072557610100808354040283529160200191610750565b820191906000526020600020905b81548152906001019060200180831161073357829003601f168201915b505050505090508051600014151561076757600080fd5b346107a76040805190810160405280600381526020017f55524c00000000000000000000000000000000000000000000000000000000008152508561220b565b106107b157600080fd5b6107ba84612478565b60408051808201909152600381527f55524c000000000000000000000000000000000000000000000000000000000060208201523031906107fa9061265e565b111561088457604080517f4f7261636c697a65207175657279206e6f742073656e742c2062616c616e636581527f20746f6f206c6f7700000000000000000000000000000000000000000000000060208201529051908190036028018120907fd7789a3deb1d0944b7966c5d18037fc5b3a0a17236de9e7c20fe3a634516729590600090a26109be565b604080518082018252600381527f55524c0000000000000000000000000000000000000000000000000000000000602080830191909152600680548451601f6002600019610100600186161502019093169290920491820184900484028101840190955280855261094c94928301828280156109415780601f1061091657610100808354040283529160200191610941565b820191906000526020600020905b81548152906001019060200180831161092457829003601f168201915b5050505050856128c2565b600081815260096020526040808220805460ff1916600117905580517f4f7261636c697a652071756572792073656e7421000000000000000000000000815290519081900360140181209294507fd7789a3deb1d0944b7966c5d18037fc5b3a0a17236de9e7c20fe3a63451672959190a25b50505050565b600e805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561052b5780601f106105005761010080835404028352916020019161052b565b604080516000815260208101909152610a3b9083908390611320565b5050565b610a47613585565b606060405190810160405280606060405190810160405280600a600c600088600160a060020a0316600160a060020a0316815260200190815260200160002060106040518082805460018160011615610100020316600290048015610ae35780601f10610ac1576101008083540402835291820191610ae3565b820191906000526020600020905b815481529060010190602001808311610acf575b505091505090815260200160405180910390206001016040518082805460018160011615610100020316600290048015610b545780601f10610b32576101008083540402835291820191610b54565b820191906000526020600020905b815481529060010190602001808311610b40575b50509150509081526020016040518091039020548152602001600c600087600160a060020a0316600160a060020a0316815260200190815260200160002060106040518082805460018160011615610100020316600290048015610bef5780601f10610bcd576101008083540402835291820191610bef565b820191906000526020600020905b815481529060010190602001808311610bdb575b50509150509081526020016040518091039020600001548152602001600b6000600c600089600160a060020a0316600160a060020a0316815260200190815260200160002060106040518082805460018160011615610100020316600290048015610c915780601f10610c6f576101008083540402835291820191610c91565b820191906000526020600020905b815481529060010190602001808311610c7d575b5050915050908152602001604051809103902060020160009054906101000a900460ff16151515158152602001908152602001600020548152508152602001606060405190810160405280600a600c600088600160a060020a0316600160a060020a0316815260200190815260200160002060116040518082805460018160011615610100020316600290048015610d605780601f10610d3e576101008083540402835291820191610d60565b820191906000526020600020905b815481529060010190602001808311610d4c575b505091505090815260200160405180910390206001016040518082805460018160011615610100020316600290048015610dd15780601f10610daf576101008083540402835291820191610dd1565b820191906000526020600020905b815481529060010190602001808311610dbd575b50509150509081526020016040518091039020548152602001600c600087600160a060020a0316600160a060020a0316815260200190815260200160002060116040518082805460018160011615610100020316600290048015610e6c5780601f10610e4a576101008083540402835291820191610e6c565b820191906000526020600020905b815481529060010190602001808311610e58575b50509150509081526020016040518091039020600001548152602001600b6000600c600089600160a060020a0316600160a060020a0316815260200190815260200160002060116040518082805460018160011615610100020316600290048015610f0e5780601f10610eec576101008083540402835291820191610f0e565b820191906000526020600020905b815481529060010190602001808311610efa575b5050915050908152602001604051809103902060020160009054906101000a900460ff16151515158152602001908152602001600020548152508152602001606060405190810160405280600a600c600088600160a060020a0316600160a060020a0316815260200190815260200160002060126040518082805460018160011615610100020316600290048015610fdd5780601f10610fbb576101008083540402835291820191610fdd565b820191906000526020600020905b815481529060010190602001808311610fc9575b50509150509081526020016040518091039020600101604051808280546001816001161561010002031660029004801561104e5780601f1061102c57610100808354040283529182019161104e565b820191906000526020600020905b81548152906001019060200180831161103a575b50509150509081526020016040518091039020548152602001600c600087600160a060020a0316600160a060020a03168152602001908152602001600020601260405180828054600181600116156101000203166002900480156110e95780601f106110c75761010080835404028352918201916110e9565b820191906000526020600020905b8154815290600101906020018083116110d5575b50509150509081526020016040518091039020600001548152602001600b6000600c600089600160a060020a0316600160a060020a031681526020019081526020016000206012604051808280546001816001161561010002031660029004801561118b5780601f1061116957610100808354040283529182019161118b565b820191906000526020600020905b815481529060010190602001808311611177575b5050928352505060408051602092819003830190206002015460ff16151583529082019290925201600020549052905292915050565b600554600160a060020a031633146111d857600080fd5b6014544210156111e757600080fd5b600d8054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156112735780601f1061124857610100808354040283529160200191611273565b820191906000526020600020905b81548152906001019060200180831161125657829003601f168201915b50505050509050805160001415151561128b57600080fd5b600554604051600160a060020a0390911690303180156108fc02916000818181858888f19350505050158015610a3b573d6000803e3d6000fd5b6010805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561052b5780601f106105005761010080835404028352916020019161052b565b816010604051808280546001816001161561010002031660029004801561137e5780601f1061135c57610100808354040283529182019161137e565b820191906000526020600020905b81548152906001019060200180831161136a575b50506040519081900381208451909350849250819060208401908083835b602083106113bb5780518252601f19909201916020918201910161139c565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206000191614806114c05750601160405180828054600181600116156101000203166002900480156114505780601f1061142e576101008083540402835291820191611450565b820191906000526020600020905b81548152906001019060200180831161143c575b50506040519081900381208451909350849250819060208401908083835b6020831061148d5780518252601f19909201916020918201910161146e565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060001916145b806115935750601260405180828054600181600116156101000203166002900480156115235780601f10611501576101008083540402835291820191611523565b820191906000526020600020905b81548152906001019060200180831161150f575b50506040519081900381208451909350849250819060208401908083835b602083106115605780518252601f199092019160209182019101611541565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060001916145b151561159e57600080fd5b60008481526009602052604090205460ff1615156115bb57600080fd5b6115c3612cc3565b600160a060020a031633146115d757600080fd5b82516115ea90600d9060208601906135b4565b50600084815260096020908152604091829020805460ff191690559051845185928291908401908083835b602083106116345780518252601f199092019160209182019101611615565b5181516020939093036101000a60001901801990911692169190911790526040519201829003822093507f330e93e2fd2c03d3f62cb902a867ec421d3387128d528b2405364adfeaa9335e92506000919050a261168f612eb4565b5050505050565b60135481565b80601060405180828054600181600116156101000203166002900480156116fa5780601f106116d85761010080835404028352918201916116fa565b820191906000526020600020905b8154815290600101906020018083116116e6575b50506040519081900381208451909350849250819060208401908083835b602083106117375780518252601f199092019160209182019101611718565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060001916148061183c5750601160405180828054600181600116156101000203166002900480156117cc5780601f106117aa5761010080835404028352918201916117cc565b820191906000526020600020905b8154815290600101906020018083116117b8575b50506040519081900381208451909350849250819060208401908083835b602083106118095780518252601f1990920191602091820191016117ea565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060001916145b8061190f57506012604051808280546001816001161561010002031660029004801561189f5780601f1061187d57610100808354040283529182019161189f565b820191906000526020600020905b81548152906001019060200180831161188b575b50506040519081900381208451909350849250819060208401908083835b602083106118dc5780518252601f1990920191602091820191016118bd565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060001916145b151561191a57600080fd5b601354421061192857600080fd5b346007836040518082805190602001908083835b6020831061195b5780518252601f19909201916020918201910161193c565b51815160209384036101000a600019018019909216911617905292019485525060408051948590038201852033600090815290835220805495909501909455505083513492600892869290918291908401908083835b602083106119d05780518252601f1990920191602091820191016119b1565b51815160209384036101000a6000190180199092169116179052920194855250604080519485900382018520805496909601909555336000908152600c82529490942086519094879493508392508401908083835b60208310611a445780518252601f199092019160209182019101611a25565b51815160209384036101000a600019018019909216911617905292019485525060405193849003019092205415159150611b3e9050576040805160608101825234815260208082018590526000828401819052338152600c82528390209251855192939286928291908401908083835b60208310611ad35780518252601f199092019160209182019101611ab4565b51815160209384036101000a6000190180199092169116179052920194855250604051938490038101909320845181558484015180519194611b1d945060018601935001906135b4565b50604091909101516002909101805460ff1916911515919091179055611bcb565b34600c600033600160a060020a0316600160a060020a03168152602001908152602001600020836040518082805190602001908083835b60208310611b945780518252601f199092019160209182019101611b75565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922080549390930190925550505b816040518082805190602001908083835b60208310611bfb5780518252601f199092019160209182019101611bdc565b5181516020939093036101000a600019018019909116921691909117905260405192018290038220935034925033917f269650b7290f5d7cd5c06648e4db2691f0a35bdfe79a605c835f98b983467f029150600090a45050565b600554600160a060020a031681565b600d805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561052b5780601f106105005761010080835404028352916020019161052b565b6006805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561052b5780601f106105005761010080835404028352916020019161052b565b6000806014544210151515611d2e57600080fd5b600d8054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015611dba5780601f10611d8f57610100808354040283529160200191611dba565b820191906000526020600020905b815481529060010190602001808311611d9d57829003601f168201915b505050505090508051600014151515611dd257600080fd5b6007600d6040518082805460018160011615610100020316600290048015611e315780601f10611e0f576101008083540402835291820191611e31565b820191906000526020600020905b815481529060010190602001808311611e1d575b5050928352505060408051918290036020908101832033600090815291522054600d8054919550600892909181908390600260001961010060018416150201909116048015611eb75780601f10611e95576101008083540402835291820191611eb7565b820191906000526020600020905b815481529060010190602001808311611ea3575b50509150509081526020016040518091039020546008600f6040518082805460018160011615610100020316600290048015611f2a5780601f10611f08576101008083540402835291820191611f2a565b820191906000526020600020905b815481529060010190602001808311611f16575b50509150509081526020016040518091039020546008600e6040518082805460018160011615610100020316600290048015611f9d5780601f10611f7b576101008083540402835291820191611f9d565b820191906000526020600020905b815481529060010190602001808311611f89575b5050915050908152602001604051809103902054018402811515611fbd57fe5b60405191900484019250339083156108fc029084906000818181858888f19350505050158015611ff1573d6000803e3d6000fd5b506001600c600033600160a060020a0316600160a060020a03168152602001908152602001600020600d60405180828054600181600116156101000203166002900480156120765780601f10612054576101008083540402835291820191612076565b820191906000526020600020905b815481529060010190602001808311612062575b5050915050908152602001604051809103902060020160006101000a81548160ff02191690831515021790555060006007600d60405180828054600181600116156101000203166002900480156121045780601f106120e2576101008083540402835291820191612104565b820191906000526020600020905b8154815290600101906020018083116120f0575b505092835250506040805160209281900383018120336000818152919094529182209390935584927f1d3eee4ca001cff39eec6ec7615aacf2f2bd61791273830728ba00ccbd6e13379190a3505050565b6011805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561052b5780601f106105005761010080835404028352916020019161052b565b600f805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561052b5780601f106105005761010080835404028352916020019161052b565b60008054600160a060020a03161580612236575060005461223490600160a060020a0316613217565b155b1561224757612245600061321b565b505b6000809054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561229957600080fd5b505af11580156122ad573d6000803e3d6000fd5b505050506040513d60208110156122c357600080fd5b5051600154600160a060020a03908116911614612378576000809054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561232c57600080fd5b505af1158015612340573d6000803e3d6000fd5b505050506040513d602081101561235657600080fd5b505160018054600160a060020a031916600160a060020a039092169190911790555b600154604080517f2ef3accc0000000000000000000000000000000000000000000000000000000081526024810185905260048101918252855160448201528551600160a060020a0390931692632ef3accc9287928792829160640190602086019080838360005b838110156123f85781810151838201526020016123e0565b50505050905090810190601f1680156124255780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b15801561244557600080fd5b505af1158015612459573d6000803e3d6000fd5b505050506040513d602081101561246f57600080fd5b50519392505050565b600054600160a060020a031615806124a257506000546124a090600160a060020a0316613217565b155b156124b3576124b1600061321b565b505b6000809054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561250557600080fd5b505af1158015612519573d6000803e3d6000fd5b505050506040513d602081101561252f57600080fd5b5051600154600160a060020a039081169116146125e4576000809054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561259857600080fd5b505af11580156125ac573d6000803e3d6000fd5b505050506040513d60208110156125c257600080fd5b505160018054600160a060020a031916600160a060020a039092169190911790555b600154604080517fca6ad1e4000000000000000000000000000000000000000000000000000000008152600481018490529051600160a060020a039092169163ca6ad1e49160248082019260009290919082900301818387803b15801561264a57600080fd5b505af115801561168f573d6000803e3d6000fd5b60008054600160a060020a03161580612689575060005461268790600160a060020a0316613217565b155b1561269a57612698600061321b565b505b6000809054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156126ec57600080fd5b505af1158015612700573d6000803e3d6000fd5b505050506040513d602081101561271657600080fd5b5051600154600160a060020a039081169116146127cb576000809054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561277f57600080fd5b505af1158015612793573d6000803e3d6000fd5b505050506040513d60208110156127a957600080fd5b505160018054600160a060020a031916600160a060020a039092169190911790555b6001546040517f524f3889000000000000000000000000000000000000000000000000000000008152602060048201818152855160248401528551600160a060020a039094169363524f388993879383926044909201919085019080838360005b8381101561284457818101518382015260200161282c565b50505050905090810190601f1680156128715780820380516001836020036101000a031916815260200191505b5092505050602060405180830381600087803b15801561289057600080fd5b505af11580156128a4573d6000803e3d6000fd5b505050506040513d60208110156128ba57600080fd5b505192915050565b600080548190600160a060020a031615806128ef57506000546128ed90600160a060020a0316613217565b155b15612900576128fe600061321b565b505b6000809054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561295257600080fd5b505af1158015612966573d6000803e3d6000fd5b505050506040513d602081101561297c57600080fd5b5051600154600160a060020a03908116911614612a31576000809054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156129e557600080fd5b505af11580156129f9573d6000803e3d6000fd5b505050506040513d6020811015612a0f57600080fd5b505160018054600160a060020a031916600160a060020a039092169190911790555b600154604080517f2ef3accc0000000000000000000000000000000000000000000000000000000081526024810186905260048101918252875160448201528751600160a060020a0390931692632ef3accc9289928892829160640190602086019080838360005b83811015612ab1578181015183820152602001612a99565b50505050905090810190601f168015612ade5780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b158015612afe57600080fd5b505af1158015612b12573d6000803e3d6000fd5b505050506040513d6020811015612b2857600080fd5b50519050670de0b6b3a76400003a840201811115612b495760009150612cbb565b6001546040517fc51be90f00000000000000000000000000000000000000000000000000000000815260006004820181815260648301879052608060248401908152895160848501528951600160a060020a039095169463c51be90f948794938c938c938c93604481019160a49091019060208801908083838c5b83811015612bdc578181015183820152602001612bc4565b50505050905090810190601f168015612c095780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015612c3c578181015183820152602001612c24565b50505050905090810190601f168015612c695780820380516001836020036101000a031916815260200191505b5096505050505050506020604051808303818588803b158015612c8b57600080fd5b505af1158015612c9f573d6000803e3d6000fd5b50505050506040513d6020811015612cb657600080fd5b505191505b509392505050565b60008054600160a060020a03161580612cee5750600054612cec90600160a060020a0316613217565b155b15612cff57612cfd600061321b565b505b6000809054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015612d5157600080fd5b505af1158015612d65573d6000803e3d6000fd5b505050506040513d6020811015612d7b57600080fd5b5051600154600160a060020a03908116911614612e30576000809054906101000a9004600160a060020a0316600160a060020a03166338cc48316040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015612de457600080fd5b505af1158015612df8573d6000803e3d6000fd5b505050506040513d6020811015612e0e57600080fd5b505160018054600160a060020a031916600160a060020a039092169190911790555b600160009054906101000a9004600160a060020a0316600160a060020a031663c281d19e6040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015612e8357600080fd5b505af1158015612e97573d6000803e3d6000fd5b505050506040513d6020811015612ead57600080fd5b5051905090565b606060106040518082805460018160011615610100020316600290048015612f135780601f10612ef1576101008083540402835291820191612f13565b820191906000526020600020905b815481529060010190602001808311612eff575b5050915050604051809103902060001916600d6040518082805460018160011615610100020316600290048015612f815780601f10612f5f576101008083540402835291820191612f81565b820191906000526020600020905b815481529060010190602001808311612f6d575b50509150506040518091039020600019161415612fe55760118054612fbb91600e916002600019610100600184161502019091160461362e565b5060128054612fdf91600f916002600019610100600184161502019091160461362e565b506106af565b601160405180828054600181600116156101000203166002900480156130425780601f10613020576101008083540402835291820191613042565b820191906000526020600020905b81548152906001019060200180831161302e575b5050915050604051809103902060001916600d60405180828054600181600116156101000203166002900480156130b05780601f1061308e5761010080835404028352918201916130b0565b820191906000526020600020905b81548152906001019060200180831161309c575b505091505060405180910390206000191614156130ea5760108054612fbb91600e916002600019610100600184161502019091160461362e565b601260405180828054600181600116156101000203166002900480156131475780601f10613125576101008083540402835291820191613147565b820191906000526020600020905b815481529060010190602001808311613133575b5050915050604051809103902060001916600d60405180828054600181600116156101000203166002900480156131b55780601f106131935761010080835404028352918201916131b5565b820191906000526020600020905b8154815290600101906020018083116131a1575b505091505060405180910390206000191614156106af57601080546131ef91600e916002600019610100600184161502019091160461362e565b506011805461321391600f916002600019610100600184161502019091160461362e565b5090565b3b90565b600061322561322b565b92915050565b60008061324b731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed613217565b11156132bc5760008054600160a060020a031916731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed17905560408051808201909152600b81527f6574685f6d61696e6e657400000000000000000000000000000000000000000060208201526132b490613553565b5060016106af565b60006132db73c03a2615d5efaf5f49f60b7bb6583eaec212fdf1613217565b11156133445760008054600160a060020a03191673c03a2615d5efaf5f49f60b7bb6583eaec212fdf117905560408051808201909152600c81527f6574685f726f707374656e33000000000000000000000000000000000000000060208201526132b490613553565b600061336373b7a07bcf2ba2f2703b24c0691b5278999c59ac7e613217565b11156133cc5760008054600160a060020a03191673b7a07bcf2ba2f2703b24c0691b5278999c59ac7e17905560408051808201909152600981527f6574685f6b6f76616e000000000000000000000000000000000000000000000060208201526132b490613553565b60006133eb73146500cfd35b22e4a392fe0adc06de1a1368ed48613217565b11156134545760008054600160a060020a03191673146500cfd35b22e4a392fe0adc06de1a1368ed4817905560408051808201909152600b81527f6574685f72696e6b65627900000000000000000000000000000000000000000060208201526132b490613553565b6000613473736f485c8bf6fc43ea212e93bbf8ce046c7f1cb475613217565b11156134a7575060008054600160a060020a031916736f485c8bf6fc43ea212e93bbf8ce046c7f1cb47517905560016106af565b60006134c67320e12a1f859b3feae5fb2a0a32c18f5a65555bbf613217565b11156134fa575060008054600160a060020a0319167320e12a1f859b3feae5fb2a0a32c18f5a65555bbf17905560016106af565b60006135197351efaf4c8b3c9afbd5ab9f4bbc82784ab6ef8faa613217565b111561354d575060008054600160a060020a0319167351efaf4c8b3c9afbd5ab9f4bbc82784ab6ef8faa17905560016106af565b50600090565b8051610a3b9060029060208401906135b4565b6060604051908101604052806003906020820280388339509192915050565b610120604051908101604052806003905b61359e613566565b8152602001906001900390816135965790505090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106135f557805160ff1916838001178555613622565b82800160010185558215613622579182015b82811115613622578251825591602001919060010190613607565b506132139291506136a3565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106136675780548555613622565b8280016001018555821561362257600052602060002091601f016020900482015b82811115613622578254825591600101919060010190613688565b6106af91905b8082111561321357600081556001016136a95600a165627a7a723058208519f0271972f36d532562604e94239e9dc2b6c47a555a89c42c11241cb579ea0029

Swarm Source

bzzr://8519f0271972f36d532562604e94239e9dc2b6c47a555a89c42c11241cb579ea

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.