Contract Overview
Balance: 29.3797020009402362 Ether
Transactions: 245 txns
 Latest 25 transactions from a total of 245 transactions

TxHash Age From To Value [TxFee]
0x96d7ff253787e93a9cb46055babe20d057cbef8ac816ac5a039ba081257fd29a30 days 3 hrs ago0x0cb254842a934336015853cb329bf7c56f907a09  IN   0x5e86cca975d21f89390880e81d240153f16effe110.2 Ether0.000029481
0x746daf46c1d23ff660c7785236e4cf1926931a6dfdc5882a353748c63b69fe8d30 days 7 hrs ago0x2107fde7eb3647957411cf4e1861ecb562dd18bf  IN   0x5e86cca975d21f89390880e81d240153f16effe10.15 Ether0.000068286
0x8c1acaaab8be6d24c53bcd080cdea1d7a5f1282643482e9bde0cf5a888e496ed30 days 7 hrs ago0x2107fde7eb3647957411cf4e1861ecb562dd18bf  IN   0x5e86cca975d21f89390880e81d240153f16effe10.1 Ether0.000068286
0xbb704d98adfb03e54ee05937fc11d513191dff670a55ab48111022919d410d5f30 days 22 hrs ago0x38948e45b3ff8845071a11640cb59feac1433a7b  IN   0x5e86cca975d21f89390880e81d240153f16effe10 Ether0.000067846
0x599c8514a5acb5ce84dd1ae6b695c3d9230809a19b85b12e0cff8d4c0ab8746e30 days 22 hrs ago0x787bee930a692bb2a32c68ed825c6bee0b586c3e  IN   0x5e86cca975d21f89390880e81d240153f16effe11 Ether0.000171548
0xd2bf4cf58656863b1a5afdc9b5a530003813c5acebb8b6a64e6f5a4a122e987330 days 22 hrs ago0x38948e45b3ff8845071a11640cb59feac1433a7b  IN   0x5e86cca975d21f89390880e81d240153f16effe10 Ether0.000067846
0x8b4c149378c0fb43258b5f654030b69a47dffa1f009f8adf46a1a33d426fb8da30 days 22 hrs ago0x787bee930a692bb2a32c68ed825c6bee0b586c3e  IN   0x5e86cca975d21f89390880e81d240153f16effe11 Ether0.000171548
0x8cce71b5c9363e5657ad51b84e51743f686d378024822c389eabbb4c93d27fec30 days 22 hrs ago0x38948e45b3ff8845071a11640cb59feac1433a7b  IN   0x5e86cca975d21f89390880e81d240153f16effe10 Ether0.000067846
0x76dfbbb8de5f38fce3b371a49fd8ca0d373f42c60cd99909fd33dff1ac69d14b30 days 22 hrs ago0x787bee930a692bb2a32c68ed825c6bee0b586c3e  IN   0x5e86cca975d21f89390880e81d240153f16effe11 Ether0.00017142
0x75dbd5ac2e53e9a2ead5f8da2ef72bd1cba34da1ecf53ac5744d33c1345a55e730 days 22 hrs ago0x38948e45b3ff8845071a11640cb59feac1433a7b  IN   0x5e86cca975d21f89390880e81d240153f16effe10 Ether0.000067846
0xba128785d93519b9d2418a6ffa3b437b7b170fee658550c3039db1c2d5424e6b30 days 22 hrs ago0x787bee930a692bb2a32c68ed825c6bee0b586c3e  IN   0x5e86cca975d21f89390880e81d240153f16effe11 Ether0.000171548
0x286e91c122219542de075be2fb615e3988222f00643c144b9be48e26dfab637730 days 23 hrs ago0x38948e45b3ff8845071a11640cb59feac1433a7b  IN   0x5e86cca975d21f89390880e81d240153f16effe10 Ether0.000033923
0xd3cd2d35b909d72d751ca72a346bccef01422ee44b01165f9bd82cf08018ba4b30 days 23 hrs ago0x2107fde7eb3647957411cf4e1861ecb562dd18bf  IN   0x5e86cca975d21f89390880e81d240153f16effe10.1 Ether0.000085774
0x6c69b90283dc3ecba2e8680394bb58259e1d38705a3ed2318f42ffe9bbf656c830 days 23 hrs ago0x38948e45b3ff8845071a11640cb59feac1433a7b  IN   0x5e86cca975d21f89390880e81d240153f16effe10 Ether0.000033899
0x3e7e43a76773c1696dfc1b3757950a0be3880e21e64b5587cceecc63808a148330 days 23 hrs ago0x2107fde7eb3647957411cf4e1861ecb562dd18bf  IN   0x5e86cca975d21f89390880e81d240153f16effe10.1 Ether0.000085454
0x5fde8dc7fbf0ab73d8d02e2360d3d8b77185ac972731b0f073e72db6d3f34d5e30 days 23 hrs ago0x38948e45b3ff8845071a11640cb59feac1433a7b  IN   0x5e86cca975d21f89390880e81d240153f16effe10 Ether0.000033795
0x214486bc62bf16586fb523154d873c5ec4d50e0f09315ea39b0e324c03a9d46a30 days 23 hrs ago0x2107fde7eb3647957411cf4e1861ecb562dd18bf  IN   0x5e86cca975d21f89390880e81d240153f16effe10.1 Ether0.000085774
0xc5833b66d782659d431370e8c90039da7126672da66580f2d445dc6a46fffe5f30 days 23 hrs ago0x38948e45b3ff8845071a11640cb59feac1433a7b  IN   0x5e86cca975d21f89390880e81d240153f16effe10 Ether0.000033899
0x68eddc97282050ecc3bc03d58a8ac266c3e06fac4905a2a90051ef32511d457430 days 23 hrs ago0x2107fde7eb3647957411cf4e1861ecb562dd18bf  IN   0x5e86cca975d21f89390880e81d240153f16effe10.1 Ether0.000085518
0x0c0c42d82faa35bfd6e6526574c7cafe3acbecd5ecacb44023a06ecd5876dd8430 days 23 hrs ago0x38948e45b3ff8845071a11640cb59feac1433a7b  IN   0x5e86cca975d21f89390880e81d240153f16effe10 Ether0.000033849
0x4351049ccfef7ca1a67d3b28ecb15ff6c999f4b9aa4bed1cdc743fe5e411607530 days 23 hrs ago0x2107fde7eb3647957411cf4e1861ecb562dd18bf  IN   0x5e86cca975d21f89390880e81d240153f16effe10.1 Ether0.00008571
0x69a924645af97a3607d4e450a266314d9f164ec4efc5a6aaf9d0f546e1d4439330 days 23 hrs ago0x38948e45b3ff8845071a11640cb59feac1433a7b  IN   0x5e86cca975d21f89390880e81d240153f16effe10 Ether0.000033809
0x53fe580ca14951a8298bd9d4f9891c9bea3e445e31eb13e6f8575a9e9b59d34c30 days 23 hrs ago0x2107fde7eb3647957411cf4e1861ecb562dd18bf  IN   0x5e86cca975d21f89390880e81d240153f16effe10.1 Ether0.000085518
0xc28270ea5346fd347ec6b61f657c067a436535d4b772941a819b1a2e9812808830 days 23 hrs ago0x38948e45b3ff8845071a11640cb59feac1433a7b  IN   0x5e86cca975d21f89390880e81d240153f16effe10 Ether0.000033899
0x07b7be5f6da3b4543368863ab50016f3078fed72ac6b0bb8099cc33f7a73daf430 days 23 hrs ago0x2107fde7eb3647957411cf4e1861ecb562dd18bf  IN   0x5e86cca975d21f89390880e81d240153f16effe10.1 Ether0.000085454
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
 Latest 25 Internal Txns, Click here To View More View All
ParentTxHash Block Age From To Value
0xbb704d98adfb03e54ee05937fc11d513191dff670a55ab48111022919d410d5f487419630 days 22 hrs ago0x5e86cca975d21f89390880e81d240153f16effe10x787bee930a692bb2a32c68ed825c6bee0b586c3e1.1868 Ether
0xd2bf4cf58656863b1a5afdc9b5a530003813c5acebb8b6a64e6f5a4a122e9873487418230 days 22 hrs ago0x5e86cca975d21f89390880e81d240153f16effe10x787bee930a692bb2a32c68ed825c6bee0b586c3e1.1868 Ether
0x8cce71b5c9363e5657ad51b84e51743f686d378024822c389eabbb4c93d27fec487414830 days 22 hrs ago0x5e86cca975d21f89390880e81d240153f16effe10x787bee930a692bb2a32c68ed825c6bee0b586c3e1.1868 Ether
0x75dbd5ac2e53e9a2ead5f8da2ef72bd1cba34da1ecf53ac5744d33c1345a55e7487411430 days 22 hrs ago0x5e86cca975d21f89390880e81d240153f16effe10x787bee930a692bb2a32c68ed825c6bee0b586c3e1.1868 Ether
0x286e91c122219542de075be2fb615e3988222f00643c144b9be48e26dfab6377487402530 days 23 hrs ago0x5e86cca975d21f89390880e81d240153f16effe10x2107fde7eb3647957411cf4e1861ecb562dd18bf0.196 Ether
0x6c69b90283dc3ecba2e8680394bb58259e1d38705a3ed2318f42ffe9bbf656c8487396030 days 23 hrs ago0x5e86cca975d21f89390880e81d240153f16effe10x2107fde7eb3647957411cf4e1861ecb562dd18bf1 wei
0x5fde8dc7fbf0ab73d8d02e2360d3d8b77185ac972731b0f073e72db6d3f34d5e487393730 days 23 hrs ago0x5e86cca975d21f89390880e81d240153f16effe10x2107fde7eb3647957411cf4e1861ecb562dd18bf0.196 Ether
0xc5833b66d782659d431370e8c90039da7126672da66580f2d445dc6a46fffe5f487392630 days 23 hrs ago0x5e86cca975d21f89390880e81d240153f16effe10x2107fde7eb3647957411cf4e1861ecb562dd18bf1 wei
0x0c0c42d82faa35bfd6e6526574c7cafe3acbecd5ecacb44023a06ecd5876dd84487390830 days 23 hrs ago0x5e86cca975d21f89390880e81d240153f16effe10x2107fde7eb3647957411cf4e1861ecb562dd18bf1 wei
0x69a924645af97a3607d4e450a266314d9f164ec4efc5a6aaf9d0f546e1d44393487389330 days 23 hrs ago0x5e86cca975d21f89390880e81d240153f16effe10x2107fde7eb3647957411cf4e1861ecb562dd18bf0.196 Ether
0xc28270ea5346fd347ec6b61f657c067a436535d4b772941a819b1a2e98128088487387330 days 23 hrs ago0x5e86cca975d21f89390880e81d240153f16effe10x2107fde7eb3647957411cf4e1861ecb562dd18bf1 wei
0xc3cf4d9b48ee4fa45865bda7bc5729e11efd74d00fa5ee418732efb7c19fe336487384930 days 23 hrs ago0x5e86cca975d21f89390880e81d240153f16effe10x2107fde7eb3647957411cf4e1861ecb562dd18bf0.196 Ether
0xbddfa3961c57904dce9ddab94d1a87848e474532c92e2c590b7125a349cb5ade487382430 days 23 hrs ago0x5e86cca975d21f89390880e81d240153f16effe10x2107fde7eb3647957411cf4e1861ecb562dd18bf0.196 Ether
0xc25aa82fb03810afde3304963e83dcd57dd227bc1ce673702638246af157ca14487381330 days 23 hrs ago0x5e86cca975d21f89390880e81d240153f16effe10x2107fde7eb3647957411cf4e1861ecb562dd18bf0.196 Ether
0xaddb021172529029352bbba117fbc305a5d377906ac5050827cb2c1308644336487380330 days 23 hrs ago0x5e86cca975d21f89390880e81d240153f16effe10x2107fde7eb3647957411cf4e1861ecb562dd18bf0.160363636363636363 Ether
0xb8f3fa595b18ab119820ed6f0ec134f58dbabe764dc47bfa8db3fe4b06a320f5487379530 days 23 hrs ago0x5e86cca975d21f89390880e81d240153f16effe10x2107fde7eb3647957411cf4e1861ecb562dd18bf0.196 Ether
0x2ee90d0db751fdfd8179079e6337f0acae5c7a653b0477dd02508bceb653a1c7487378230 days 23 hrs ago0x5e86cca975d21f89390880e81d240153f16effe10x2107fde7eb3647957411cf4e1861ecb562dd18bf0.196 Ether
0xc5d57a673abbb0793afef59ecdc20bf4e96b3be490cd8345d97c3bc0021c4e39487376430 days 23 hrs ago0x5e86cca975d21f89390880e81d240153f16effe10x2107fde7eb3647957411cf4e1861ecb562dd18bf1 wei
0x51d1295aa3c1a19e02ab076c34d3025b4c2b77cc5a71dbfac7daa1a816b3342c487374031 days 2 mins ago0x5e86cca975d21f89390880e81d240153f16effe10x2107fde7eb3647957411cf4e1861ecb562dd18bf0.196 Ether
0xd091a2a33fd8d5330272f5b5c7f5efccab7813bd8d3bec7ade11265aaef11f76487370231 days 9 mins ago0x5e86cca975d21f89390880e81d240153f16effe10x2107fde7eb3647957411cf4e1861ecb562dd18bf0.196 Ether
0xf037bc974a37219c7449b5ae178b965de6974eaf40cf4063f36f8c74b78bed10487368131 days 12 mins ago0x5e86cca975d21f89390880e81d240153f16effe10x2107fde7eb3647957411cf4e1861ecb562dd18bf1 wei
0xafdea240cef1433d31cf61cf93fbb84cfbb9e7143b5a106d7df142731995b78c487356231 days 36 mins ago0x5e86cca975d21f89390880e81d240153f16effe10x2107fde7eb3647957411cf4e1861ecb562dd18bf1 wei
0x1a3e2a139874386c636a31c286e74ae68185cf5b248e31a89d418b516fd1118a487353731 days 39 mins ago0x5e86cca975d21f89390880e81d240153f16effe10x2107fde7eb3647957411cf4e1861ecb562dd18bf0.2158 Ether
0x952fb909c9708ce409a27765c15e8dfaed2cd8907980933fb646d6d19a667ec4487352531 days 42 mins ago0x5e86cca975d21f89390880e81d240153f16effe10x2107fde7eb3647957411cf4e1861ecb562dd18bf0.196 Ether
0x8d3d9dd7f79b0a1cb0de3cc451fd9ea489e85d75b3ebcd1af166d793f5dfbbb8487349731 days 46 mins ago0x5e86cca975d21f89390880e81d240153f16effe10x2107fde7eb3647957411cf4e1861ecb562dd18bf0.1584 Ether
[ Download CSV Export  ] 
Contract Source Code Verified (Exact Match)
Contract Name: MDTD1
Compiler Version: v0.5.2+commit.1df8f40c
Optimization Enabled: No
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts

pragma solidity ^0.5.2;

// * Uses hybrid commit-reveal + block hash random number generation that is immune
//   to tampering by players, house and miners. Apart from being fully transparent,
//   this also allows arbitrarily high bets.
//
// * Refer to https://tomodice.com/whitepaper.pdf for detailed description and proofs.
contract MDTD1 {
    /// *** Constants section

    // Each bet is deducted 1% in favour of the house, but no less than some minimum.
    // The lower bound is dictated by gas costs of the settleBet transaction, providing headroom for up to 10 Gwei prices.
    uint constant HOUSE_EDGE_PERCENT = 1;
    uint constant HOUSE_EDGE_MINIMUM_AMOUNT = 0.0003 ether;

    // Bets lower than this amount do not participate in jackpot rolls (and are not deducted JACKPOT_FEE).
    uint constant MIN_JACKPOT_BET = 0.1 ether;

    // Chance to win jackpot (currently 0.1%) and fee deducted into jackpot fund.
    uint constant JACKPOT_MODULO = 1000;
    uint constant JACKPOT_FEE = 0.001 ether;

    // There is minimum and maximum bets.
    uint constant MIN_BET = 0.01 ether;
    uint constant MAX_AMOUNT = 10000 ether;

    // Modulo is a number of equiprobable outcomes in a game:
    //  - 2 for coin flip
    //  - 6 for dice
    //  - 6*6 = 36 for double dice
    //  - 100 for etheroll
    //  - 37 for roulette
    //  etc.
    // It's called so because 256-bit entropy is treated like a huge integer and
    // the remainder of its division by modulo is considered bet outcome.
    uint constant MAX_MODULO = 100;

    // For modulos below this threshold rolls are checked against a bit mask,
    // thus allowing betting on any combination of outcomes. For example, given
    // modulo 6 for dice, 101000 mask (base-2, big endian) means betting on
    // 4 and 6; for games with modulos higher than threshold (Etheroll), a simple
    // limit is used, allowing betting on any outcome in [0, N) range.
    //
    // The specific value is dictated by the fact that 256-bit intermediate
    // multiplication result allows implementing population count efficiently
    // for numbers that are up to 42 bits, and 40 is the highest multiple of
    // eight below 42.
    uint constant MAX_MASK_MODULO = 40;

    // This is a check on bet mask overflow.
    uint constant MAX_BET_MASK = 2 ** MAX_MASK_MODULO;

    // EVM BLOCKHASH opcode can query no further than 256 blocks into the
    // past. Given that settleBet uses block hash of placeBet as one of
    // complementary entropy sources, we cannot process bets older than this
    // threshold. On rare occasions tomodice.com croupier may fail to invoke
    // settleBet in this timespan due to technical issues or extreme Ethereum
    // congestion; such bets can be refunded via invoking refundBet.
    uint constant BET_EXPIRATION_BLOCKS = 250;

    // Some deliberately invalid address to initialize the secret signer with.
    // Forces maintainers to invoke setSecretSigner before processing any bets.
    address constant DUMMY_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;

    // Standard contract ownership transfer.
    address payable public owner;
    address payable private nextOwner;

    // Adjustable max bet profit. Used to cap bets against dynamic odds.
    uint public maxProfit;

    // The address corresponding to a private key used to sign placeBet commits.
    address public secretSigner;

    // Accumulated jackpot fund.
    uint128 public jackpotSize;

    // Funds that are locked in potentially winning bets. Prevents contract from
    // committing to bets it cannot pay out.
    uint128 public lockedInBets;

    // A structure representing a single bet.
    struct Bet {
        // Wager amount in wei.
        uint amount;
        // Modulo of a game.
        uint8 modulo;
        // Number of winning outcomes, used to compute winning payment (* modulo/rollUnder),
        // and used instead of mask for games with modulo > MAX_MASK_MODULO.
        uint8 rollUnder;
        // Block number of placeBet tx.
        uint40 placeBlockNumber;
        // Bit mask representing winning bet outcomes (see MAX_MASK_MODULO comment).
        uint40 mask;
        // Address of a gambler, used to pay out winning bets.
        address payable gambler;
    }

    // Mapping from commits to all currently active & processed bets.
    mapping (uint => Bet) bets;

    // Croupier account.
    address public croupier;

    // Events that are issued to make statistic recovery easier.
    event FailedPayment(address indexed beneficiary, uint amount);
    event Payment(address indexed beneficiary, uint amount);
    event JackpotPayment(address indexed beneficiary, uint amount);

    // This event is emitted in placeBet to record commit in the logs.
    event Commit(uint commit);

    // Constructor. Deliberately does not take any parameters.
    constructor () public {
        owner = msg.sender;
        secretSigner = DUMMY_ADDRESS;
        croupier = DUMMY_ADDRESS;
    }

    // Standard modifier on methods invokable only by contract owner.
    modifier onlyOwner {
        require (msg.sender == owner, "OnlyOwner methods called by non-owner.");
        _;
    }

    // Standard modifier on methods invokable only by contract owner.
    modifier onlyCroupier {
        require (msg.sender == croupier, "OnlyCroupier methods called by non-croupier.");
        _;
    }

    // Standard contract ownership transfer implementation,
    function approveNextOwner(address payable _nextOwner) external onlyOwner {
        require (_nextOwner != owner, "Cannot approve current owner.");
        nextOwner = _nextOwner;
    }

    function acceptNextOwner() external {
        require (msg.sender == nextOwner, "Can only accept preapproved new owner.");
        owner = nextOwner;
    }

    // Fallback function deliberately left empty. It's primary use case
    // is to top up the bank roll.
    function () external payable {
    }

    // See comment for "secretSigner" variable.
    function setSecretSigner(address newSecretSigner) external onlyOwner {
        secretSigner = newSecretSigner;
    }

    // Change the croupier address.
    function setCroupier(address newCroupier) external onlyOwner {
        croupier = newCroupier;
    }

    // Change max bet reward. Setting this to zero effectively disables betting.
    function setMaxProfit(uint _maxProfit) public onlyOwner {
        require (_maxProfit < MAX_AMOUNT, "maxProfit should be a sane number.");
        maxProfit = _maxProfit;
    }

    // This function is used to bump up the jackpot fund. Cannot be used to lower it.
    function increaseJackpot(uint increaseAmount) external onlyOwner {
        require (increaseAmount <= address(this).balance, "Increase amount larger than balance.");
        require (jackpotSize + lockedInBets + increaseAmount <= address(this).balance, "Not enough funds.");
        jackpotSize += uint128(increaseAmount);
    }

    // Funds withdrawal to cover costs of tomodice.com operation.
    function withdrawFunds(address payable beneficiary, uint withdrawAmount) external onlyOwner {
        require (withdrawAmount <= address(this).balance, "Increase amount larger than balance.");
        require (jackpotSize + lockedInBets + withdrawAmount <= address(this).balance, "Not enough funds.");
        sendFunds(beneficiary, withdrawAmount, withdrawAmount);
    }

    // Contract may be destroyed only when there are no ongoing bets,
    // either settled or refunded. All funds are transferred to contract owner.
    function kill() external onlyOwner {
        require (lockedInBets == 0, "All bets should be processed (settled or refunded) before self-destruct.");
        selfdestruct(owner);
    }

    /// *** Betting logic

    // Bet states:
    //  amount == 0 && gambler == 0 - 'clean' (can place a bet)
    //  amount != 0 && gambler != 0 - 'active' (can be settled or refunded)
    //  amount == 0 && gambler != 0 - 'processed' (can clean storage)
    //
    //  NOTE: Storage cleaning is not implemented in this contract version; it will be added
    //        with the next upgrade to prevent polluting Ethereum state with expired bets.

    // Bet placing transaction - issued by the player.
    //  betMask         - bet outcomes bit mask for modulo <= MAX_MASK_MODULO,
    //                    [0, betMask) for larger modulos.
    //  modulo          - game modulo.
    //  commitLastBlock - number of the maximum block where "commit" is still considered valid.
    //  commit          - Keccak256 hash of some secret "reveal" random number, to be supplied
    //                    by the tomodice.com croupier bot in the settleBet transaction. Supplying
    //                    "commit" ensures that "reveal" cannot be changed behind the scenes
    //                    after placeBet have been mined.
    //  r, s            - components of ECDSA signature of (commitLastBlock, commit). v is
    //                    guaranteed to always equal 27.
    //
    // Commit, being essentially random 256-bit number, is used as a unique bet identifier in
    // the 'bets' mapping.
    //
    // Commits are signed with a block limit to ensure that they are used at most once - otherwise
    // it would be possible for a miner to place a bet with a known commit/reveal pair and tamper
    // with the blockhash. Croupier guarantees that commitLastBlock will always be not greater than
    // placeBet block number plus BET_EXPIRATION_BLOCKS. See whitepaper for details.
    function placeBet(uint betMask, uint modulo, uint commitLastBlock, uint commit, bytes32 r, bytes32 s) external payable {
        // Check that the bet is in 'clean' state.
        Bet storage bet = bets[commit];
        require (bet.gambler == address(0), "Bet should be in a 'clean' state.");

        // Validate input data ranges.
        uint amount = msg.value;
        require (modulo > 1 && modulo <= MAX_MODULO, "Modulo should be within range.");
        require (amount >= MIN_BET && amount <= MAX_AMOUNT, "Amount should be within range.");
        require (betMask > 0 && betMask < MAX_BET_MASK, "Mask should be within range.");

        // Check that commit is valid - it has not expired and its signature is valid.
        require (block.number <= commitLastBlock, "Commit has expired.");
        bytes32 signatureHash = keccak256(abi.encodePacked(uint40(commitLastBlock), commit));
        require (secretSigner == ecrecover(signatureHash, 27, r, s), "ECDSA signature is not valid.");

        uint rollUnder;
        uint mask;

        if (modulo <= MAX_MASK_MODULO) {
            // Small modulo games specify bet outcomes via bit mask.
            // rollUnder is a number of 1 bits in this mask (population count).
            // This magic looking formula is an efficient way to compute population
            // count on EVM for numbers below 2**40. For detailed proof consult
            // the tomodice.com whitepaper.
            rollUnder = ((betMask * POPCNT_MULT) & POPCNT_MASK) % POPCNT_MODULO;
            mask = betMask;
        } else {
            // Larger modulos specify the right edge of half-open interval of
            // winning bet outcomes.
            require (betMask > 0 && betMask <= modulo, "High modulo range, betMask larger than modulo.");
            rollUnder = betMask;
        }

        // Winning amount and jackpot increase.
        uint possibleWinAmount;
        uint jackpotFee;

        (possibleWinAmount, jackpotFee) = getDiceWinAmount(amount, modulo, rollUnder);

        // Enforce max profit limit.
        require (possibleWinAmount <= amount + maxProfit, "maxProfit limit violation.");

        // Lock funds.
        lockedInBets += uint128(possibleWinAmount);
        jackpotSize += uint128(jackpotFee);

        // Check whether contract has enough funds to process this bet.
        require (jackpotSize + lockedInBets <= address(this).balance, "Cannot afford to lose this bet.");

        // Record commit in logs.
        emit Commit(commit);

        // Store bet parameters on blockchain.
        bet.amount = amount;
        bet.modulo = uint8(modulo);
        bet.rollUnder = uint8(rollUnder);
        bet.placeBlockNumber = uint40(block.number);
        bet.mask = uint40(mask);
        bet.gambler = msg.sender;
    }

    // This is the method used to settle 99% of bets. To process a bet with a specific
    // "commit", settleBet should supply a "reveal" number that would Keccak256-hash to
    // "commit". "blockHash" is the block hash of placeBet block as seen by croupier; it
    // is additionally asserted to prevent changing the bet outcomes on Ethereum reorgs.
    function settleBet(uint reveal, bytes32 blockHash) external onlyCroupier {
        uint commit = uint(keccak256(abi.encodePacked(reveal)));

        Bet storage bet = bets[commit];
        uint placeBlockNumber = bet.placeBlockNumber;

        // Check that bet has not expired yet (see comment to BET_EXPIRATION_BLOCKS).
        require (block.number > placeBlockNumber, "settleBet in the same block as placeBet, or before.");
        require (block.number <= placeBlockNumber + BET_EXPIRATION_BLOCKS, "Blockhash can't be queried by EVM.");
        require (blockhash(placeBlockNumber) == blockHash);

        // Settle bet using reveal and blockHash as entropy sources.
        settleBetCommon(bet, reveal, blockHash);
    }

    // This method is used to settle a bet that was mined into an uncle block. At this
    // point the player was shown some bet outcome, but the blockhash at placeBet height
    // is different because of Ethereum chain reorg. We supply a full merkle proof of the
    // placeBet transaction receipt to provide untamperable evidence that uncle block hash
    // indeed was present on-chain at some point.
    function settleBetUncleMerkleProof(uint reveal, uint40 canonicalBlockNumber) external onlyCroupier {
        // "commit" for bet settlement can only be obtained by hashing a "reveal".
        uint commit = uint(keccak256(abi.encodePacked(reveal)));

        Bet storage bet = bets[commit];

        // Check that canonical block hash can still be verified.
        require (block.number <= canonicalBlockNumber + BET_EXPIRATION_BLOCKS, "Blockhash can't be queried by EVM.");

        // Verify placeBet receipt.
        requireCorrectReceipt(4 + 32 + 32 + 4);

        // Reconstruct canonical & uncle block hashes from a receipt merkle proof, verify them.
        bytes32 canonicalHash;
        bytes32 uncleHash;
        (canonicalHash, uncleHash) = verifyMerkleProof(commit, 4 + 32 + 32);
        require (blockhash(canonicalBlockNumber) == canonicalHash);

        // Settle bet using reveal and uncleHash as entropy sources.
        settleBetCommon(bet, reveal, uncleHash);
    }

    // Common settlement code for settleBet & settleBetUncleMerkleProof.
    function settleBetCommon(Bet storage bet, uint reveal, bytes32 entropyBlockHash) private {
        // Fetch bet parameters into local variables (to save gas).
        uint amount = bet.amount;
        uint modulo = bet.modulo;
        uint rollUnder = bet.rollUnder;
        address payable gambler = bet.gambler;

        // Check that bet is in 'active' state.
        require (amount != 0, "Bet should be in an 'active' state");

        // Move bet into 'processed' state already.
        bet.amount = 0;

        // The RNG - combine "reveal" and blockhash of placeBet using Keccak256. Miners
        // are not aware of "reveal" and cannot deduce it from "commit" (as Keccak256
        // preimage is intractable), and house is unable to alter the "reveal" after
        // placeBet have been mined (as Keccak256 collision finding is also intractable).
        bytes32 entropy = keccak256(abi.encodePacked(reveal, entropyBlockHash));

        // Do a roll by taking a modulo of entropy. Compute winning amount.
        uint dice = uint(entropy) % modulo;

        uint diceWinAmount;
        uint _jackpotFee;
        (diceWinAmount, _jackpotFee) = getDiceWinAmount(amount, modulo, rollUnder);

        uint diceWin = 0;
        uint jackpotWin = 0;

        // Determine dice outcome.
        if (modulo <= MAX_MASK_MODULO) {
            // For small modulo games, check the outcome against a bit mask.
            if ((2 ** dice) & bet.mask != 0) {
                diceWin = diceWinAmount;
            }

        } else {
            // For larger modulos, check inclusion into half-open interval.
            if (dice < rollUnder) {
                diceWin = diceWinAmount;
            }

        }

        // Unlock the bet amount, regardless of the outcome.
        lockedInBets -= uint128(diceWinAmount);

        // Roll for a jackpot (if eligible).
        if (amount >= MIN_JACKPOT_BET) {
            // The second modulo, statistically independent from the "main" dice roll.
            // Effectively you are playing two games at once!
            uint jackpotRng = (uint(entropy) / modulo) % JACKPOT_MODULO;

            // Bingo!
            if (jackpotRng == 0) {
                jackpotWin = jackpotSize;
                jackpotSize = 0;
            }
        }

        // Log jackpot win.
        if (jackpotWin > 0) {
            emit JackpotPayment(gambler, jackpotWin);
        }

        // Send the funds to gambler.
        sendFunds(gambler, diceWin + jackpotWin == 0 ? 1 wei : diceWin + jackpotWin, diceWin);
    }

    // Refund transaction - return the bet amount of a roll that was not processed in a
    // due timeframe. Processing such blocks is not possible due to EVM limitations (see
    // BET_EXPIRATION_BLOCKS comment above for details). In case you ever find yourself
    // in a situation like this, just contact the tomodice.com support, however nothing
    // precludes you from invoking this method yourself.
    function refundBet(uint commit) external {
        // Check that bet is in 'active' state.
        Bet storage bet = bets[commit];
        uint amount = bet.amount;

        require (amount != 0, "Bet should be in an 'active' state");

        // Check that bet has already expired.
        require (block.number > bet.placeBlockNumber + BET_EXPIRATION_BLOCKS, "Blockhash can't be queried by EVM.");

        // Move bet into 'processed' state, release funds.
        bet.amount = 0;

        uint diceWinAmount;
        uint jackpotFee;
        (diceWinAmount, jackpotFee) = getDiceWinAmount(amount, bet.modulo, bet.rollUnder);

        lockedInBets -= uint128(diceWinAmount);
        jackpotSize -= uint128(jackpotFee);

        // Send the refund.
        sendFunds(bet.gambler, amount, amount);
    }

    // Get the expected win amount after house edge is subtracted.
    function getDiceWinAmount(uint amount, uint modulo, uint rollUnder) private pure returns (uint winAmount, uint jackpotFee) {
        require (0 < rollUnder && rollUnder <= modulo, "Win probability out of range.");

        jackpotFee = amount >= MIN_JACKPOT_BET ? JACKPOT_FEE : 0;

        uint houseEdge = amount * HOUSE_EDGE_PERCENT / 100;

        if (houseEdge < HOUSE_EDGE_MINIMUM_AMOUNT) {
            houseEdge = HOUSE_EDGE_MINIMUM_AMOUNT;
        }

        require (houseEdge + jackpotFee <= amount, "Bet doesn't even cover house edge.");
        winAmount = (amount - houseEdge - jackpotFee) * modulo / rollUnder;
    }

    // Helper routine to process the payment.
    function sendFunds(address payable beneficiary, uint amount, uint successLogAmount) private {
        if (beneficiary.send(amount)) {
            emit Payment(beneficiary, successLogAmount);
        } else {
            emit FailedPayment(beneficiary, amount);
        }
    }

    // This are some constants making O(1) population count in placeBet possible.
    // See whitepaper for intuition and proofs behind it.
    uint constant POPCNT_MULT = 0x0000000000002000000000100000000008000000000400000000020000000001;
    uint constant POPCNT_MASK = 0x0001041041041041041041041041041041041041041041041041041041041041;
    uint constant POPCNT_MODULO = 0x3F;

    // *** Merkle proofs.

    // This helpers are used to verify cryptographic proofs of placeBet inclusion into
    // uncle blocks. They are used to prevent bet outcome changing on Ethereum reorgs without
    // compromising the security of the smart contract. Proof data is appended to the input data
    // in a simple prefix length format and does not adhere to the ABI.
    // Invariants checked:
    //  - receipt trie entry contains a (1) successful transaction (2) directed at this smart
    //    contract (3) containing commit as a payload.
    //  - receipt trie entry is a part of a valid merkle proof of a block header
    //  - the block header is a part of uncle list of some block on canonical chain
    // The implementation is optimized for gas cost and relies on the specifics of Ethereum internal data structures.
    // Read the whitepaper for details.

    // Helper to verify a full merkle proof starting from some seedHash (usually commit). "offset" is the location of the proof
    // beginning in the calldata.
    function verifyMerkleProof(uint seedHash, uint offset) pure private returns (bytes32 blockHash, bytes32 uncleHash) {
        // (Safe) assumption - nobody will write into RAM during this method invocation.
        uint scratchBuf1;  assembly { scratchBuf1 := mload(0x40) }

        uint uncleHeaderLength; uint blobLength; uint shift; uint hashSlot;

        // Verify merkle proofs up to uncle block header. Calldata layout is:
        //  - 2 byte big-endian slice length
        //  - 2 byte big-endian offset to the beginning of previous slice hash within the current slice (should be zeroed)
        //  - followed by the current slice verbatim
        for (;; offset += blobLength) {
            assembly { blobLength := and(calldataload(sub(offset, 30)), 0xffff) }
            if (blobLength == 0) {
                // Zero slice length marks the end of uncle proof.
                break;
            }

            assembly { shift := and(calldataload(sub(offset, 28)), 0xffff) }
            require (shift + 32 <= blobLength, "Shift bounds check.");

            offset += 4;
            assembly { hashSlot := calldataload(add(offset, shift)) }
            require (hashSlot == 0, "Non-empty hash slot.");

            assembly {
                calldatacopy(scratchBuf1, offset, blobLength)
                mstore(add(scratchBuf1, shift), seedHash)
                seedHash := keccak256(scratchBuf1, blobLength)
                uncleHeaderLength := blobLength
            }
        }

        // At this moment the uncle hash is known.
        uncleHash = bytes32(seedHash);

        // Construct the uncle list of a canonical block.
        uint scratchBuf2 = scratchBuf1 + uncleHeaderLength;
        uint unclesLength; assembly { unclesLength := and(calldataload(sub(offset, 28)), 0xffff) }
        uint unclesShift;  assembly { unclesShift := and(calldataload(sub(offset, 26)), 0xffff) }
        require (unclesShift + uncleHeaderLength <= unclesLength, "Shift bounds check.");

        offset += 6;
        assembly { calldatacopy(scratchBuf2, offset, unclesLength) }
        memcpy(scratchBuf2 + unclesShift, scratchBuf1, uncleHeaderLength);

        assembly { seedHash := keccak256(scratchBuf2, unclesLength) }

        offset += unclesLength;

        // Verify the canonical block header using the computed sha3Uncles.
        assembly {
            blobLength := and(calldataload(sub(offset, 30)), 0xffff)
            shift := and(calldataload(sub(offset, 28)), 0xffff)
        }
        require (shift + 32 <= blobLength, "Shift bounds check.");

        offset += 4;
        assembly { hashSlot := calldataload(add(offset, shift)) }
        require (hashSlot == 0, "Non-empty hash slot.");

        assembly {
            calldatacopy(scratchBuf1, offset, blobLength)
            mstore(add(scratchBuf1, shift), seedHash)
            // At this moment the canonical block hash is known.
            blockHash := keccak256(scratchBuf1, blobLength)
        }
    }

    // Helper to check the placeBet receipt. "offset" is the location of the proof beginning in the calldata.
    // RLP layout: [triePath, str([status, cumGasUsed, bloomFilter, [[address, [topics], data]])]
    function requireCorrectReceipt(uint offset) view private {
        uint leafHeaderByte; assembly { leafHeaderByte := byte(0, calldataload(offset)) }

        require (leafHeaderByte >= 0xf7, "Receipt leaf longer than 55 bytes.");
        offset += leafHeaderByte - 0xf6;

        uint pathHeaderByte; assembly { pathHeaderByte := byte(0, calldataload(offset)) }

        if (pathHeaderByte <= 0x7f) {
            offset += 1;

        } else {
            require (pathHeaderByte >= 0x80 && pathHeaderByte <= 0xb7, "Path is an RLP string.");
            offset += pathHeaderByte - 0x7f;
        }

        uint receiptStringHeaderByte; assembly { receiptStringHeaderByte := byte(0, calldataload(offset)) }
        require (receiptStringHeaderByte == 0xb9, "Receipt string is always at least 256 bytes long, but less than 64k.");
        offset += 3;

        uint receiptHeaderByte; assembly { receiptHeaderByte := byte(0, calldataload(offset)) }
        require (receiptHeaderByte == 0xf9, "Receipt is always at least 256 bytes long, but less than 64k.");
        offset += 3;

        uint statusByte; assembly { statusByte := byte(0, calldataload(offset)) }
        require (statusByte == 0x1, "Status should be success.");
        offset += 1;

        uint cumGasHeaderByte; assembly { cumGasHeaderByte := byte(0, calldataload(offset)) }
        if (cumGasHeaderByte <= 0x7f) {
            offset += 1;

        } else {
            require (cumGasHeaderByte >= 0x80 && cumGasHeaderByte <= 0xb7, "Cumulative gas is an RLP string.");
            offset += cumGasHeaderByte - 0x7f;
        }

        uint bloomHeaderByte; assembly { bloomHeaderByte := byte(0, calldataload(offset)) }
        require (bloomHeaderByte == 0xb9, "Bloom filter is always 256 bytes long.");
        offset += 256 + 3;

        uint logsListHeaderByte; assembly { logsListHeaderByte := byte(0, calldataload(offset)) }
        require (logsListHeaderByte == 0xf8, "Logs list is less than 256 bytes long.");
        offset += 2;

        uint logEntryHeaderByte; assembly { logEntryHeaderByte := byte(0, calldataload(offset)) }
        require (logEntryHeaderByte == 0xf8, "Log entry is less than 256 bytes long.");
        offset += 2;

        uint addressHeaderByte; assembly { addressHeaderByte := byte(0, calldataload(offset)) }
        require (addressHeaderByte == 0x94, "Address is 20 bytes long.");

        uint logAddress; assembly { logAddress := and(calldataload(sub(offset, 11)), 0xffffffffffffffffffffffffffffffffffffffff) }
        require (logAddress == uint(address(this)));
    }

    // Memory copy.
    function memcpy(uint dest, uint src, uint len) pure private {
        // Full 32 byte words
        for(; len >= 32; len -= 32) {
            assembly { mstore(dest, mload(src)) }
            dest += 32; src += 32;
        }

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

    Contract ABI  
[{"constant":false,"inputs":[],"name":"kill","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"secretSigner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"jackpotSize","outputs":[{"name":"","type":"uint128"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"betMask","type":"uint256"},{"name":"modulo","type":"uint256"},{"name":"commitLastBlock","type":"uint256"},{"name":"commit","type":"uint256"},{"name":"r","type":"bytes32"},{"name":"s","type":"bytes32"}],"name":"placeBet","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"croupier","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"reveal","type":"uint256"},{"name":"canonicalBlockNumber","type":"uint40"}],"name":"settleBetUncleMerkleProof","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"maxProfit","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"beneficiary","type":"address"},{"name":"withdrawAmount","type":"uint256"}],"name":"withdrawFunds","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"reveal","type":"uint256"},{"name":"blockHash","type":"bytes32"}],"name":"settleBet","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"acceptNextOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_nextOwner","type":"address"}],"name":"approveNextOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"increaseAmount","type":"uint256"}],"name":"increaseJackpot","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"newSecretSigner","type":"address"}],"name":"setSecretSigner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"lockedInBets","outputs":[{"name":"","type":"uint128"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"commit","type":"uint256"}],"name":"refundBet","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"newCroupier","type":"address"}],"name":"setCroupier","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_maxProfit","type":"uint256"}],"name":"setMaxProfit","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"beneficiary","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"FailedPayment","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"beneficiary","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"Payment","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"beneficiary","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"JackpotPayment","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"commit","type":"uint256"}],"name":"Commit","type":"event"}]

  Contract Creation Code Switch To Opcodes View
608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506131858061010a6000396000f3fe608060405260043610610126576000357c010000000000000000000000000000000000000000000000000000000090048063ca722cdc116100b2578063d702087f11610081578063d702087f146104ad578063df88126f146104fe578063e1fdb4b41461054d578063f8bb201c14610588578063fbd668a9146105d957610126565b8063ca722cdc146103c5578063d06c54fb1461040a578063d579fd4414610421578063d6d30a511461047257610126565b80636b5c5f39116100f95780636b5c5f391461024557806374e048d51461029c5780638da5cb5b146102e8578063b539cd551461033f578063c10753291461036a57610126565b806341c0e1b5146101285780634d61537f1461013f57806357246d23146101965780635e83b463146101e5575b005b34801561013457600080fd5b5061013d610614565b005b34801561014b57600080fd5b50610154610780565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101a257600080fd5b506101ab6107a6565b60405180826fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610243600480360360c08110156101fb57600080fd5b810190808035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291905050506107c8565b005b34801561025157600080fd5b5061025a611037565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102a857600080fd5b506102e6600480360360408110156102bf57600080fd5b8101908080359060200190929190803564ffffffffff16906020019092919050505061105d565b005b3480156102f457600080fd5b506102fd6111f9565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561034b57600080fd5b5061035461121e565b6040518082815260200191505060405180910390f35b34801561037657600080fd5b506103c36004803603604081101561038d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611224565b005b3480156103d157600080fd5b50610408600480360360408110156103e857600080fd5b81019080803590602001909291908035906020019092919050505061142d565b005b34801561041657600080fd5b5061041f611615565b005b34801561042d57600080fd5b506104706004803603602081101561044457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611721565b005b34801561047e57600080fd5b506104ab6004803603602081101561049557600080fd5b81019080803590602001909291905050506118d1565b005b3480156104b957600080fd5b506104fc600480360360208110156104d057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b28565b005b34801561050a57600080fd5b50610513611c13565b60405180826fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561055957600080fd5b506105866004803603602081101561057057600080fd5b8101908080359060200190929190505050611c35565b005b34801561059457600080fd5b506105d7600480360360208110156105ab57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e5c565b005b3480156105e557600080fd5b50610612600480360360208110156105fc57600080fd5b8101908080359060200190929190505050611f47565b005b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156106bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806130c26026913960400191505060405180910390fd5b6000600460109054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16141515610746576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260488152602001806130546048913960600191505060405180910390fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600460009054906101000a90046fffffffffffffffffffffffffffffffff1681565b6000600560008581526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff1681600101600c9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561088a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612ee36021913960400191505060405180910390fd5b60003490506001871180156108a0575060648711155b1515610914576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4d6f64756c6f2073686f756c642062652077697468696e2072616e67652e000081525060200191505060405180910390fd5b662386f26fc100008110158015610935575069021e19e0c9bab24000008111155b15156109a9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f416d6f756e742073686f756c642062652077697468696e2072616e67652e000081525060200191505060405180910390fd5b6000881180156109bc5750602860020a88105b1515610a30576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4d61736b2073686f756c642062652077697468696e2072616e67652e0000000081525060200191505060405180910390fd5b854311151515610aa8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f436f6d6d69742068617320657870697265642e0000000000000000000000000081525060200191505060405180910390fd5b60008686604051602001808364ffffffffff1664ffffffffff167b0100000000000000000000000000000000000000000000000000000002815260050182815260200192505050604051602081830303815290604052805190602001209050600181601b878760405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015610b62573d6000803e3d6000fd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610c30576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4543445341207369676e6174757265206973206e6f742076616c69642e00000081525060200191505060405180910390fd5b60008060288a111515610c9157603f7e010410410410410410410410410410410410410410410410410410410410417920000000001000000000080000000004000000000200000000018d0216811515610c8657fe5b0691508a9050610cfc565b60008b118015610ca15750898b11155b1515610cf8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e81526020018061310a602e913960400191505060405180910390fd5b8a91505b600080610d0a868d8661205c565b809250819350505060025486018211151515610d8e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f6d617850726f666974206c696d69742076696f6c6174696f6e2e00000000000081525060200191505060405180910390fd5b81600460108282829054906101000a90046fffffffffffffffffffffffffffffffff160192506101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555080600460008282829054906101000a90046fffffffffffffffffffffffffffffffff160192506101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055503073ffffffffffffffffffffffffffffffffffffffff1631600460109054906101000a90046fffffffffffffffffffffffffffffffff16600460009054906101000a90046fffffffffffffffffffffffffffffffff16016fffffffffffffffffffffffffffffffff1611151515610f21576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f43616e6e6f74206166666f726420746f206c6f73652074686973206265742e0081525060200191505060405180910390fd5b7f5bdd2fc99022530157777690475b670d3872f32262eb1d47d9ba8000dad58f878a6040518082815260200191505060405180910390a18587600001819055508b8760010160006101000a81548160ff021916908360ff160217905550838760010160016101000a81548160ff021916908360ff160217905550438760010160026101000a81548164ffffffffff021916908364ffffffffff160217905550828760010160076101000a81548164ffffffffff021916908364ffffffffff1602179055503387600101600c6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050505050505050505050505050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611105576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c815260200180612fc7602c913960400191505060405180910390fd5b6000826040516020018082815260200191505060405160208183030381529060405280519060200120600190049050600060056000838152602001908152602001600020905060fa8364ffffffffff160143111515156111b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806131386022913960400191505060405180910390fd5b6111ba60486121ad565b6000806111c88460446126e0565b8092508193505050818564ffffffffff16401415156111e657600080fd5b6111f1838783612a23565b505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60025481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806130c26026913960400191505060405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff1631811115151561133d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806130306024913960400191505060405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff163181600460109054906101000a90046fffffffffffffffffffffffffffffffff16600460009054906101000a90046fffffffffffffffffffffffffffffffff16016fffffffffffffffffffffffffffffffff16011115151561141e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4e6f7420656e6f7567682066756e64732e00000000000000000000000000000081525060200191505060405180910390fd5b611429828283612d2a565b5050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156114d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c815260200180612fc7602c913960400191505060405180910390fd5b6000826040516020018082815260200191505060405160208183030381529060405280519060200120600190049050600060056000838152602001908152602001600020905060008160010160029054906101000a900464ffffffffff1664ffffffffff1690508043111515611596576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526033815260200180612f2a6033913960400191505060405180910390fd5b60fa810143111515156115f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806131386022913960400191505060405180910390fd5b83814014151561160357600080fd5b61160e828686612a23565b5050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116bd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612e576026913960400191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806130c26026913960400191505060405180910390fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561188d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f43616e6e6f7420617070726f76652063757272656e74206f776e65722e00000081525060200191505060405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611978576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806130c26026913960400191505060405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff163181111515156119ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806130306024913960400191505060405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff163181600460109054906101000a90046fffffffffffffffffffffffffffffffff16600460009054906101000a90046fffffffffffffffffffffffffffffffff16016fffffffffffffffffffffffffffffffff160111151515611acb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4e6f7420656e6f7567682066756e64732e00000000000000000000000000000081525060200191505060405180910390fd5b80600460008282829054906101000a90046fffffffffffffffffffffffffffffffff160192506101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611bcf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806130c26026913960400191505060405180910390fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600460109054906101000a90046fffffffffffffffffffffffffffffffff1681565b600060056000838152602001908152602001600020905060008160000154905060008114151515611cb1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180612ec16022913960400191505060405180910390fd5b60fa8260010160029054906101000a900464ffffffffff1664ffffffffff160143111515611d2a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806131386022913960400191505060405180910390fd5b60008260000181905550600080611d6a838560010160009054906101000a900460ff1660ff168660010160019054906101000a900460ff1660ff1661205c565b809250819350505081600460108282829054906101000a90046fffffffffffffffffffffffffffffffff160392506101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555080600460008282829054906101000a90046fffffffffffffffffffffffffffffffff160392506101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550611e5584600101600c9054906101000a900473ffffffffffffffffffffffffffffffffffffffff168485612d2a565b5050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611f03576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806130c26026913960400191505060405180910390fd5b80600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611fee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806130c26026913960400191505060405180910390fd5b69021e19e0c9bab240000081101515612052576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180612e7d6022913960400191505060405180910390fd5b8060028190555050565b60008082600010801561206f5750838311155b15156120e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f57696e2070726f626162696c697479206f7574206f662072616e67652e00000081525060200191505060405180910390fd5b67016345785d8a00008510156120fa576000612103565b66038d7ea4c680005b9050600060646001870281151561211657fe5b049050660110d9316ec00081101561213357660110d9316ec00090505b8582820111151515612190576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180612e9f6022913960400191505060405180910390fd5b83858383890303028115156121a157fe5b04925050935093915050565b6000813560001a905060f78110151515612212576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806130e86022913960400191505060405180910390fd5b60f68103820191506000823560001a9050607f81111515612238576001830192506122c7565b6080811015801561224a575060b78111155b15156122be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f5061746820697320616e20524c5020737472696e672e0000000000000000000081525060200191505060405180910390fd5b607f8103830192505b6000833560001a905060b98114151561232b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526044815260200180612f836044913960600191505060405180910390fd5b6003840193506000843560001a905060f981141515612395576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603d815260200180612ff3603d913960400191505060405180910390fd5b6003850194506000853560001a905060018114151561241c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f5374617475732073686f756c6420626520737563636573732e0000000000000081525060200191505060405180910390fd5b6001860195506000863560001a9050607f81111515612440576001870196506124cf565b60808110158015612452575060b78111155b15156124c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f43756d756c61746976652067617320697320616e20524c5020737472696e672e81525060200191505060405180910390fd5b607f8103870196505b6000873560001a905060b981141515612533576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612f5d6026913960400191505060405180910390fd5b610103880197506000883560001a905060f88114151561259e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612f046026913960400191505060405180910390fd5b6002890198506000893560001a905060f881141515612608576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602681526020018061309c6026913960400191505060405180910390fd5b60028a01995060008a3560001a905060948114151561268f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f41646472657373206973203230206279746573206c6f6e672e0000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff600b8d03351690503073ffffffffffffffffffffffffffffffffffffffff16811415156126d257600080fd5b505050505050505050505050565b600080600060405190506000806000805b61ffff601e890335169250600083141561270a5761282f565b61ffff601c890335169150826020830111151515612790576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f536869667420626f756e647320636865636b2e0000000000000000000000000081525060200191505060405180910390fd5b600488019750818801359050600081141515612814576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4e6f6e2d656d707479206861736820736c6f742e00000000000000000000000081525060200191505060405180910390fd5b828886378882860152828520985082935082880197506126f1565b88600102955060008486019050600061ffff601c8b0335169050600061ffff601a8c033516905081878201111515156128d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f536869667420626f756e647320636865636b2e0000000000000000000000000081525060200191505060405180910390fd5b60068b019a50818b84376128e78184018989612e0b565b8183209b50818b019a5061ffff601e8c033516955061ffff601c8c0335169450856020860111151515612982576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f536869667420626f756e647320636865636b2e0000000000000000000000000081525060200191505060405180910390fd5b60048b019a50848b01359350600084141515612a06576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4e6f6e2d656d707479206861736820736c6f742e00000000000000000000000081525060200191505060405180910390fd5b858b89378b85890152858820995050505050505050509250929050565b60008360000154905060008460010160009054906101000a900460ff1660ff16905060008560010160019054906101000a900460ff1660ff169050600086600101600c9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008414151515612ae3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180612ec16022913960400191505060405180910390fd5b600087600001819055506000868660405160200180838152602001828152602001925050506040516020818303038152906040528051906020012090506000848260019004811515612b3157fe5b069050600080612b4288888861205c565b809250819350505060008090506000809050602889111515612b925760008d60010160079054906101000a900464ffffffffff1664ffffffffff168660020a16141515612b8d578391505b612b9f565b87851015612b9e578391505b5b83600460108282829054906101000a90046fffffffffffffffffffffffffffffffff160392506101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555067016345785d8a00008a101515612ca45760006103e88a8860019004811515612c1e57fe5b04811515612c2857fe5b0690506000811415612ca257600460009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1691506000600460006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055505b505b6000811115612cfc578673ffffffffffffffffffffffffffffffffffffffff167fc388db0e8aa560a59633c094a0d0aa21322cd6234836fd5bac00fc5ae63b5783826040518082815260200191505060405180910390a25b612d1b87600083850114612d1257828401612d15565b60015b84612d2a565b50505050505050505050505050565b8273ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f1935050505015612db7578273ffffffffffffffffffffffffffffffffffffffff167fd4f43975feb89f48dd30cabbb32011045be187d1e11c8ea9faa43efc35282519826040518082815260200191505060405180910390a2612e06565b8273ffffffffffffffffffffffffffffffffffffffff167fac464fe4d3a86b9121261ac0a01dd981bfe0777c7c9d9c8f4473d31a9c0f9d2d836040518082815260200191505060405180910390a25b505050565b5b602081101515612e315781518352602083019250602082019150602081039050612e0c565b60006001826020036101000a039050801983511681855116818117865250505050505056fe43616e206f6e6c792061636365707420707265617070726f766564206e6577206f776e65722e6d617850726f6669742073686f756c6420626520612073616e65206e756d6265722e42657420646f65736e2774206576656e20636f76657220686f75736520656467652e4265742073686f756c6420626520696e20616e2027616374697665272073746174654265742073686f756c6420626520696e20612027636c65616e272073746174652e4c6f6773206c697374206973206c657373207468616e20323536206279746573206c6f6e672e736574746c6542657420696e207468652073616d6520626c6f636b20617320706c6163654265742c206f72206265666f72652e426c6f6f6d2066696c74657220697320616c7761797320323536206279746573206c6f6e672e5265636569707420737472696e6720697320616c77617973206174206c6561737420323536206279746573206c6f6e672c20627574206c657373207468616e2036346b2e4f6e6c7943726f7570696572206d6574686f64732063616c6c6564206279206e6f6e2d63726f75706965722e5265636569707420697320616c77617973206174206c6561737420323536206279746573206c6f6e672c20627574206c657373207468616e2036346b2e496e63726561736520616d6f756e74206c6172676572207468616e2062616c616e63652e416c6c20626574732073686f756c642062652070726f6365737365642028736574746c6564206f7220726566756e64656429206265666f72652073656c662d64657374727563742e4c6f6720656e747279206973206c657373207468616e20323536206279746573206c6f6e672e4f6e6c794f776e6572206d6574686f64732063616c6c6564206279206e6f6e2d6f776e65722e52656365697074206c656166206c6f6e676572207468616e2035352062797465732e48696768206d6f64756c6f2072616e67652c206265744d61736b206c6172676572207468616e206d6f64756c6f2e426c6f636b686173682063616e277420626520717565726965642062792045564d2ea165627a7a72305820ba6c818b66d431ce2bcc7222d9bbf5b90a5d8681e4ce0c59ee848ea441fff06d0029

   Swarm Source:
bzzr://ba6c818b66d431ce2bcc7222d9bbf5b90a5d8681e4ce0c59ee848ea441fff06d

 

View All
Block Age transaction Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward