Contract Overview
Balance: 0.0000001 Ether
Ether Value: Less Than $0.01 (@ $88.45/ETH)
Transactions: 27 txns
Misc:
Address Watch: Add To Watch List
Contract Creator: 0x028377b5d7efc17c8450c70444c17ab317109f5fat txn 0x6c830f7302d92a1be633e39f4a665571c0120b75d59638ae4f40e7ff094674ee
 Latest 25 transactions from a total of 27 transactions

TxHash Age From To Value [TxFee]
0x09d9adbe15a40263e87956c2cae696e70e6b6657230a6bb1fe764a73ae2a93be8 days 7 hrs ago0xeeab5379eb95e091becd56fe91792d341f6933c6  IN   0x4e59a782ff0b66bcd60c2f9f406ca1be940c61340.02 Ether0.000087788
0x6bf6d61740469c1ca5adf54669017741d38ba8213ce8634385d13398a09d15cc122 days 5 hrs ago0x7bcd84fbb82a93d239f93af46dfec21eb39e2ed1  IN   0x4e59a782ff0b66bcd60c2f9f406ca1be940c61340.01 Ether0.000065841
0x0343b9eee6fcac3f5f76c4722b788ddd36e6ebccb0e35f21f9a47c53f776ada0122 days 10 hrs ago0xf769c3bcf363a4fa07ce975d49b39b339f795847  IN   0x4e59a782ff0b66bcd60c2f9f406ca1be940c61340 Ether0.00020101
0xf7e40a8f6d88ab4862033089ec3954bd1611f975314cf6c1afd8dc4a34aa166c122 days 12 hrs ago0x4cd13ff9a32c3732fadd8f931740005faa5ebc9a  IN   0x4e59a782ff0b66bcd60c2f9f406ca1be940c61340 Ether0.000321616
0xd315470a8164c64bb44a5ac7d9e2c88d2ac54699de6ded1a75e519ef528ef4bd122 days 12 hrs ago0xd67bf9c53c710a33f27a9f28e009271d17d060cd  IN   0x4e59a782ff0b66bcd60c2f9f406ca1be940c61340 Ether0.000160808
0xf67e220ab47c1a02de517cf5049daa9d26737507fff6da960e03aeaadbee8073122 days 14 hrs ago0x1f92771237bd5eae04e91b4b6f1d1a78d41565a2  IN   0x4e59a782ff0b66bcd60c2f9f406ca1be940c61340 Ether0.0002492524
0x52177d4238abf6d9176608621737409824ecf43f2e60c322eb4efe6c96bb923d122 days 14 hrs ago0x06550e014dcc6ae4843b574c2ace7dcbdbb9d1d6  IN   0x4e59a782ff0b66bcd60c2f9f406ca1be940c61340.05 Ether0.00021947
0x85691e2b3ed828e82e6ac2a49c38330777e3c9336c6679f2a5ba3286131fd842122 days 17 hrs ago0x3e3d6befef12a3b0d77120e84e23b3f514d21758  IN   0x4e59a782ff0b66bcd60c2f9f406ca1be940c61340 Ether0.0002050302
0x88496b54030ccb477921cf107752e5a8bb463f735397f5f14ccb21cfbe19e301122 days 18 hrs ago0xd7a215bd6722d1e6f4b3af2dfec0806cfe796fa9  IN   0x4e59a782ff0b66bcd60c2f9f406ca1be940c61340.35 Ether0.00109735
0x4b395fd4c6c85ac5c71e1fdebfd24305bb415b42a5ed92dc05d50e89722880fb122 days 18 hrs ago0x009a12d4290630bc01fd82516ac57c1dc6a9bcfb  IN   0x4e59a782ff0b66bcd60c2f9f406ca1be940c61340.05 Ether0.000088908
0x7919853aa55a8da727380dceb7d40d38f3c043a5b7f1adad88c675a4be23cad7122 days 18 hrs ago0xe802ab704a8477c55d296ce13bd0939ff902ee54  IN   0x4e59a782ff0b66bcd60c2f9f406ca1be940c61340.06 Ether0.00113919
0xe8d806386aa60199757e662b4568467505ce85cd93f99027d12e059bb648dc1c122 days 18 hrs ago0x53c7ee1c508fb8ee18a1d7378b1cd46d8ad3efb7  IN   0x4e59a782ff0b66bcd60c2f9f406ca1be940c61340.15 Ether0.001215136
0xd675b2fdcae621b199a8fba7fa4863d680e2ddad91a236aa8210727ae45ecdf3122 days 18 hrs ago0x820ee4f8f52f309208ad5c2e5a5343270dcb7bff  IN   0x4e59a782ff0b66bcd60c2f9f406ca1be940c61340.05 Ether0.00037973
0xe95163b416c335b4618c8012f84ba225d036755e6eaf7a4a13decb0945904cc9122 days 18 hrs ago0x4cd13ff9a32c3732fadd8f931740005faa5ebc9a  IN   0x4e59a782ff0b66bcd60c2f9f406ca1be940c61340.035 Ether0.00075946
0x26fd6fc58e037525f265d663a7851789a34f299f47d48fe54667d14773875a8f122 days 18 hrs ago0x3e3d6befef12a3b0d77120e84e23b3f514d21758  IN   0x4e59a782ff0b66bcd60c2f9f406ca1be940c61340.05 Ether0.00037973
0x8dda69e4bf4aea5660bd28972aa1193b3d7a2b08bfa1ba285d711091c8ad6493122 days 19 hrs ago0xf769c3bcf363a4fa07ce975d49b39b339f795847  IN   0x4e59a782ff0b66bcd60c2f9f406ca1be940c61340.03 Ether0.000222792
0xe6478a794981582be9bcf58b5b2d6f880ecebb017cd04982ee2d139e8d036736122 days 20 hrs ago0xa8cf900f70e441ed78e510b00e5c980eb5bba8e7  IN   0x4e59a782ff0b66bcd60c2f9f406ca1be940c61340.1 Ether0.00037973
0x026f48d13ba01e1fd46ae51e8058542939b712354a0b8d4a265f003b45d60c0d122 days 21 hrs ago0x4a0be05695ecba28417763f7c3637aaa0677c092  IN   0x4e59a782ff0b66bcd60c2f9f406ca1be940c61340.01 Ether0.000227838
0x850fcbac794a5ae8b179dc8dacc5cff21b9fb0769832efe24e848c0a7d400e93122 days 21 hrs ago0x06550e014dcc6ae4843b574c2ace7dcbdbb9d1d6  IN   0x4e59a782ff0b66bcd60c2f9f406ca1be940c61340.05 Ether0.00027849
0x0d213e2b6ed0b3e52a751ec7f7378ffd6e6f186a6177bf2d7c5567a84eee24af122 days 21 hrs ago0x06550e014dcc6ae4843b574c2ace7dcbdbb9d1d6  IN   0x4e59a782ff0b66bcd60c2f9f406ca1be940c61340.05 Ether0.00037973
0xf51c582f298e7bb7451c1beb18ec8c9b965cedeef83f768ec1aa74a460ec7109122 days 22 hrs ago0xd67bf9c53c710a33f27a9f28e009271d17d060cd  IN   0x4e59a782ff0b66bcd60c2f9f406ca1be940c61340.04 Ether0.000122094
0xc43a3bb3e668c74f855f2a456ca0bb49d8d36f2c520bd38440a4dbd739f09436122 days 22 hrs ago0xd67bf9c53c710a33f27a9f28e009271d17d060cd  IN   0x4e59a782ff0b66bcd60c2f9f406ca1be940c61340.05 Ether0.000167094
0x959dfae890fe9036d4d5ce40a86db27fc764de8fd92297f9be24b7ffdcc71f80122 days 22 hrs ago0xd67bf9c53c710a33f27a9f28e009271d17d060cd  IN   0x4e59a782ff0b66bcd60c2f9f406ca1be940c61340.01 Ether0.000303784
0x55d57e8b6f9fe9b9e82565b28d1f4e6ff4588b5a7f3a8bd9d6d4d66795b7db3d122 days 22 hrs ago0xf769c3bcf363a4fa07ce975d49b39b339f795847  IN   0x4e59a782ff0b66bcd60c2f9f406ca1be940c61340.03 Ether0.000227838
0x3988bd63c395fd8f3a65c0017abd853ab13da13af0c84a4ad051ac51b405fea2122 days 23 hrs ago0x1f92771237bd5eae04e91b4b6f1d1a78d41565a2  IN   0x4e59a782ff0b66bcd60c2f9f406ca1be940c61341.06 Ether0.00035349
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
 Latest 8 Internal Transactions

ParentTxHash Block Age From To Value
0x0343b9eee6fcac3f5f76c4722b788ddd36e6ebccb0e35f21f9a47c53f776ada06128085122 days 10 hrs ago0x4e59a782ff0b66bcd60c2f9f406ca1be940c61340xf769c3bcf363a4fa07ce975d49b39b339f7958470.08415612 Ether
0xf7e40a8f6d88ab4862033089ec3954bd1611f975314cf6c1afd8dc4a34aa166c6127620122 days 12 hrs ago0x4e59a782ff0b66bcd60c2f9f406ca1be940c61340x4cd13ff9a32c3732fadd8f931740005faa5ebc9a0.09818214 Ether
0xd315470a8164c64bb44a5ac7d9e2c88d2ac54699de6ded1a75e519ef528ef4bd6127487122 days 12 hrs ago0x4e59a782ff0b66bcd60c2f9f406ca1be940c61340xd67bf9c53c710a33f27a9f28e009271d17d060cd0.1402602 Ether
0xf67e220ab47c1a02de517cf5049daa9d26737507fff6da960e03aeaadbee80736127093122 days 14 hrs ago0x4e59a782ff0b66bcd60c2f9f406ca1be940c61340x1f92771237bd5eae04e91b4b6f1d1a78d41565a22.97351624 Ether
0x85691e2b3ed828e82e6ac2a49c38330777e3c9336c6679f2a5ba3286131fd8426126461122 days 17 hrs ago0x4e59a782ff0b66bcd60c2f9f406ca1be940c61340x3e3d6befef12a3b0d77120e84e23b3f514d217580.1402602 Ether
0x3c04e06abf2346efbec096acd79d18e76e272bb30fce98395fda75e94a0a049b6126426122 days 17 hrs ago0x4e59a782ff0b66bcd60c2f9f406ca1be940c61340x72b2670e55139934d6445348dc6eab4089b125760.092875 Ether
0x3c04e06abf2346efbec096acd79d18e76e272bb30fce98395fda75e94a0a049b6126426122 days 17 hrs ago0x4e59a782ff0b66bcd60c2f9f406ca1be940c61340xf783a81f046448c38f3c863885d9e99d102097790.18575 Ether
0x6c830f7302d92a1be633e39f4a665571c0120b75d59638ae4f40e7ff094674ee6124921122 days 23 hrs ago0x028377b5d7efc17c8450c70444c17ab317109f5f  Contract Creation0 Ether
[ Download CSV Export  ] 
Warning: The Compiled Contract might be susceptible to ExpExponentCleanup (medium/high-severity), EventStructWrongData (very low-severity) SolidityCompiler Bugs.

Contract Source Code Verified (Similar Match)
Note: Displaying Similar Match Verified Source Code At Contract 0xe75a60da4bad89b84d10a7ab8e28f9ed7ba22401(Excluding Constructor Arguments if any)
Contract Name: Betting
Compiler Text: v0.4.24+commit.e67f0147
Optimization Enabled: Yes
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts

pragma solidity ^0.4.21;
library SafeMath {
  function mul(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a * b;
    assert(a == 0 || c / a == b);
    return c;
  }

  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;
  }

  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    assert(b <= a);
    return a - b;
  }

  function add(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a + b;
    assert(c >= a);
    return c;
  }
}

interface P3DTakeout {
    function buyTokens() external payable;
}

contract Betting {
    using SafeMath for uint256; //using safemath

    address public owner; //owner address
    address house_takeout = 0xf783A81F046448c38f3c863885D9e99D10209779;
    P3DTakeout P3DContract_;

    uint public winnerPoolTotal;
    string public constant version = "0.2.3";

    struct chronus_info {
        bool  betting_open; // boolean: check if betting is open
        bool  race_start; //boolean: check if race has started
        bool  race_end; //boolean: check if race has ended
        bool  voided_bet; //boolean: check if race has been voided
        uint32  starting_time; // timestamp of when the race starts
        uint32  betting_duration;
        uint32  race_duration; // duration of the race
        uint32 voided_timestamp;
    }

    struct horses_info{
        int64  BTC_delta; //horses.BTC delta value
        int64  ETH_delta; //horses.ETH delta value
        int64  LTC_delta; //horses.LTC delta value
        bytes32 BTC; //32-bytes equivalent of horses.BTC
        bytes32 ETH; //32-bytes equivalent of horses.ETH
        bytes32 LTC;  //32-bytes equivalent of horses.LTC
    }

    struct bet_info{
        bytes32 horse; // coin on which amount is bet on
        uint amount; // amount bet by Bettor
    }
    struct coin_info{
        uint256 pre; // locking price
        uint256 post; // ending price
        uint160 total; // total coin pool
        uint32 count; // number of bets
        bool price_check;
    }
    struct voter_info {
        uint160 total_bet; //total amount of bet placed
        bool rewarded; // boolean: check for double spending
        mapping(bytes32=>uint) bets; //array of bets
    }

    mapping (bytes32 => coin_info) public coinIndex; // mapping coins with pool information
    mapping (address => voter_info) voterIndex; // mapping voter address with Bettor information

    uint public total_reward; // total reward to be awarded
    uint32 total_bettors;
    mapping (bytes32 => bool) public winner_horse;


    // tracking events
    event Deposit(address _from, uint256 _value, bytes32 _horse, uint256 _date);
    event Withdraw(address _to, uint256 _value);
    event PriceCallback(bytes32 coin_pointer, uint256 result, bool isPrePrice);
    event RefundEnabled(string reason);

    // constructor
    constructor() public payable {
        
        owner = msg.sender;
        
        horses.BTC = bytes32("BTC");
        horses.ETH = bytes32("ETH");
        horses.LTC = bytes32("LTC");
        
        P3DContract_ = P3DTakeout(0x72b2670e55139934D6445348DC6EaB4089B12576);
    }

    // data access structures
    horses_info public horses;
    chronus_info public chronus;

    // modifiers for restricting access to methods
    modifier onlyOwner {
        require(owner == msg.sender);
        _;
    }

    modifier duringBetting {
        require(chronus.betting_open);
        require(now < chronus.starting_time + chronus.betting_duration);
        _;
    }

    modifier beforeBetting {
        require(!chronus.betting_open && !chronus.race_start);
        _;
    }

    modifier afterRace {
        require(chronus.race_end);
        _;
    }

    //function to change owner
    function changeOwnership(address _newOwner) onlyOwner external {
        owner = _newOwner;
    }

    function priceCallback (bytes32 coin_pointer, uint256 result, bool isPrePrice ) external onlyOwner {
        require (!chronus.race_end);
        emit PriceCallback(coin_pointer, result, isPrePrice);
        chronus.race_start = true;
        chronus.betting_open = false;
        if (isPrePrice) {
            if (now >= chronus.starting_time+chronus.betting_duration+ 60 minutes) {
                emit RefundEnabled("Late start price");
                forceVoidRace();
            } else {
                coinIndex[coin_pointer].pre = result;
            }
        } else if (!isPrePrice){
            if (coinIndex[coin_pointer].pre > 0 ){
                if (now >= chronus.starting_time+chronus.race_duration+ 60 minutes) {
                    emit RefundEnabled("Late end price");
                    forceVoidRace();
                } else {
                    coinIndex[coin_pointer].post = result;
                    coinIndex[coin_pointer].price_check = true;

                    if (coinIndex[horses.ETH].price_check && coinIndex[horses.BTC].price_check && coinIndex[horses.LTC].price_check) {
                        reward();
                    }
                }
            } else {
                emit RefundEnabled("End price came before start price");
                forceVoidRace();
            }
        }
    }

    // place a bet on a coin(horse) lockBetting
    function placeBet(bytes32 horse) external duringBetting payable  {
        require(msg.value >= 0.01 ether);
        if (voterIndex[msg.sender].total_bet==0) {
            total_bettors+=1;
        }
        uint _newAmount = voterIndex[msg.sender].bets[horse] + msg.value;
        voterIndex[msg.sender].bets[horse] = _newAmount;
        voterIndex[msg.sender].total_bet += uint160(msg.value);
        uint160 _newTotal = coinIndex[horse].total + uint160(msg.value);
        uint32 _newCount = coinIndex[horse].count + 1;
        coinIndex[horse].total = _newTotal;
        coinIndex[horse].count = _newCount;
        emit Deposit(msg.sender, msg.value, horse, now);
    }

    // fallback method for accepting payments
    function () private payable {}

    // method to place the oraclize queries
    function setupRace(uint32 _bettingDuration, uint32 _raceDuration) onlyOwner beforeBetting external payable {
            chronus.starting_time = uint32(block.timestamp);
            chronus.betting_open = true;
            chronus.betting_duration = _bettingDuration;
            chronus.race_duration = _raceDuration;
    }

    // method to calculate reward (called internally by callback)
    function reward() internal {
        /*
        calculating the difference in price with a precision of 5 digits
        not using safemath since signed integers are handled
        */
        horses.BTC_delta = int64(coinIndex[horses.BTC].post - coinIndex[horses.BTC].pre)*100000/int64(coinIndex[horses.BTC].pre);
        horses.ETH_delta = int64(coinIndex[horses.ETH].post - coinIndex[horses.ETH].pre)*100000/int64(coinIndex[horses.ETH].pre);
        horses.LTC_delta = int64(coinIndex[horses.LTC].post - coinIndex[horses.LTC].pre)*100000/int64(coinIndex[horses.LTC].pre);

        total_reward = (coinIndex[horses.BTC].total) + (coinIndex[horses.ETH].total) + (coinIndex[horses.LTC].total);
        if (total_bettors <= 1) {
            emit RefundEnabled("Not enough participants");
            forceVoidRace();
        } else {
            // house takeout
            uint house_fee = total_reward.mul(5).div(100);
            require(house_fee < address(this).balance);
            total_reward = total_reward.sub(house_fee);
            house_takeout.transfer(house_fee);
            
            // p3d takeout
            uint p3d_fee = house_fee/2;
            require(p3d_fee < address(this).balance);
            total_reward = total_reward.sub(p3d_fee);
            P3DContract_.buyTokens.value(p3d_fee)();
        }

        if (horses.BTC_delta > horses.ETH_delta) {
            if (horses.BTC_delta > horses.LTC_delta) {
                winner_horse[horses.BTC] = true;
                winnerPoolTotal = coinIndex[horses.BTC].total;
            }
            else if(horses.LTC_delta > horses.BTC_delta) {
                winner_horse[horses.LTC] = true;
                winnerPoolTotal = coinIndex[horses.LTC].total;
            } else {
                winner_horse[horses.BTC] = true;
                winner_horse[horses.LTC] = true;
                winnerPoolTotal = coinIndex[horses.BTC].total + (coinIndex[horses.LTC].total);
            }
        } else if(horses.ETH_delta > horses.BTC_delta) {
            if (horses.ETH_delta > horses.LTC_delta) {
                winner_horse[horses.ETH] = true;
                winnerPoolTotal = coinIndex[horses.ETH].total;
            }
            else if (horses.LTC_delta > horses.ETH_delta) {
                winner_horse[horses.LTC] = true;
                winnerPoolTotal = coinIndex[horses.LTC].total;
            } else {
                winner_horse[horses.ETH] = true;
                winner_horse[horses.LTC] = true;
                winnerPoolTotal = coinIndex[horses.ETH].total + (coinIndex[horses.LTC].total);
            }
        } else {
            if (horses.LTC_delta > horses.ETH_delta) {
                winner_horse[horses.LTC] = true;
                winnerPoolTotal = coinIndex[horses.LTC].total;
            } else if(horses.LTC_delta < horses.ETH_delta){
                winner_horse[horses.ETH] = true;
                winner_horse[horses.BTC] = true;
                winnerPoolTotal = coinIndex[horses.ETH].total + (coinIndex[horses.BTC].total);
            } else {
                winner_horse[horses.LTC] = true;
                winner_horse[horses.ETH] = true;
                winner_horse[horses.BTC] = true;
                winnerPoolTotal = coinIndex[horses.ETH].total + (coinIndex[horses.BTC].total) + (coinIndex[horses.LTC].total);
            }
        }
        chronus.race_end = true;
    }

    // method to calculate an invidual's reward
    function calculateReward(address candidate) internal afterRace constant returns(uint winner_reward) {
        voter_info storage bettor = voterIndex[candidate];
        if(chronus.voided_bet) {
            winner_reward = bettor.total_bet;
        } else {
            uint winning_bet_total;
            if(winner_horse[horses.BTC]) {
                winning_bet_total += bettor.bets[horses.BTC];
            } if(winner_horse[horses.ETH]) {
                winning_bet_total += bettor.bets[horses.ETH];
            } if(winner_horse[horses.LTC]) {
                winning_bet_total += bettor.bets[horses.LTC];
            }
            winner_reward += (((total_reward.mul(10000000)).div(winnerPoolTotal)).mul(winning_bet_total)).div(10000000);
        }
    }

    // method to just check the reward amount
    function checkReward() afterRace external constant returns (uint) {
        require(!voterIndex[msg.sender].rewarded);
        return calculateReward(msg.sender);
    }

    // method to claim the reward amount
    function claim_reward() afterRace external {
        require(!voterIndex[msg.sender].rewarded);
        uint transfer_amount = calculateReward(msg.sender);
        require(address(this).balance >= transfer_amount);
        voterIndex[msg.sender].rewarded = true;
        msg.sender.transfer(transfer_amount);
        emit Withdraw(msg.sender, transfer_amount);
    }

    function forceVoidRace() internal {
        chronus.voided_bet=true;
        chronus.race_end = true;
        chronus.voided_timestamp=uint32(now);
    }

    // exposing the coin pool details for DApp
    function getCoinIndex(bytes32 index, address candidate) external constant returns (uint, uint, uint, bool, uint) {
        uint256 coinPrePrice;
        uint256 coinPostPrice;
        if (coinIndex[horses.ETH].pre > 0 && coinIndex[horses.BTC].pre > 0 && coinIndex[horses.LTC].pre > 0) {
            coinPrePrice = coinIndex[index].pre;
        } 
        if (coinIndex[horses.ETH].post > 0 && coinIndex[horses.BTC].post > 0 && coinIndex[horses.LTC].post > 0) {
            coinPostPrice = coinIndex[index].post;
        }
        return (coinIndex[index].total, coinPrePrice, coinPostPrice, coinIndex[index].price_check, voterIndex[candidate].bets[index]);
    }

    // exposing the total reward amount for DApp
    function reward_total() external constant returns (uint) {
        return ((coinIndex[horses.BTC].total) + (coinIndex[horses.ETH].total) + (coinIndex[horses.LTC].total));
    }

    // in case of any errors in race, enable full refund for the Bettors to claim
    function refund() external onlyOwner {
        require(now > chronus.starting_time + chronus.race_duration);
        require((chronus.betting_open && !chronus.race_start)
            || (chronus.race_start && !chronus.race_end));
        chronus.voided_bet = true;
        chronus.race_end = true;
        chronus.voided_timestamp=uint32(now);
    }

    // method to claim unclaimed winnings after 30 day notice period
    function recovery() external onlyOwner{
        require((chronus.race_end && now > chronus.starting_time + chronus.race_duration + (30 days))
            || (chronus.voided_bet && now > chronus.voided_timestamp + (30 days)));
        house_takeout.transfer(address(this).balance);
    }
}

    Contract ABI  
[{"constant":false,"inputs":[{"name":"horse","type":"bytes32"}],"name":"placeBet","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[],"name":"claim_reward","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"winner_horse","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"coin_pointer","type":"bytes32"},{"name":"result","type":"uint256"},{"name":"isPrePrice","type":"bool"}],"name":"priceCallback","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"winnerPoolTotal","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"changeOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"horses","outputs":[{"name":"BTC_delta","type":"int64"},{"name":"ETH_delta","type":"int64"},{"name":"LTC_delta","type":"int64"},{"name":"BTC","type":"bytes32"},{"name":"ETH","type":"bytes32"},{"name":"LTC","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"version","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"refund","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"index","type":"bytes32"},{"name":"candidate","type":"address"}],"name":"getCoinIndex","outputs":[{"name":"","type":"uint256"},{"name":"","type":"uint256"},{"name":"","type":"uint256"},{"name":"","type":"bool"},{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"chronus","outputs":[{"name":"betting_open","type":"bool"},{"name":"race_start","type":"bool"},{"name":"race_end","type":"bool"},{"name":"voided_bet","type":"bool"},{"name":"starting_time","type":"uint32"},{"name":"betting_duration","type":"uint32"},{"name":"race_duration","type":"uint32"},{"name":"voided_timestamp","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_bettingDuration","type":"uint32"},{"name":"_raceDuration","type":"uint32"}],"name":"setupRace","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":"reward_total","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"checkReward","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"coinIndex","outputs":[{"name":"pre","type":"uint256"},{"name":"post","type":"uint256"},{"name":"total","type":"uint160"},{"name":"count","type":"uint32"},{"name":"price_check","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"total_reward","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"recovery","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[],"payable":true,"stateMutability":"payable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_from","type":"address"},{"indexed":false,"name":"_value","type":"uint256"},{"indexed":false,"name":"_horse","type":"bytes32"},{"indexed":false,"name":"_date","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_to","type":"address"},{"indexed":false,"name":"_value","type":"uint256"}],"name":"Withdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"coin_pointer","type":"bytes32"},{"indexed":false,"name":"result","type":"uint256"},{"indexed":false,"name":"isPrePrice","type":"bool"}],"name":"PriceCallback","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"reason","type":"string"}],"name":"RefundEnabled","type":"event"}]

  Contract Creation Code Switch To Opcodes View
608060405260018054600160a060020a031990811673f783a81f046448c38f3c863885d9e99d1020977917909155600080548216331790557f4254430000000000000000000000000000000000000000000000000000000000600a557f4554480000000000000000000000000000000000000000000000000000000000600b557f4c54430000000000000000000000000000000000000000000000000000000000600c55600280549091167372b2670e55139934d6445348dc6eab4089b125761790556118ab806100d16000396000f3006080604052600436106100fb5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663042b5fed81146100fd578063055ee253146101085780630f7696441461011d57806311dcee2f1461014957806329114d65146101695780632af4c31e1461019057806343bddf40146101b157806354fd4d5014610208578063590e1ae3146102925780637274f35b146102a757806384304ee5146102f85780638b63c86f1461035b5780638da5cb5b14610372578063aa93038b146103a3578063c4b24a46146103b8578063d2aed6d7146103cd578063d3d2172e14610420578063ddceafa914610435575b005b6100fb60043561044a565b34801561011457600080fd5b506100fb6105e5565b34801561012957600080fd5b506101356004356106d5565b604080519115158252519081900360200190f35b34801561015557600080fd5b506100fb60043560243560443515156106ea565b34801561017557600080fd5b5061017e6109ee565b60408051918252519081900360200190f35b34801561019c57600080fd5b506100fb600160a060020a03600435166109f4565b3480156101bd57600080fd5b506101c6610a3a565b60408051600797880b880b815295870b870b602087015293860b90950b848401526060840191909152608083015260a082019290925290519081900360c00190f35b34801561021457600080fd5b5061021d610a6c565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561025757818101518382015260200161023f565b50505050905090810190601f1680156102845780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561029e57600080fd5b506100fb610aa3565b3480156102b357600080fd5b506102cb600435600160a060020a0360243516610b85565b60408051958652602086019490945284840192909252151560608401526080830152519081900360a00190f35b34801561030457600080fd5b5061030d610cb1565b604080519815158952961515602089015294151587870152921515606087015263ffffffff9182166080870152811660a086015290811660c08501521660e083015251908190036101000190f35b6100fb63ffffffff60043581169060243516610d13565b34801561037e57600080fd5b50610387610dd1565b60408051600160a060020a039092168252519081900360200190f35b3480156103af57600080fd5b5061017e610de0565b3480156103c457600080fd5b5061017e610e25565b3480156103d957600080fd5b506103e5600435610e71565b604080519586526020860194909452600160a060020a039092168484015263ffffffff16606084015215156080830152519081900360a00190f35b34801561042c57600080fd5b5061017e610eb5565b34801561044157600080fd5b506100fb610ebb565b600d546000908190819060ff16151561046257600080fd5b600d54640100000000810463ffffffff9081166801000000000000000090920481169190910116421061049457600080fd5b662386f26fc100003410156104a857600080fd5b33600090815260056020526040902054600160a060020a031615156104e4576007805463ffffffff8082166001011663ffffffff199091161790555b50503360008181526005602090815260408083208684526001808201845282852080543490810191829055835473ffffffffffffffffffffffffffffffffffffffff19808216600160a060020a0392831684018316179095556004875296859020600201805494851685891683019889161777ffffffff0000000000000000000000000000000000000000191660a060020a9586900463ffffffff90811690950194851690950294909417909355835196875293860191909152848201879052426060860152905191945091927f60452eb7177e8d41c9d9fbc4c6e9ccf55a4d44d412355fbf2f02668e0d1a0ce1916080918190039190910190a150505050565b600d5460009062010000900460ff1615156105ff57600080fd5b3360009081526005602052604090205460a060020a900460ff161561062357600080fd5b61062c33610f95565b9050303181111561063c57600080fd5b33600081815260056020526040808220805474ff0000000000000000000000000000000000000000191660a060020a1790555183156108fc0291849190818181858888f19350505050158015610696573d6000803e3d6000fd5b50604080513381526020810183905281517f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364929181900390910190a150565b60086020526000908152604090205460ff1681565b600054600160a060020a0316331461070157600080fd5b600d5462010000900460ff161561071757600080fd5b60408051848152602081018490528215158183015290517fde16ef9c49ad256644606beb97130511ba3d64bbd230380f8edd107527e5a9da9181900360600190a1600d805460ff1961ff001990911661010017169055801561081657600d54610e10640100000000820463ffffffff90811668010000000000000000909304811692909201011642106107ff576040805160208082526010908201527f4c617465207374617274207072696365000000000000000000000000000000008183015290516000805160206118608339815191529181900360600190a16107fa610b3b565b610811565b60008381526004602052604090208290555b6109e9565b8015156109e957600083815260046020526040812054111561096d57600d54610e10640100000000820463ffffffff9081166c01000000000000000000000000909304811692909201011642106108bd57604080516020808252600e908201527f4c61746520656e642070726963650000000000000000000000000000000000008183015290516000805160206118608339815191529181900360600190a16107fa610b3b565b600083815260046020526040808220600181018590556002908101805478ff000000000000000000000000000000000000000000000000191660c060020a908117909155600b54845291909220909101540460ff1680156109395750600a5460009081526004602052604090206002015460c060020a900460ff165b80156109605750600c5460009081526004602052604090206002015460c060020a900460ff165b15610811576108116110cf565b6040805160208082526021908201527f456e642070726963652063616d65206265666f72652073746172742070726963818301527f6500000000000000000000000000000000000000000000000000000000000000606082015290516000805160206118608339815191529181900360800190a16109e9610b3b565b505050565b60035481565b600054600160a060020a03163314610a0b57600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600954600a54600b54600c54600784810b94680100000000000000008104820b94608060020a90910490910b92909186565b60408051808201909152600581527f302e322e33000000000000000000000000000000000000000000000000000000602082015281565b600054600160a060020a03163314610aba57600080fd5b600d54640100000000810463ffffffff9081166c01000000000000000000000000909204811691909101164211610af057600080fd5b600d5460ff168015610b0a5750600d54610100900460ff16155b80610b305750600d54610100900460ff168015610b305750600d5462010000900460ff16155b1515610b3b57600080fd5b600d805462010000630100000063ff000000199092169190911762ff000019161773ffffffff000000000000000000000000000000001916608060020a4263ffffffff1602179055565b600b5460009081526004602052604081205481908190819081908190819081108015610bc05750600a54600090815260046020526040812054115b8015610bdb5750600c54600090815260046020526040812054115b15610bf25760008981526004602052604090205491505b600b54600090815260046020526040812060010154118015610c265750600a54600090815260046020526040812060010154115b8015610c445750600c54600090815260046020526040812060010154115b15610c5d57506000888152600460205260409020600101545b600089815260046020908152604080832060020154600160a060020a039b8c168452600583528184209c84526001909c01909152902054978916999198909760c060020a90910460ff169650945092505050565b600d5460ff808216916101008104821691620100008204811691630100000081049091169063ffffffff64010000000082048116916801000000000000000081048216916c010000000000000000000000008204811691608060020a90041688565b600054600160a060020a03163314610d2a57600080fd5b600d5460ff16158015610d455750600d54610100900460ff16155b1515610d5057600080fd5b600d805463ffffffff9283166c01000000000000000000000000026fffffffff0000000000000000000000001994841668010000000000000000026bffffffff00000000000000001960ff1942969096166401000000000267ffffffff00000000199094169390931794909416600117919091169290921792909216179055565b600054600160a060020a031681565b600c54600090815260046020526040808220600290810154600b548452828420820154600a548552929093200154600160a060020a0392831691831690831601011690565b600d5460009062010000900460ff161515610e3f57600080fd5b3360009081526005602052604090205460a060020a900460ff1615610e6357600080fd5b610e6c33610f95565b905090565b600460205260009081526040902080546001820154600290920154909190600160a060020a0381169060a060020a810463ffffffff169060c060020a900460ff1685565b60065481565b600054600160a060020a03163314610ed257600080fd5b600d5462010000900460ff168015610f185750600d5462278d00640100000000820463ffffffff9081166c01000000000000000000000000909304811692909201011642115b80610f4d5750600d546301000000900460ff168015610f4d5750600d5462278d0063ffffffff608060020a9092048216011642115b1515610f5857600080fd5b600154604051600160a060020a0390911690303180156108fc02916000818181858888f19350505050158015610f92573d6000803e3d6000fd5b50565b600d546000908190819062010000900460ff161515610fb357600080fd5b600160a060020a0384166000908152600560205260409020600d549092506301000000900460ff1615610ff2578154600160a060020a031692506110c8565b600a5460009081526008602052604090205460ff161561102257600a546000908152600183016020526040902054015b600b5460009081526008602052604090205460ff161561105257600b546000908152600183016020526040902054015b600c5460009081526008602052604090205460ff161561108257600c546000908152600183016020526040902054015b6110c3629896806110ab836110b76003546110ab6298968060065461180b90919063ffffffff16565b9063ffffffff61183616565b9063ffffffff61180b16565b830192505b5050919050565b600a54600090815260046020526040812080546001909101548291600781810b9291909103620186a002900b81151561110457fe5b6009805467ffffffffffffffff191667ffffffffffffffff93909205600790810b93909316919091179055600b54600090815260046020526040902080546001919091015481830b92919003620186a002900b81151561116057fe5b6009805492909105600790810b67ffffffffffffffff1668010000000000000000026fffffffffffffffff000000000000000019909316929092179055600c54600090815260046020526040902080546001919091015481830b92620186a09290910391909102900b8115156111d257fe5b6009805477ffffffffffffffff000000000000000000000000000000001916608060020a67ffffffffffffffff94909305600790810b9490941692909202919091179055600c54600090815260046020526040808220600290810154600b548452828420820154600a548552929093200154600160a060020a0392831691831690831601011660065554600163ffffffff909116116112c6576040805160208082526017908201527f4e6f7420656e6f756768207061727469636970616e74730000000000000000008183015290516000805160206118608339815191529181900360600190a16112c1610b3b565b6113e3565b6112e160646110ab600560065461180b90919063ffffffff16565b9150303182106112f057600080fd5b600654611303908363ffffffff61184d16565b600655600154604051600160a060020a039091169083156108fc029084906000818181858888f19350505050158015611340573d6000803e3d6000fd5b5050600281043031811061135357600080fd5b600654611366908263ffffffff61184d16565b600655600254604080517fd0febe4c0000000000000000000000000000000000000000000000000000000081529051600160a060020a039092169163d0febe4c918491600480830192600092919082900301818588803b1580156113c957600080fd5b505af11580156113dd573d6000803e3d6000fd5b50505050505b600954680100000000000000008104600790810b810b91810b900b131561152157600954608060020a8104600790810b810b91810b900b131561145e57600a80546000908152600860209081526040808320805460ff1916600117905592548252600490522060020154600160a060020a031660035561151c565b600954600781810b810b608060020a909204810b900b13156114b857600c80546000908152600860209081526040808320805460ff1916600117905592548252600490522060020154600160a060020a031660035561151c565b600a805460009081526008602090815260408083208054600160ff199182168117909255600c805486528386208054909216909217905554835260049091528082206002908101549354835291200154600160a060020a0391821690821601166003555b6117f6565b600954600781810b810b68010000000000000000909204810b900b131561167657600954608060020a8104600790810b810b68010000000000000000909204810b900b13156115a857600b80546000908152600860209081526040808320805460ff1916600117905592548252600490522060020154600160a060020a031660035561151c565b600954680100000000000000008104600790810b810b608060020a909204810b900b131561160e57600c80546000908152600860209081526040808320805460ff1916600117905592548252600490522060020154600160a060020a031660035561151c565b600b805460009081526008602090815260408083208054600160ff199182168117909255600c805486528386208054909216909217905554835260049091528082206002908101549354835291200154600160a060020a0391821690821601166003556117f6565b600954680100000000000000008104600790810b810b608060020a909204810b900b13156116dc57600c80546000908152600860209081526040808320805460ff1916600117905592548252600490522060020154600160a060020a03166003556117f6565b600954680100000000000000008104600790810b810b608060020a909204810b900b121561176c57600b805460009081526008602090815260408083208054600160ff199182168117909255600a805486528386208054909216909217905554835260049091528082206002908101549354835291200154600160a060020a0391821690821601166003556117f6565b600c805460009081526008602090815260408083208054600160ff199182168117909255600b805486528386208054831684179055600a8054875284872080549093169093179091559454845260049092528083206002908101549254845281842081015494548452922090910154600160a060020a039182169282169082160191909101166003555b5050600d805462ff0000191662010000179055565b6000828202831580611827575082848281151561182457fe5b04145b151561182f57fe5b9392505050565b600080828481151561184457fe5b04949350505050565b60008282111561185957fe5b5090039056009267bd1e840f8c032ec399dab88550ddacce435477212b384a3d761f395efa7fa165627a7a72305820e77d45ce6aa99d6d4a5bbc305898131a50902b0789baf26c30ca48bb6f9b9a220029

   Swarm Source:
bzzr://e77d45ce6aa99d6d4a5bbc305898131a50902b0789baf26c30ca48bb6f9b9a22

 

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.