Sponsored:   Temco - Join the Largest VC Backed ICO on the Bitcoin Network! TEMCO KYC Whitelist Starts Now!!
Contract Overview
Balance: 0 Ether
Ether Value: $0
Transactions: 4 txns
Misc:
Address Watch: Add To Watch List
Contract Creator: 0x0161c8d35f0b603c7552017fe9642523f70d7b6aat txn 0x88e2a9c7c48aada7c6672ff9b89309a91faf23b9bdaf785cbcb5fa973e1b9b5b
 Latest 4 txns

TxHash Age From To Value [TxFee]
0xf4421e83a2b5aef9efb5997530edd177aee2eee42c2e7e70603fa95346faa7cb234 days 22 hrs agoOraclize  IN   0x838cf4a80ee1bb6a7a7664849587323f15591cee0 Ether0.00167222
0xe0d14e12522c0d28892bdbb128665ffc1e237fac0779f342690281a53f2f1857238 days 19 hrs ago0x0161c8d35f0b603c7552017fe9642523f70d7b6a  IN   0x838cf4a80ee1bb6a7a7664849587323f15591cee0.01 Ether0.00011527
0x591ae3d1588efa1cb6814386374c8ed9f5e46a4089c316c3077f80aaa68b1560238 days 19 hrs ago0x0161c8d35f0b603c7552017fe9642523f70d7b6a  IN   0x838cf4a80ee1bb6a7a7664849587323f15591cee0.01 Ether0.00018656
0x88e2a9c7c48aada7c6672ff9b89309a91faf23b9bdaf785cbcb5fa973e1b9b5b239 days 6 hrs ago0x0161c8d35f0b603c7552017fe9642523f70d7b6a  IN    Contract Creation0 Ether0.0030132201
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
 Latest 3 Internal Transactions

ParentTxHash Block Age From To Value
0xf4421e83a2b5aef9efb5997530edd177aee2eee42c2e7e70603fa95346faa7cb5481323234 days 22 hrs ago0x838cf4a80ee1bb6a7a7664849587323f15591cee0x0161c8d35f0b603c7552017fe9642523f70d7b6a0.0002 Ether
0xf4421e83a2b5aef9efb5997530edd177aee2eee42c2e7e70603fa95346faa7cb5481323234 days 22 hrs ago0x838cf4a80ee1bb6a7a7664849587323f15591cee0x0161c8d35f0b603c7552017fe9642523f70d7b6a0.0006 Ether
0xf4421e83a2b5aef9efb5997530edd177aee2eee42c2e7e70603fa95346faa7cb5481323234 days 22 hrs ago0x838cf4a80ee1bb6a7a7664849587323f15591cee0x0161c8d35f0b603c7552017fe9642523f70d7b6a0.0192 Ether
[ Download CSV Export  ] 
Warning: The Compiled Contract might be susceptible to ExpExponentCleanup (medium/high-severity), EventStructWrongData (very low-severity), NestedArrayFunctionCallDecoder (medium-severity) SolidityCompiler Bugs.

Contract Source Code Verified (Exact Match)
Contract Name: nbagame
Compiler Text: v0.4.20+commit.3155dd80
Optimization Enabled: Yes
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts

pragma solidity 0.4.20;

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



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



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



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

//

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

    OraclizeAddrResolverI OAR;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

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

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

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

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

        bytes32 sigr;
        bytes32 sigs;

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

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


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

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

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

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

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

        if (sigok == false) return false;


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

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

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

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

        return sigok;
    }

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

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

        _;
    }

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

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

        return 0;
    }

    function matchBytes32Prefix(bytes32 content, bytes prefix, uint n_random_bytes) internal returns (bool){
        bool match_ = true;
        
        for (uint256 i=0; i< n_random_bytes; i++) {
            if (content[i] != prefix[i]) match_ = false;
        }

        return match_;
    }

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

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

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

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

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

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

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


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

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

        return oraclize_randomDS_sessionKeysHashVerified[sessionPubkeyHash];
    }


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

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

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

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

        return to;
    }

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

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

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

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

        return (ret, addr);
    }

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

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

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

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

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

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

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

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

}
// </ORACLIZE_API>

contract nbagame is usingOraclize {

  /* Declaration */

  address owner;
  address public creator = 0x0161C8d35f0B603c7552017fe9642523f70d7B6A;
  address public currentOwner = 0x0161C8d35f0B603c7552017fe9642523f70d7B6A;

  uint8 public constant NUM_TEAMS = 2;
  enum TeamType { A, B, None }
  TeamType public winningTeam = TeamType.None;

  // -----------------------------------------------------------------------------------------------------
	string[NUM_TEAMS] public TEAM_NAMES = ["Toronto Raptors", "Washington Wizards"];
	string public searchString = "Raptors vs Wizards April 20, 2018 Winner";
	uint public constant BETTING_OPENS = 1520125200;
	uint public constant BETTING_CLOSES = 1524268800; // Close 5 minutes after scheduled game start
  // -----------------------------------------------------------------------------------------------------
   
  uint public constant TOTAL_POOL_COMMISSION = 10; // Total pool commission psuedo 5% (10% from losing side bet)
  uint public constant EARLY_BET_INCENTIVE_COMMISSION = 4; // The early bettors take pseudo 2% commission to incentivize early betting
  uint public constant OWNER_POOL_COMMISSION = 6; // The owner at the end of the betting phase takes pseudo 3% commission (150% more than creator)
  
  uint public constant MINIMUM_BET = 0.01 ether; // 0.01 ETH is min bet

  uint public constant PAYOUT_ATTEMPT_INTERVAL = 64800; // 16 hours for each ping attempt
  uint public constant BET_RELEASE_DATE = BETTING_CLOSES + 66000; // Release funds if invalid result 48 hours later
  uint public constant PAYOUT_DATE = BETTING_CLOSES + PAYOUT_ATTEMPT_INTERVAL; // First payout attempt
  
  uint public constant STAGE_ONE_BET_LIMIT = 0.2 ether; // Staged limits for commission incentive
  //uint public constant STAGE_TWO_BET_LIMIT = 1 ether;

  bool public payoutCompleted;
  bool public stage2NotReached = true;
  
  struct Bettor {
    uint[NUM_TEAMS] amountsBet;
	uint[NUM_TEAMS] amountsBetStage1;
	uint[NUM_TEAMS] amountsBetStage2;
	//uint[NUM_TEAMS] amountsBetStage3;
  }
  mapping(address => Bettor) bettorInfo;
  address[] bettors;
  uint[NUM_TEAMS] public totalAmountsBet;
  uint[NUM_TEAMS] public totalAmountsBetStage1;
  uint[NUM_TEAMS] public totalAmountsBetStage2;
  uint public numberOfBets;
  uint public totalBetAmount;
  //uint public numberOfPingsAttempted;
  //uint public numberOfPingsReceived;
  //uint public numberOfSuccessfulPings;
  uint public contractPrice = 0.05 ether;		// Starting price of 0.05 ETH for contract
  
  uint private firstStepLimit = 0.1 ether;      // Step price increase to exit smaller numbers quicker
  uint private secondStepLimit = 0.5 ether;

  /* Modifiers */

  // Modifier to only allow the execution of
  // payout related functions when winning team
  // is determined
  modifier canPerformPayout() {
    if (winningTeam != TeamType.None && !payoutCompleted && now > BETTING_CLOSES) _;
  }

  // Modifier to only allow the execution of
  // certain functions when betting is closed
  modifier bettingIsClosed() {
    if (now > BETTING_CLOSES) _;
  }

  // Modifier to only allow the execution of
  // certain functions restricted to the creator
  modifier onlyCreatorLevel() {
    require(
      creator == msg.sender
    );
    _;
  }
  
  /* Functions */
  
  // Constructor
  function nbagame() public {
    owner = msg.sender;
    pingOracle(PAYOUT_DATE - now); // Schedule and pay for first oracle call
  }

  // If something terrible happens and we are past the BET_RELEASE_DATE, just release bet back to the bettors
  // Creator only, failsafe in case everything fails, we can give everyone their money back.
  function triggerRelease() public onlyCreatorLevel {
    require(now > BET_RELEASE_DATE);
    
    releaseBets();
  }

 // PRIVATE functions for safety checks
   /// Safety check on _to address to prevent against an unexpected 0x0 default.
  function _addressNotNull(address _adr) private pure returns (bool) {
    return _adr != address(0);
  }
  
  function pingOracle(uint pingDelay) private {
    // Ping oracle after pingDelay time to query result
    oraclize_query(pingDelay, "WolframAlpha", searchString);
    //numberOfPingsAttempted++;
  }

  // Callback from Oraclize
  function __callback(bytes32 queryId, string result, bytes proof) public {
	//numberOfPingsReceived++;
	  
    require(payoutCompleted == false);
    require(msg.sender == oraclize_cbAddress());
    
    //numberOfSuccessfulPings++;
    
    // Determine winning team index based
    // on its name that the request returned
    if (keccak256(TEAM_NAMES[0]) == keccak256(result)) { 
      winningTeam = TeamType(0);
    }
    else if (keccak256(TEAM_NAMES[1]) == keccak256(result)) {
      winningTeam = TeamType(1);
    }
    
    // If there's an error (failed authenticity proof, result
    // didn't match any team), then reschedule for next period interval
    if (winningTeam == TeamType.None) {    
      // Unless we are past the release date, then release funds back to the bettors
      if (now >= BET_RELEASE_DATE)
        return releaseBets();
      return pingOracle(PAYOUT_ATTEMPT_INTERVAL);
    }
    
    performPayout();
  }

  // Returns the total amounts betted for the sender
  function getUserBets() public constant returns(uint[NUM_TEAMS]) {    
    return bettorInfo[msg.sender].amountsBet;
  }

  // Release all the bets back to the bettors if the oracle result cannot be verified
  function releaseBets() private {
    uint storedBalance = this.balance;
    for (uint k = 0; k < bettors.length; k++) {
      uint totalBet = SafeMath.add(bettorInfo[bettors[k]].amountsBet[0], bettorInfo[bettors[k]].amountsBet[1]);
      bettors[k].transfer(SafeMath.mul(totalBet, SafeMath.div(storedBalance, totalBetAmount)));
    }
    
    // For complete safe proof, ensure no balance left over after the release payout
    currentOwner.transfer(this.balance);
  }
  
  // Returns true if betting is allowed within time frame
  function canBet() public constant returns(bool) {
    return (now >= BETTING_OPENS && now < BETTING_CLOSES);
  }
  
  // Trigger immediate payout as creator (costs small amount of additional gas)
  function triggerPayout() public onlyCreatorLevel {
    pingOracle(5);
  }

  // Function for user to bet on team idx,
  function bet(uint teamIdx) public payable {
    require(canBet() == true);
    require(TeamType(teamIdx) == TeamType.A || TeamType(teamIdx) == TeamType.B);
    require(msg.value >= MINIMUM_BET);

    // Add bettor to bettor list if they are not on it
    if (bettorInfo[msg.sender].amountsBet[0] == 0 && bettorInfo[msg.sender].amountsBet[1] == 0)
      bettors.push(msg.sender);

	// Commission Staging
	// If bigger than the stage 1 limit
	if (totalAmountsBet[teamIdx] >= STAGE_ONE_BET_LIMIT) {
		// Accrue stage 2 commission
		bettorInfo[msg.sender].amountsBetStage2[teamIdx] += msg.value;
		
		totalAmountsBetStage2[teamIdx] += msg.value;
	}
	
	// If it is less
	if (totalAmountsBet[teamIdx] < STAGE_ONE_BET_LIMIT) {
		// Check if it will fit completely in stage 1
		if (SafeMath.add(totalAmountsBet[teamIdx], msg.value) <= STAGE_ONE_BET_LIMIT) {
			bettorInfo[msg.sender].amountsBetStage1[teamIdx] += msg.value;
			
			totalAmountsBetStage1[teamIdx] += msg.value;
		} else {
			// If it does not completely fit, include what can, and excess goes to stage 2
			uint amountLeft = SafeMath.sub(STAGE_ONE_BET_LIMIT, totalAmountsBet[teamIdx]);
			uint amountExcess = SafeMath.sub(msg.value, amountLeft);
			
			bettorInfo[msg.sender].amountsBetStage1[teamIdx] += amountLeft;
			bettorInfo[msg.sender].amountsBetStage2[teamIdx] += amountExcess;
			
			totalAmountsBetStage1[teamIdx] = STAGE_ONE_BET_LIMIT;
			totalAmountsBetStage2[teamIdx] += amountExcess;
		}
	}
	
    // Perform bet
    bettorInfo[msg.sender].amountsBet[teamIdx] += msg.value;
    numberOfBets++;
    totalBetAmount += msg.value;
    totalAmountsBet[teamIdx] += msg.value;
  }
  
  // Performs payout based on winning team
  function performPayout() private canPerformPayout {
    // Calculate total pool of ETH betted for all different teams, and for the winning pool.
    
    uint losingChunk = SafeMath.sub(this.balance, totalAmountsBet[uint(winningTeam)]);
    uint currentOwnerPayoutCommission = uint256(SafeMath.div(SafeMath.mul(OWNER_POOL_COMMISSION, losingChunk), 100)); // 6% commission
    uint eachStageCommission = uint256(SafeMath.div(SafeMath.mul(1, losingChunk), 100)); // 1% commission for each stage
    // Calculate portion of commission owed to all interested parties
   
    // Weighted payout to bettors based on
    // their contribution to the winning pool
    for (uint k = 0; k < bettors.length; k++) {
      uint betOnWinner = bettorInfo[bettors[k]].amountsBet[uint(winningTeam)];
      uint payout = betOnWinner + ((betOnWinner * (losingChunk - currentOwnerPayoutCommission - (4 * eachStageCommission))) / totalAmountsBet[uint(winningTeam)]);
      
	  // Pull and calculate the commission payout from stage 1 and stage 2 commission bonuses
	  // Currently hard coded for 2 team system, check for non zero divisor
	  if (totalAmountsBetStage1[0] > 0) {
		  uint stageOneCommissionPayoutTeam0 = ((bettorInfo[bettors[k]].amountsBetStage1[0] * eachStageCommission) / totalAmountsBetStage1[0]);
		  payout += stageOneCommissionPayoutTeam0;
	  }
	  
	  if (totalAmountsBetStage1[1] > 0) {
		  uint stageOneCommissionPayoutTeam1 = ((bettorInfo[bettors[k]].amountsBetStage1[1] * eachStageCommission) / totalAmountsBetStage1[1]);
		  payout += stageOneCommissionPayoutTeam1;
	  }
	  
	  if (totalAmountsBetStage2[0] > 0) {
		  uint stageTwoCommissionPayoutTeam0 = ((bettorInfo[bettors[k]].amountsBetStage2[0] * eachStageCommission) / totalAmountsBetStage2[0]);
		  payout += stageTwoCommissionPayoutTeam0;
	  }
	  
	  if (totalAmountsBetStage2[1] > 0) {
		  uint stageTwoCommissionPayoutTeam1 = ((bettorInfo[bettors[k]].amountsBetStage2[1] * eachStageCommission) / totalAmountsBetStage2[1]);
		  payout += stageTwoCommissionPayoutTeam1;
	  }
	    
	  if (payout > 0)
        bettors[k].transfer(payout);
    }
	
    currentOwner.transfer(currentOwnerPayoutCommission);
    
	// Transfer remaining balance to creators.  If both teams have reached stage 2, creators get 0% commission
    if (this.balance > 0) {
        creator.transfer(this.balance);
        stage2NotReached = true;
    } else {
		stage2NotReached = false;
	}
	
    payoutCompleted = true;
  }

  function buyContract() public payable {
    address oldOwner = currentOwner;
    address newOwner = msg.sender;
  
    require(newOwner != oldOwner);
	require(_addressNotNull(newOwner));
	require(msg.value >= contractPrice);
	require(now < BETTING_CLOSES);
	
	// Take 6% commission on sale, seller gets the rest
	uint payment = uint(SafeMath.div(SafeMath.mul(contractPrice, 94), 100));
	uint purchaseExcess = uint(SafeMath.sub(msg.value, contractPrice));
	uint creatorCommissionValue = uint(SafeMath.sub(contractPrice, payment));
	
	// Update the prices after purchase to new values based on step price
	if (contractPrice < firstStepLimit) {
		// First stage, about 40% increase on paid price
		contractPrice = SafeMath.div(SafeMath.mul(contractPrice, 132), 94);
	} else if (contractPrice < secondStepLimit) {
		// Second stage, about 30% increase on paid price
		contractPrice = SafeMath.div(SafeMath.mul(contractPrice, 122), 94);
	} else {
		// Third stage, about 20% increase on paid price
		contractPrice = SafeMath.div(SafeMath.mul(contractPrice, 113), 94);
	}
	
	// New owner of contract
	currentOwner = newOwner;
	
	// Pay the previous owner and the creator commission
	oldOwner.transfer(payment); // 94%
	creator.transfer(creatorCommissionValue);
	
	msg.sender.transfer(purchaseExcess); // Send the buyer any excess they paid for the contract
  }
}

library SafeMath {

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

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

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

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

    Contract ABI  
[{"constant":true,"inputs":[],"name":"creator","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"triggerPayout","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"triggerRelease","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"searchString","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getUserBets","outputs":[{"name":"","type":"uint256[2]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"BETTING_OPENS","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"TOTAL_POOL_COMMISSION","outputs":[{"name":"","type":"uint256"}],"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":"numberOfBets","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"NUM_TEAMS","outputs":[{"name":"","type":"uint8"}],"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":"","type":"uint256"}],"name":"totalAmountsBet","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"PAYOUT_ATTEMPT_INTERVAL","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"STAGE_ONE_BET_LIMIT","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"canBet","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalBetAmount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"teamIdx","type":"uint256"}],"name":"bet","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"totalAmountsBetStage1","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"PAYOUT_DATE","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"OWNER_POOL_COMMISSION","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MINIMUM_BET","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"contractPrice","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"BET_RELEASE_DATE","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"totalAmountsBetStage2","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"currentOwner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"stage2NotReached","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"payoutCompleted","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"winningTeam","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"buyContract","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"TEAM_NAMES","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"EARLY_BET_INCENTIVE_COMMISSION","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"BETTING_CLOSES","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"}]

  Contract Creation Code Switch To Opcodes View
6060604090815260068054730161c8d35f0b603c7552017fe9642523f70d7b6a600160a060020a031991821681179092556007805490911690911760a060020a60ff021916740200000000000000000000000000000000000000001790558051908101604052806040805190810160405280600f81526020017f546f726f6e746f20526170746f72730000000000000000000000000000000000815250815260200160408051908101604052601281527f57617368696e67746f6e2057697a61726473000000000000000000000000000060208201529052620000e790600890600262000adf565b50606060405190810160405280602881526020017f526170746f72732076732057697a6172647320417072696c2032302c2032303181526020017f382057696e6e6572000000000000000000000000000000000000000000000000815250600a9080516200015a92916020019062000b35565b50600b805461ff00191661010017905566b1a2bc2ec5000060165567016345785d8a00006017556706f05b59d3b2000060185534156200019957600080fd5b60058054600160a060020a03191633600160a060020a0316179055620001d342635adb7c2003640100000000620001d9810262000fc81704565b62000c49565b620002cd816040805190810160405280600c81526020017f576f6c6672616d416c7068610000000000000000000000000000000000000000815250600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015620002ae5780601f106200028257610100808354040283529160200191620002ae565b820191906000526020600020905b8154815290600101906020018083116200029057829003601f168201915b5050505050620002d164010000000002620017fc176401000000009004565b5050565b600080548190600160a060020a031615806200030f57506000546200030d90600160a060020a031664010000000062001b75620006e482021704565b155b1562000331576200032f600064010000000062001b79620006e882021704565b505b60008054600160a060020a0316906338cc483190604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156200039457600080fd5b6102c65a03f11515620003a657600080fd5b5050506040518051600154600160a060020a039081169116149050620004655760008054600160a060020a0316906338cc483190604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156200042957600080fd5b6102c65a03f115156200043b57600080fd5b505050604051805160018054600160a060020a031916600160a060020a0392909216919091179055505b600154600160a060020a031663524f3889856000604051602001526040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018080602001828103825283818151815260200191508051906020019080838360005b83811015620004ea578082015183820152602001620004d0565b50505050905090810190601f168015620005185780820380516001836020036101000a031916815260200191505b5092505050602060405180830381600087803b15156200053757600080fd5b6102c65a03f115156200054957600080fd5b5050506040518051915050670de0b6b3a764000062030d403a0201811115620005765760009150620006dc565b600154600160a060020a031663adf59f99828787876000604051602001526040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808481526020018060200180602001838103835285818151815260200191508051906020019080838360005b8381101562000608578082015183820152602001620005ee565b50505050905090810190601f168015620006365780820380516001836020036101000a031916815260200191505b50838103825284818151815260200191508051906020019080838360005b838110156200066e57808201518382015260200162000654565b50505050905090810190601f1680156200069c5780820380516001836020036101000a031916815260200191505b50955050505050506020604051808303818588803b1515620006bd57600080fd5b6125ee5a03f11515620006cf57600080fd5b5050505060405180519250505b509392505050565b3b90565b60008062000718731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed64010000000062001b75620006e482021704565b11156200079a5760008054600160a060020a031916731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed1790556200079160408051908101604052600b81527f6574685f6d61696e6e6574000000000000000000000000000000000000000000602082015264010000000062001e9f62000aca82021704565b50600162000ac5565b6000620007c973c03a2615d5efaf5f49f60b7bb6583eaec212fdf164010000000062001b75620006e482021704565b1115620008425760008054600160a060020a03191673c03a2615d5efaf5f49f60b7bb6583eaec212fdf11790556200079160408051908101604052600c81527f6574685f726f707374656e330000000000000000000000000000000000000000602082015264010000000062001e9f62000aca82021704565b60006200087173b7a07bcf2ba2f2703b24c0691b5278999c59ac7e64010000000062001b75620006e482021704565b1115620008ea5760008054600160a060020a03191673b7a07bcf2ba2f2703b24c0691b5278999c59ac7e1790556200079160408051908101604052600981527f6574685f6b6f76616e0000000000000000000000000000000000000000000000602082015264010000000062001e9f62000aca82021704565b60006200091973146500cfd35b22e4a392fe0adc06de1a1368ed4864010000000062001b75620006e482021704565b1115620009925760008054600160a060020a03191673146500cfd35b22e4a392fe0adc06de1a1368ed481790556200079160408051908101604052600b81527f6574685f72696e6b656279000000000000000000000000000000000000000000602082015264010000000062001e9f62000aca82021704565b6000620009c1736f485c8bf6fc43ea212e93bbf8ce046c7f1cb47564010000000062001b75620006e482021704565b1115620009f7575060008054600160a060020a031916736f485c8bf6fc43ea212e93bbf8ce046c7f1cb475179055600162000ac5565b600062000a267320e12a1f859b3feae5fb2a0a32c18f5a65555bbf64010000000062001b75620006e482021704565b111562000a5c575060008054600160a060020a0319167320e12a1f859b3feae5fb2a0a32c18f5a65555bbf179055600162000ac5565b600062000a8b7351efaf4c8b3c9afbd5ab9f4bbc82784ab6ef8faa64010000000062001b75620006e482021704565b111562000ac1575060008054600160a060020a0319167351efaf4c8b3c9afbd5ab9f4bbc82784ab6ef8faa179055600162000ac5565b5060005b919050565b6002818051620002cd92916020019062000b35565b826002810192821562000b23579160200282015b8281111562000b235782518290805162000b1292916020019062000b35565b509160200191906001019062000af3565b5062000b3192915062000bb6565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1062000b7857805160ff191683800117855562000ba8565b8280016001018555821562000ba8579182015b8281111562000ba857825182559160200191906001019062000b8b565b5062000b3192915062000be1565b62000bde91905b8082111562000b3157600062000bd4828262000bfe565b5060010162000bbd565b90565b62000bde91905b8082111562000b31576000815560010162000be8565b50805460018160011615610100020316600290046000825580601f1062000c26575062000c46565b601f01602090049060005260206000209081019062000c46919062000be1565b50565b611fc08062000c596000396000f30060606040526004361061017c5763ffffffff60e060020a60003504166302d05d3f811461018157806305a95f04146101b05780630c96c4ea146101c55780631180788e146101d857806312074a461461026257806322b9b712146102ad57806326735c06146102d257806327dc297e146102e55780632ca8c6d31461033b57806330a8b2c91461034e57806338bbfa5014610377578063515d4d521461040f578063520c7d6f14610425578063558388811461043857806355ec671a1461044b578063613f4594146104725780637365870b14610485578063761fe6fe14610490578063875ac8f1146104a65780638f6b875a146104b9578063935aae40146104cc57806397e9a0bf146104df5780639b1f70d1146104f2578063b0203f3f14610505578063b387ef921461051b578063b5e352481461052e578063da7fc7c514610541578063de3f18e214610554578063de866db11461058b578063e1496d1614610593578063e9cddb1d146105a9578063f62e037c146105bc575b600080fd5b341561018c57600080fd5b6101946105cf565b604051600160a060020a03909116815260200160405180910390f35b34156101bb57600080fd5b6101c36105de565b005b34156101d057600080fd5b6101c3610605565b34156101e357600080fd5b6101eb610638565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561022757808201518382015260200161020f565b50505050905090810190601f1680156102545780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561026d57600080fd5b6102756106d6565b6040518082604080838360005b8381101561029a578082015183820152602001610282565b5050505090500191505060405180910390f35b34156102b857600080fd5b6102c061072f565b60405190815260200160405180910390f35b34156102dd57600080fd5b6102c0610737565b34156102f057600080fd5b6101c3600480359060446024803590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061073c95505050505050565b341561034657600080fd5b6102c061076e565b341561035957600080fd5b610361610774565b60405160ff909116815260200160405180910390f35b341561038257600080fd5b6101c3600480359060446024803590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284375094965061077995505050505050565b341561041a57600080fd5b6102c06004356109e4565b341561043057600080fd5b6102c06109f8565b341561044357600080fd5b6102c06109fe565b341561045657600080fd5b61045e610a0a565b604051901515815260200160405180910390f35b341561047d57600080fd5b6102c0610a28565b6101c3600435610a2e565b341561049b57600080fd5b6102c0600435610d2d565b34156104b157600080fd5b6102c0610d3a565b34156104c457600080fd5b6102c0610d42565b34156104d757600080fd5b6102c0610d47565b34156104ea57600080fd5b6102c0610d52565b34156104fd57600080fd5b6102c0610d58565b341561051057600080fd5b6102c0600435610d60565b341561052657600080fd5b610194610d6d565b341561053957600080fd5b61045e610d7c565b341561054c57600080fd5b61045e610d8a565b341561055f57600080fd5b610567610d93565b6040518082600281111561057757fe5b60ff16815260200191505060405180910390f35b6101c3610da3565b341561059e57600080fd5b6101eb600435610f40565b34156105b457600080fd5b6102c0610fbb565b34156105c757600080fd5b6102c0610fc0565b600654600160a060020a031681565b60065433600160a060020a039081169116146105f957600080fd5b6106036005610fc8565b565b60065433600160a060020a0390811691161461062057600080fd5b635adb80d0421161063057600080fd5b6106036110a2565b600a8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106ce5780601f106106a3576101008083540402835291602001916106ce565b820191906000526020600020905b8154815290600101906020018083116106b157829003601f168201915b505050505081565b6106de611eb2565b600160a060020a0333166000908152600c6020526040908190209060029080519081016040529190828260026020028201915b81548152602001906001019080831161071157505050505090505b90565b635a9b451081565b600a81565b61076a828260006040518059106107505750595b818152601f19601f83011681016020016040529050610779565b5050565b60145481565b600281565b600b5460ff161561078957600080fd5b6107916111f2565b600160a060020a031633600160a060020a03161415156107b057600080fd5b816040518082805190602001908083835b602083106107e05780518252601f1990920191602091820191016107c1565b6001836020036101000a03801982511681845116179092525050509190910192506040915050519081900390206008604051808280546001816001161561010002031660029004801561086a5780601f1061084857610100808354040283529182019161086a565b820191906000526020600020905b815481529060010190602001808311610856575b505091505060405190819003902014156108a1576007805474ff000000000000000000000000000000000000000019169055610994565b816040518082805190602001908083835b602083106108d15780518252601f1990920191602091820191016108b2565b6001836020036101000a03801982511681845116179092525050509190910192506040915050519081900390206009604051808280546001816001161561010002031660029004801561095b5780601f1061093957610100808354040283529182019161095b565b820191906000526020600020905b815481529060010190602001808311610947575b50509150506040519081900390201415610994576007805474ff0000000000000000000000000000000000000000191660a060020a1790555b600260075460a060020a900460ff1660028111156109ae57fe5b14156109d757635adb80d042106109cc576109c76110a2565b6109df565b6109c761fd20610fc8565b6109df611392565b505050565b600e81600281106109f157fe5b0154905081565b61fd2081565b6702c68af0bb14000081565b6000635a9b45104210158015610a235750635ada7f0042105b905090565b60155481565b600080610a39610a0a565b1515600114610a4757600080fd5b6000836002811115610a5557fe5b6002811115610a6057fe5b1480610a8257506001836002811115610a7557fe5b6002811115610a8057fe5b145b1515610a8d57600080fd5b662386f26fc10000341015610aa157600080fd5b33600160a060020a03166000908152600c6020526040902054158015610ae05750600160a060020a0333166000908152600c6020526040902060010154155b15610b1d57600d805460018101610af78382611ed8565b5060009182526020909120018054600160a060020a03191633600160a060020a03161790555b6702c68af0bb140000600e8460028110610b3357fe5b015410610b8157600160a060020a0333166000908152600c6020526040902034906004018460028110610b6257fe5b01805490910190553460128460028110610b7857fe5b01805490910190555b6702c68af0bb140000600e8460028110610b9757fe5b01541015610cd2576702c68af0bb140000610bc0600e8560028110610bb857fe5b01543461177c565b11610c1257600160a060020a0333166000908152600c60205260409020349060029081019085908110610bef57fe5b01805490910190553460108460028110610c0557fe5b0180549091019055610cd2565b610c326702c68af0bb140000600e8560028110610c2b57fe5b0154611796565b9150610c3e3483611796565b600160a060020a0333166000908152600c60205260409020909150829060029081019085908110610c6b57fe5b0180549091019055600160a060020a0333166000908152600c6020526040902081906004018460028110610c9b57fe5b01805490910190556702c68af0bb14000060108460028110610cb957fe5b01558060128460028110610cc957fe5b01805490910190555b600160a060020a0333166000908152600c6020526040902034908460028110610cf757fe5b01805490910190556014805460010190556015805434908101909155600e8460028110610d2057fe5b0180549091019055505050565b601081600281106109f157fe5b635adb7c2081565b600681565b662386f26fc1000081565b60165481565b635adb80d081565b601281600281106109f157fe5b600754600160a060020a031681565b600b54610100900460ff1681565b600b5460ff1681565b60075460a060020a900460ff1681565b600754600160a060020a03908116903390600090819081908416851415610dc957600080fd5b610dd2846117a8565b1515610ddd57600080fd5b601654341015610dec57600080fd5b635ada7f004210610dfc57600080fd5b610e13610e0c601654605e6117ba565b60646117e5565b9250610e2134601654611796565b9150610e2f60165484611796565b90506017546016541015610e5c57610e54610e4d60165460846117ba565b605e6117e5565b601655610e8c565b6018546016541015610e7857610e54610e4d601654607a6117ba565b610e88610e4d60165460716117ba565b6016555b60078054600160a060020a031916600160a060020a038681169190911790915585166108fc84150284604051600060405180830381858888f193505050501515610ed557600080fd5b600654600160a060020a031681156108fc0282604051600060405180830381858888f193505050501515610f0857600080fd5b600160a060020a03331682156108fc0283604051600060405180830381858888f193505050501515610f3957600080fd5b5050505050565b60088160028110610f4d57fe5b018054909150600260001961010060018416150201909116046020601f820181900481020160405190810160405280929190818152602001828054600181600116156101000203166002900480156106ce5780601f106106a3576101008083540402835291602001916106ce565b600481565b635ada7f0081565b61076a816040805190810160405280600c81526020017f576f6c6672616d416c7068610000000000000000000000000000000000000000815250600a8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110985780601f1061106d57610100808354040283529160200191611098565b820191906000526020600020905b81548152906001019060200180831161107b57829003601f168201915b50505050506117fc565b600160a060020a033016316000805b600d548210156111b957611138600c6000600d858154811015156110d157fe5b6000918252602080832090910154600160a060020a031683528201929092526040018120900154600c6000600d8681548110151561110b57fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190206001015461177c565b9050600d8281548110151561114957fe5b906000526020600020900160009054906101000a9004600160a060020a0316600160a060020a03166108fc61118983611184876015546117e5565b6117ba565b9081150290604051600060405180830381858888f1935050505015156111ae57600080fd5b6001909101906110b1565b600754600160a060020a039081169030163180156108fc0290604051600060405180830381858888f1935050505015156109df57600080fd5b60008054600160a060020a0316158061121d575060005461121b90600160a060020a0316611b75565b155b1561122e5761122c6000611b79565b505b60008054600160a060020a0316906338cc483190604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561127757600080fd5b6102c65a03f1151561128857600080fd5b5050506040518051600154600160a060020a03908116911614905061132b5760008054600160a060020a0316906338cc483190604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156112f057600080fd5b6102c65a03f1151561130157600080fd5b505050604051805160018054600160a060020a031916600160a060020a0392909216919091179055505b600154600160a060020a031663c281d19e6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561137357600080fd5b6102c65a03f1151561138457600080fd5b505050604051805191505090565b6000808080808080808080600260075460a060020a900460ff1660028111156113b757fe5b141580156113c85750600b5460ff16155b80156113d75750635ada7f0042115b156117705761141130600160a060020a031631600e600760149054906101000a900460ff16600281111561140757fe5b60028110610c2b57fe5b9950611421610e0c60068c6117ba565b9850611431610e0c60018c6117ba565b9750600096505b600d548710156116c357600c6000600d8981548110151561145557fe5b6000918252602080832090910154600160a060020a03168352820192909252604001902060075460ff60a060020a90910416600281111561149257fe5b6002811061149c57fe5b0154600754909650600e9060a060020a900460ff1660028111156114bc57fe5b600281106114c657fe5b0154886004028a8c030387028115156114db57fe5b04860194506000601081015411156115425760106000015488600c6000600d8b81548110151561150757fe5b600091825260208083209190910154600160a060020a031683528201929092526040019020600201540281151561153a57fe5b049485019493505b60115460009011156115a35760106001015488600c6000600d8b81548110151561156857fe5b600091825260208083209190910154600160a060020a031683528201929092526040019020600301540281151561159b57fe5b049485019492505b60125460009011156116045760126000015488600c6000600d8b8154811015156115c957fe5b600091825260208083209190910154600160a060020a03168352820192909252604001902060040154028115156115fc57fe5b049485019491505b60135460009011156116655760126001015488600c6000600d8b81548110151561162a57fe5b600091825260208083209190910154600160a060020a031683528201929092526040019020600501540281151561165d57fe5b049485019490505b60008511156116b857600d80548890811061167c57fe5b600091825260209091200154600160a060020a031685156108fc0286604051600060405180830381858888f1935050505015156116b857600080fd5b600190960195611438565b600754600160a060020a031689156108fc028a604051600060405180830381858888f1935050505015156116f657600080fd5b600030600160a060020a031631111561175657600654600160a060020a039081169030163180156108fc0290604051600060405180830381858888f19350505050151561174257600080fd5b600b805461ff001916610100179055611762565b600b805461ff00191690555b600b805460ff191660011790555b50505050505050505050565b60008282018381101561178b57fe5b8091505b5092915050565b6000828211156117a257fe5b50900390565b600160a060020a03811615155b919050565b6000808315156117cd576000915061178f565b508282028284828115156117dd57fe5b041461178b57fe5b60008082848115156117f357fe5b04949350505050565b600080548190600160a060020a03161580611829575060005461182790600160a060020a0316611b75565b155b1561183a576118386000611b79565b505b60008054600160a060020a0316906338cc483190604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561188357600080fd5b6102c65a03f1151561189457600080fd5b5050506040518051600154600160a060020a0390811691161490506119375760008054600160a060020a0316906338cc483190604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156118fc57600080fd5b6102c65a03f1151561190d57600080fd5b505050604051805160018054600160a060020a031916600160a060020a0392909216919091179055505b600154600160a060020a031663524f3889856000604051602001526040518263ffffffff1660e060020a0281526004018080602001828103825283818151815260200191508051906020019080838360005b838110156119a1578082015183820152602001611989565b50505050905090810190601f1680156119ce5780820380516001836020036101000a031916815260200191505b5092505050602060405180830381600087803b15156119ec57600080fd5b6102c65a03f115156119fd57600080fd5b5050506040518051915050670de0b6b3a764000062030d403a0201811115611a285760009150611b6d565b600154600160a060020a031663adf59f99828787876000604051602001526040518563ffffffff1660e060020a028152600401808481526020018060200180602001838103835285818151815260200191508051906020019080838360005b83811015611a9f578082015183820152602001611a87565b50505050905090810190601f168015611acc5780820380516001836020036101000a031916815260200191505b50838103825284818151815260200191508051906020019080838360005b83811015611b02578082015183820152602001611aea565b50505050905090810190601f168015611b2f5780820380516001836020036101000a031916815260200191505b50955050505050506020604051808303818588803b1515611b4f57600080fd5b6125ee5a03f11515611b6057600080fd5b5050505060405180519250505b509392505050565b3b90565b600080611b99731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed611b75565b1115611c095760008054600160a060020a031916731d3b2638a7cc9f2cb3d298a3da7a90b67e5506ed179055611c0160408051908101604052600b81527f6574685f6d61696e6e65740000000000000000000000000000000000000000006020820152611e9f565b5060016117b5565b6000611c2873c03a2615d5efaf5f49f60b7bb6583eaec212fdf1611b75565b1115611c905760008054600160a060020a03191673c03a2615d5efaf5f49f60b7bb6583eaec212fdf1179055611c0160408051908101604052600c81527f6574685f726f707374656e3300000000000000000000000000000000000000006020820152611e9f565b6000611caf73b7a07bcf2ba2f2703b24c0691b5278999c59ac7e611b75565b1115611d175760008054600160a060020a03191673b7a07bcf2ba2f2703b24c0691b5278999c59ac7e179055611c0160408051908101604052600981527f6574685f6b6f76616e00000000000000000000000000000000000000000000006020820152611e9f565b6000611d3673146500cfd35b22e4a392fe0adc06de1a1368ed48611b75565b1115611d9e5760008054600160a060020a03191673146500cfd35b22e4a392fe0adc06de1a1368ed48179055611c0160408051908101604052600b81527f6574685f72696e6b6562790000000000000000000000000000000000000000006020820152611e9f565b6000611dbd736f485c8bf6fc43ea212e93bbf8ce046c7f1cb475611b75565b1115611df1575060008054600160a060020a031916736f485c8bf6fc43ea212e93bbf8ce046c7f1cb47517905560016117b5565b6000611e107320e12a1f859b3feae5fb2a0a32c18f5a65555bbf611b75565b1115611e44575060008054600160a060020a0319167320e12a1f859b3feae5fb2a0a32c18f5a65555bbf17905560016117b5565b6000611e637351efaf4c8b3c9afbd5ab9f4bbc82784ab6ef8faa611b75565b1115611e97575060008054600160a060020a0319167351efaf4c8b3c9afbd5ab9f4bbc82784ab6ef8faa17905560016117b5565b506000919050565b600281805161076a929160200190611efc565b604080519081016040526002815b6000815260200190600190039081611ec05790505090565b8154818355818115116109df576000838152602090206109df918101908301611f7a565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611f3d57805160ff1916838001178555611f6a565b82800160010185558215611f6a579182015b82811115611f6a578251825591602001919060010190611f4f565b50611f76929150611f7a565b5090565b61072c91905b80821115611f765760008155600101611f805600a165627a7a72305820f0da4a9e4a0812acf185fc0d26efc7b418ba80203ea27a12e548f8eafc1ebc6a0029

   Swarm Source:
bzzr://f0da4a9e4a0812acf185fc0d26efc7b418ba80203ea27a12e548f8eafc1ebc6a

 

View All
Block Age transaction Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.