ETH Price: $3,291.82 (-3.48%)
Gas: 14 Gwei

Contract

0x722B035cDAf0DaF521Ead7bC3496029A280e6249
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

More Info

Private Name Tags

Last Txn Sent

No transactions sent

First Txn Sent

No transactions sent

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Kill64872202018-10-10 6:02:562093 days ago1539151376IN
0x722B035c...A280e6249
0 ETH0.000162212
Settle Bet64871242018-10-10 5:40:232093 days ago1539150023IN
0x722B035c...A280e6249
0 ETH0.0003850310.7
Place Bet64871202018-10-10 5:38:352093 days ago1539149915IN
0x722B035c...A280e6249
0.1 ETH0.000577696.95
Settle Bet64871202018-10-10 5:38:352093 days ago1539149915IN
0x722B035c...A280e6249
0 ETH0.000375610.5
Place Bet64871162018-10-10 5:37:542093 days ago1539149874IN
0x722B035c...A280e6249
0.03 ETH0.000577356.95
Settle Bet64871162018-10-10 5:37:542093 days ago1539149874IN
0x722B035c...A280e6249
0 ETH0.0003757110.5
Place Bet64871102018-10-10 5:36:452093 days ago1539149805IN
0x722B035c...A280e6249
0.05 ETH0.000577796.95
Settle Bet64871102018-10-10 5:36:452093 days ago1539149805IN
0x722B035c...A280e6249
0 ETH0.0003785110.5
Place Bet64871072018-10-10 5:35:252093 days ago1539149725IN
0x722B035c...A280e6249
0.3 ETH0.00066868.05
Settle Bet64869422018-10-10 4:58:362093 days ago1539147516IN
0x722B035c...A280e6249
0 ETH0.000306418.5
Settle Bet64869382018-10-10 4:57:172093 days ago1539147437IN
0x722B035c...A280e6249
0 ETH0.000306418.5
Place Bet64869382018-10-10 4:57:172093 days ago1539147437IN
0x722B035c...A280e6249
0.88 ETH0.000743938.95
Place Bet64869342018-10-10 4:56:112093 days ago1539147371IN
0x722B035c...A280e6249
1.21 ETH0.000743368.95
Settle Bet64869292018-10-10 4:55:482093 days ago1539147348IN
0x722B035c...A280e6249
0 ETH0.000306418.5
Place Bet64869252018-10-10 4:55:162093 days ago1539147316IN
0x722B035c...A280e6249
0.76 ETH0.000743368.95
Settle Bet64869242018-10-10 4:54:362093 days ago1539147276IN
0x722B035c...A280e6249
0 ETH0.000306418.5
Place Bet64869222018-10-10 4:54:262093 days ago1539147266IN
0x722B035c...A280e6249
0.3 ETH0.000827059.95
Settle Bet64869212018-10-10 4:53:472093 days ago1539147227IN
0x722B035c...A280e6249
0 ETH0.000316948.792
Place Bet64869172018-10-10 4:53:132093 days ago1539147193IN
0x722B035c...A280e6249
0.1 ETH0.000827059.95
Settle Bet64869152018-10-10 4:51:452093 days ago1539147105IN
0x722B035c...A280e6249
0 ETH0.000306628.5
Place Bet64869122018-10-10 4:50:342093 days ago1539147034IN
0x722B035c...A280e6249
0.1 ETH0.000743368.95
Settle Bet64869082018-10-10 4:50:012093 days ago1539147001IN
0x722B035c...A280e6249
0 ETH0.000306418.5
Place Bet64869052018-10-10 4:49:172093 days ago1539146957IN
0x722B035c...A280e6249
0.1 ETH0.000743938.95
Settle Bet64867932018-10-10 4:20:322093 days ago1539145232IN
0x722B035c...A280e6249
0 ETH0.00030118.4
Place Bet64867902018-10-10 4:19:432093 days ago1539145183IN
0x722B035c...A280e6249
0.01 ETH0.00082729.95
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To Value
64872202018-10-10 6:02:562093 days ago1539151376
0x722B035c...A280e6249
223.55272489 ETH
64871242018-10-10 5:40:232093 days ago1539150023
0x722B035c...A280e6249
1 wei
64871202018-10-10 5:38:352093 days ago1539149915
0x722B035c...A280e6249
1 wei
64871162018-10-10 5:37:542093 days ago1539149874
0x722B035c...A280e6249
0.0984 ETH
64871102018-10-10 5:36:452093 days ago1539149805
0x722B035c...A280e6249
1 wei
64869422018-10-10 4:58:362093 days ago1539147516
0x722B035c...A280e6249
1 wei
64869382018-10-10 4:57:172093 days ago1539147437
0x722B035c...A280e6249
1 wei
64869292018-10-10 4:55:482093 days ago1539147348
0x722B035c...A280e6249
1 wei
64869242018-10-10 4:54:362093 days ago1539147276
0x722B035c...A280e6249
1 wei
64869212018-10-10 4:53:472093 days ago1539147227
0x722B035c...A280e6249
1 wei
64869152018-10-10 4:51:452093 days ago1539147105
0x722B035c...A280e6249
0.196 ETH
64869082018-10-10 4:50:012093 days ago1539147001
0x722B035c...A280e6249
1 wei
64867932018-10-10 4:20:322093 days ago1539145232
0x722B035c...A280e6249
0.0184 ETH
64866022018-10-10 3:38:082093 days ago1539142688
0x722B035c...A280e6249
1 wei
64865932018-10-10 3:36:112093 days ago1539142571
0x722B035c...A280e6249
1 wei
64865712018-10-10 3:31:022093 days ago1539142262
0x722B035c...A280e6249
1 wei
64865472018-10-10 3:24:562093 days ago1539141896
0x722B035c...A280e6249
0.0314754 ETH
64865472018-10-10 3:24:562093 days ago1539141896
0x722B035c...A280e6249
1 wei
64865372018-10-10 3:22:382093 days ago1539141758
0x722B035c...A280e6249
1 wei
64865332018-10-10 3:21:322093 days ago1539141692
0x722B035c...A280e6249
1 wei
64865282018-10-10 3:20:402093 days ago1539141640
0x722B035c...A280e6249
0.04571428 ETH
64865062018-10-10 3:14:062093 days ago1539141246
0x722B035c...A280e6249
0.0384 ETH
64865042018-10-10 3:12:502093 days ago1539141170
0x722B035c...A280e6249
1 wei
64864422018-10-10 3:00:332093 days ago1539140433
0x722B035c...A280e6249
0.196 ETH
64862972018-10-10 2:30:462093 days ago1539138646
0x722B035c...A280e6249
0.0148387 ETH
View All Internal Transactions
Loading...
Loading
Contract Self Destruct called at Txn Hash 0x06a5c76a1ac3cc8f3e0f8341968f556434b1f1ebfee80875ed6b463e58e30c7d


Contract Source Code Verified (Exact Match)

Contract Name:
FckDice

Compiler Version
v0.4.25+commit.59dbf8f1

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
/**
 *Submitted for verification at Etherscan.io on 2018-09-24
*/

pragma solidity ^0.4.25;


contract FckDice {
    /// *** 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 public HOUSE_EDGE_PERCENT = 1;
    uint public 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 public MIN_JACKPOT_BET = 0.1 ether;

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

    function setHouseEdgePercent(uint _HOUSE_EDGE_PERCENT) external onlyOwner {
        HOUSE_EDGE_PERCENT = _HOUSE_EDGE_PERCENT;
    }

    function setHouseEdgeMinimumAmount(uint _HOUSE_EDGE_MINIMUM_AMOUNT) external onlyOwner {
        HOUSE_EDGE_MINIMUM_AMOUNT = _HOUSE_EDGE_MINIMUM_AMOUNT;
    }

    function setMinJackpotBet(uint _MIN_JACKPOT_BET) external onlyOwner {
        MIN_JACKPOT_BET = _MIN_JACKPOT_BET;
    }

    function setJackpotModulo(uint _JACKPOT_MODULO) external onlyOwner {
        JACKPOT_MODULO = _JACKPOT_MODULO;
    }

    function setJackpotFee(uint _JACKPOT_FEE) external onlyOwner {
        JACKPOT_FEE = _JACKPOT_FEE;
    }

    // There is minimum and maximum bets.
    uint constant MIN_BET = 0.01 ether;
    uint constant MAX_AMOUNT = 300000 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 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 public owner;
    address 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 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 (address _secretSigner, address _croupier, uint _maxProfit) public payable {
        owner = msg.sender;
        secretSigner = _secretSigner;
        croupier = _croupier;
        require(_maxProfit < MAX_AMOUNT, "maxProfit should be a sane number.");
        maxProfit = _maxProfit;
    }

    // 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 _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() public 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 croupier operation.
    function withdrawFunds(address 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);
    }

    function getBetInfo(uint commit) external view returns (uint amount, uint8 modulo, uint8 rollUnder, uint40 placeBlockNumber, uint40 mask, address gambler) {
        Bet storage bet = bets[commit];
        amount = bet.amount;
        modulo = bet.modulo;
        rollUnder = bet.rollUnder;
        placeBlockNumber = bet.placeBlockNumber;
        mask = bet.mask;
        gambler = bet.gambler;
    }

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

        //        emit DebugUint("rollUnder", rollUnder);
        (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;
        //        emit DebugUint("placeBet-placeBlockNumber", bet.placeBlockNumber);
    }

    // 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(bytes20 reveal1, bytes20 reveal2, bytes32 blockHash) external onlyCroupier {
        uint commit = uint(keccak256(abi.encodePacked(reveal1, reveal2)));
        //         emit DebugUint("settleBet-reveal1", uint(reveal1));
        //         emit DebugUint("settleBet-reveal2", uint(reveal2));
        //         emit DebugUint("settleBet-commit", commit);

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

        //         emit DebugBytes32("settleBet-placeBlockhash", blockhash(placeBlockNumber));
        //         emit DebugUint("settleBet-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, "blockHash invalid");

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

    // Debug events
    //    event DebugBytes32(string name, bytes32 data);
    //    event DebugUint(string name, uint data);

    // Common settlement code for settleBet.
    function settleBetCommon(Bet storage bet, bytes20 reveal1, bytes20 reveal2, 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 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(reveal1, entropyBlockHash, reveal2));
        //emit DebugBytes32("entropy", entropy);

        // 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 fck.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 view 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 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;

}

Contract Security Audit

Contract ABI

[{"constant":true,"inputs":[],"name":"JACKPOT_MODULO","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MIN_JACKPOT_BET","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_MIN_JACKPOT_BET","type":"uint256"}],"name":"setMinJackpotBet","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"kill","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_JACKPOT_FEE","type":"uint256"}],"name":"setJackpotFee","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"secretSigner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_HOUSE_EDGE_MINIMUM_AMOUNT","type":"uint256"}],"name":"setHouseEdgeMinimumAmount","outputs":[],"payable":false,"stateMutability":"nonpayable","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":true,"inputs":[{"name":"commit","type":"uint256"}],"name":"getBetInfo","outputs":[{"name":"amount","type":"uint256"},{"name":"modulo","type":"uint8"},{"name":"rollUnder","type":"uint8"},{"name":"placeBlockNumber","type":"uint40"},{"name":"mask","type":"uint40"},{"name":"gambler","type":"address"}],"payable":false,"stateMutability":"view","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":true,"inputs":[],"name":"HOUSE_EDGE_MINIMUM_AMOUNT","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"HOUSE_EDGE_PERCENT","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"JACKPOT_FEE","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":"_JACKPOT_MODULO","type":"uint256"}],"name":"setJackpotModulo","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_HOUSE_EDGE_PERCENT","type":"uint256"}],"name":"setHouseEdgePercent","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":"reveal1","type":"bytes20"},{"name":"reveal2","type":"bytes20"},{"name":"blockHash","type":"bytes32"}],"name":"settleBet","outputs":[],"payable":false,"stateMutability":"nonpayable","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":[{"name":"_secretSigner","type":"address"},{"name":"_croupier","type":"address"},{"name":"_maxProfit","type":"uint256"}],"payable":true,"stateMutability":"payable","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"}]

60806040526001600055660110d9316ec00060015567016345785d8a00006002556103e860035566038d7ea4c68000600455604051606080611fe58339810160409081528151602083015191909201516005805433600160a060020a031991821617909155600880548216600160a060020a0380871691909117909155600b8054909216908416179055693f870857a3e0e3800000811061012757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f6d617850726f6669742073686f756c6420626520612073616e65206e756d626560448201527f722e000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b6007555050611eaa8061013b6000396000f3006080604052600436106101695763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166301f60217811461016b5780630cf9349d146101925780633d74e856146101a757806341c0e1b5146101bf5780634b24f3a6146101d45780634d61537f146101ec578063548f896c1461021d57806357246d23146102355780635e83b463146102665780636b5c5f391461028057806379141f80146102955780638da5cb5b146102f5578063b539cd551461030a578063bcce60401461031f578063becf40b614610334578063bf020f6114610349578063c10753291461035e578063cc6db55f14610382578063cf96ce031461039a578063d06c54fb146103b2578063d579fd44146103c7578063d6d30a51146103e8578063d702087f14610400578063df88126f14610421578063e163b75b14610436578063e1fdb4b414610466578063f8bb201c1461047e578063fbd668a91461049f575b005b34801561017757600080fd5b506101806104b7565b60408051918252519081900360200190f35b34801561019e57600080fd5b506101806104bd565b3480156101b357600080fd5b506101696004356104c3565b3480156101cb57600080fd5b5061016961052a565b3480156101e057600080fd5b5061016960043561059a565b3480156101f857600080fd5b50610201610601565b60408051600160a060020a039092168252519081900360200190f35b34801561022957600080fd5b50610169600435610610565b34801561024157600080fd5b5061024a610677565b604080516001608060020a039092168252519081900360200190f35b61016960043560243560443560643560843560a435610686565b34801561028c57600080fd5b50610201610d09565b3480156102a157600080fd5b506102ad600435610d18565b6040805196875260ff9586166020880152939094168584015264ffffffffff9182166060860152166080840152600160a060020a0390911660a0830152519081900360c00190f35b34801561030157600080fd5b50610201610d7b565b34801561031657600080fd5b50610180610d8a565b34801561032b57600080fd5b50610180610d90565b34801561034057600080fd5b50610180610d96565b34801561035557600080fd5b50610180610d9c565b34801561036a57600080fd5b50610169600160a060020a0360043516602435610da2565b34801561038e57600080fd5b50610169600435610f0a565b3480156103a657600080fd5b50610169600435610f71565b3480156103be57600080fd5b50610169610fd8565b3480156103d357600080fd5b50610169600160a060020a036004351661107d565b3480156103f457600080fd5b50610169600435611174565b34801561040c57600080fd5b50610169600160a060020a03600435166112fd565b34801561042d57600080fd5b5061024a61138e565b34801561044257600080fd5b506101696bffffffffffffffffffffffff19600435811690602435166044356113a4565b34801561047257600080fd5b50610169600435611655565b34801561048a57600080fd5b50610169600160a060020a0360043516611812565b3480156104ab57600080fd5b506101696004356118a3565b60035481565b60025481565b600554600160a060020a03163314610525576040805160e560020a62461bcd0281526020600482015260266024820152600080516020611e5f833981519152604482015260d160020a6537bbb732b91702606482015290519081900360840190fd5b600255565b600554600160a060020a0316331461058c576040805160e560020a62461bcd0281526020600482015260266024820152600080516020611e5f833981519152604482015260d160020a6537bbb732b91702606482015290519081900360840190fd5b600554600160a060020a0316ff5b600554600160a060020a031633146105fc576040805160e560020a62461bcd0281526020600482015260266024820152600080516020611e5f833981519152604482015260d160020a6537bbb732b91702606482015290519081900360840190fd5b600455565b600854600160a060020a031681565b600554600160a060020a03163314610672576040805160e560020a62461bcd0281526020600482015260266024820152600080516020611e5f833981519152604482015260d160020a6537bbb732b91702606482015290519081900360840190fd5b600155565b6009546001608060020a031681565b6000838152600a602052604081206001810154909190819081908190819081906c010000000000000000000000009004600160a060020a03161561073a576040805160e560020a62461bcd02815260206004820152602160248201527f4265742073686f756c6420626520696e20612027636c65616e2720737461746560448201527f2e00000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b34955060018c11801561074e575060648c11155b15156107a4576040805160e560020a62461bcd02815260206004820152601e60248201527f4d6f64756c6f2073686f756c642062652077697468696e2072616e67652e0000604482015290519081900360640190fd5b662386f26fc1000086101580156107c55750693f870857a3e0e38000008611155b151561081b576040805160e560020a62461bcd02815260206004820152601e60248201527f416d6f756e742073686f756c642062652077697468696e2072616e67652e0000604482015290519081900360640190fd5b60008d1180156108305750650100000000008d105b1515610886576040805160e560020a62461bcd02815260206004820152601c60248201527f4d61736b2073686f756c642062652077697468696e2072616e67652e00000000604482015290519081900360640190fd5b438b10156108de576040805160e560020a62461bcd02815260206004820152601360248201527f436f6d6d69742068617320657870697265642e00000000000000000000000000604482015290519081900360640190fd5b8a8a60405160200180838152602001828152602001925050506040516020818303038152906040526040518082805190602001908083835b602083106109355780518252601f199092019160209182019101610916565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390209450600185601b8b8b604051600081526020016040526040518085600019166000191681526020018460ff1681526020018360001916600019168152602001826000191660001916815260200194505050505060206040516020810390808403906000865af11580156109d9573d6000803e3d6000fd5b5050604051601f190151600854600160a060020a039081169116149050610a4a576040805160e560020a62461bcd02815260206004820152601d60248201527f4543445341207369676e6174757265206973206e6f742076616c69642e000000604482015290519081900360640190fd5b60288c11610a9d57603f7920000000001000000000080000000004000000000200000000018e027e01041041041041041041041041041041041041041041041041041041041041160693508c9250610b2d565b60008d118015610aad57508b8d11155b1515610b29576040805160e560020a62461bcd02815260206004820152602e60248201527f48696768206d6f64756c6f2072616e67652c206265744d61736b206c6172676560448201527f72207468616e206d6f64756c6f2e000000000000000000000000000000000000606482015290519081900360840190fd5b8c93505b610b38868d86611991565b60075491935091508601821115610b99576040805160e560020a62461bcd02815260206004820152601a60248201527f6d617850726f666974206c696d69742076696f6c6174696f6e2e000000000000604482015290519081900360640190fd5b600980546001608060020a03608060020a808304821686018216810292821692909217808216850182166fffffffffffffffffffffffffffffffff19919091161792839055303183821692909304811691909101161115610c44576040805160e560020a62461bcd02815260206004820152601f60248201527f43616e6e6f74206166666f726420746f206c6f73652074686973206265742e00604482015290519081900360640190fd5b604080518b815290517f5bdd2fc99022530157777690475b670d3872f32262eb1d47d9ba8000dad58f879181900360200190a150509284556001909301805460ff191660ff998a161761ff00191661010099909416989098029290921766ffffffffff00001916620100004364ffffffffff90811691909102919091176bffffffffff0000000000000019166701000000000000009190921602176bffffffffffffffffffffffff16336c010000000000000000000000000217909555505050505050565b600b54600160a060020a031681565b6000908152600a602052604090208054600190910154909160ff8083169261010081049091169162010000820464ffffffffff908116926701000000000000008104909116916c01000000000000000000000000909104600160a060020a031690565b600554600160a060020a031681565b60075481565b60015481565b60005481565b60045481565b600554600160a060020a03163314610e04576040805160e560020a62461bcd0281526020600482015260266024820152600080516020611e5f833981519152604482015260d160020a6537bbb732b91702606482015290519081900360840190fd5b3031811115610e82576040805160e560020a62461bcd028152602060048201526024808201527f496e63726561736520616d6f756e74206c6172676572207468616e2062616c6160448201527f6e63652e00000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b60095430316001608060020a03808316608060020a90930481169290920190911682011115610efb576040805160e560020a62461bcd02815260206004820152601160248201527f4e6f7420656e6f7567682066756e64732e000000000000000000000000000000604482015290519081900360640190fd5b610f06828283611acb565b5050565b600554600160a060020a03163314610f6c576040805160e560020a62461bcd0281526020600482015260266024820152600080516020611e5f833981519152604482015260d160020a6537bbb732b91702606482015290519081900360840190fd5b600355565b600554600160a060020a03163314610fd3576040805160e560020a62461bcd0281526020600482015260266024820152600080516020611e5f833981519152604482015260d160020a6537bbb732b91702606482015290519081900360840190fd5b600055565b600654600160a060020a0316331461104c576040805160e560020a62461bcd02815260206004820152602660248201527f43616e206f6e6c792061636365707420707265617070726f766564206e657720604482015260d160020a6537bbb732b91702606482015290519081900360840190fd5b6006546005805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055565b600554600160a060020a031633146110df576040805160e560020a62461bcd0281526020600482015260266024820152600080516020611e5f833981519152604482015260d160020a6537bbb732b91702606482015290519081900360840190fd5b600554600160a060020a0382811691161415611145576040805160e560020a62461bcd02815260206004820152601d60248201527f43616e6e6f7420617070726f76652063757272656e74206f776e65722e000000604482015290519081900360640190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600554600160a060020a031633146111d6576040805160e560020a62461bcd0281526020600482015260266024820152600080516020611e5f833981519152604482015260d160020a6537bbb732b91702606482015290519081900360840190fd5b3031811115611254576040805160e560020a62461bcd028152602060048201526024808201527f496e63726561736520616d6f756e74206c6172676572207468616e2062616c6160448201527f6e63652e00000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b60095430316001608060020a03808316608060020a909304811692909201909116820111156112cd576040805160e560020a62461bcd02815260206004820152601160248201527f4e6f7420656e6f7567682066756e64732e000000000000000000000000000000604482015290519081900360640190fd5b600980546fffffffffffffffffffffffffffffffff1981166001608060020a039182169390930116919091179055565b600554600160a060020a0316331461135f576040805160e560020a62461bcd0281526020600482015260266024820152600080516020611e5f833981519152604482015260d160020a6537bbb732b91702606482015290519081900360840190fd5b6008805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600954608060020a90046001608060020a031681565b600b5460009081908190600160a060020a03163314611433576040805160e560020a62461bcd02815260206004820152602c60248201527f4f6e6c7943726f7570696572206d6574686f64732063616c6c6564206279206e60448201527f6f6e2d63726f75706965722e0000000000000000000000000000000000000000606482015290519081900360840190fd5b604080516bffffffffffffffffffffffff19808916602080840191909152908816603483015282516028818403018152604890920192839052815191929182918401908083835b602083106114995780518252601f19909201916020918201910161147a565b51815160209384036101000a600019018019909216911617905260408051929094018290039091206000818152600a909252929020600181015492975095505062010000900464ffffffffff169250504382109050611568576040805160e560020a62461bcd02815260206004820152603360248201527f736574746c6542657420696e207468652073616d6520626c6f636b206173207060448201527f6c6163654265742c206f72206265666f72652e00000000000000000000000000606482015290519081900360840190fd5b60fa81014311156115e9576040805160e560020a62461bcd02815260206004820152602260248201527f426c6f636b686173682063616e2774206265207175657269656420627920455660448201527f4d2e000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b80408414611641576040805160e560020a62461bcd02815260206004820152601160248201527f626c6f636b4861736820696e76616c6964000000000000000000000000000000604482015290519081900360640190fd5b61164d82878787611b7e565b505050505050565b6000818152600a6020526040812080549091808215156116e5576040805160e560020a62461bcd02815260206004820152602260248201527f4265742073686f756c6420626520696e20616e2027616374697665272073746160448201527f7465000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600184015464ffffffffff620100009091041660fa014311611777576040805160e560020a62461bcd02815260206004820152602260248201527f426c6f636b686173682063616e2774206265207175657269656420627920455660448201527f4d2e000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b60008455600184015461179790849060ff80821691610100900416611991565b600980546001608060020a03608060020a8083048216869003821602918116919091178082168490039091166fffffffffffffffffffffffffffffffff19919091161790556001860154919350915061180b90600160a060020a036c01000000000000000000000000909104168480611acb565b5050505050565b600554600160a060020a03163314611874576040805160e560020a62461bcd0281526020600482015260266024820152600080516020611e5f833981519152604482015260d160020a6537bbb732b91702606482015290519081900360840190fd5b600b805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600554600160a060020a03163314611905576040805160e560020a62461bcd0281526020600482015260266024820152600080516020611e5f833981519152604482015260d160020a6537bbb732b91702606482015290519081900360840190fd5b693f870857a3e0e3800000811061198c576040805160e560020a62461bcd02815260206004820152602260248201527f6d617850726f6669742073686f756c6420626520612073616e65206e756d626560448201527f722e000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600755565b60008060008360001080156119a65750848411155b15156119fc576040805160e560020a62461bcd02815260206004820152601d60248201527f57696e2070726f626162696c697479206f7574206f662072616e67652e000000604482015290519081900360640190fd5b600254861015611a0d576000611a11565b6004545b6000549092506064908702049050600154811015611a2e57506001545b808201861015611aae576040805160e560020a62461bcd02815260206004820152602260248201527f42657420646f65736e2774206576656e20636f76657220686f7573652065646760448201527f652e000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b8385838389030302811515611abf57fe5b04925050935093915050565b604051600160a060020a0384169083156108fc029084906000818181858888f1935050505015611b3957604080518281529051600160a060020a038516917fd4f43975feb89f48dd30cabbb32011045be187d1e11c8ea9faa43efc35282519919081900360200190a2611b79565b604080518381529051600160a060020a038516917fac464fe4d3a86b9121261ac0a01dd981bfe0777c7c9d9c8f4473d31a9c0f9d2d919081900360200190a25b505050565b8354600185015460ff808216916101008104909116906c010000000000000000000000009004600160a060020a031660008080808080808a1515611c32576040805160e560020a62461bcd02815260206004820152602260248201527f4265742073686f756c6420626520696e20616e2027616374697665272073746160448201527f7465000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b60008f600001819055508d8c8e60405160200180846bffffffffffffffffffffffff19166bffffffffffffffffffffffff191681526014018360001916600019168152602001826bffffffffffffffffffffffff19166bffffffffffffffffffffffff1916815260140193505050506040516020818303038152906040526040518082805190602001908083835b60208310611cdf5780518252601f199092019160209182019101611cc0565b5181516020939093036101000a6000190180199091169216919091179052604051920182900390912099508c925089915050811515611d1a57fe5b069550611d288b8b8b611991565b90955093506000925082915060288a11611d685760018f0154600287900a6701000000000000009091041664ffffffffff1615611d63578492505b611d74565b88861015611d74578492505b600980546001608060020a03608060020a808304821689900382160291161790556002548b10611de7576003548a88811515611dac57fe5b04811515611db657fe5b069050801515611de757600980546fffffffffffffffffffffffffffffffff1981169091556001608060020a031691505b6000821115611e3057604080518381529051600160a060020a038a16917fc388db0e8aa560a59633c094a0d0aa21322cd6234836fd5bac00fc5ae63b5783919081900360200190a25b611e4d8884840115611e4457838501611e47565b60015b85611acb565b50505050505050505050505050505056004f6e6c794f776e6572206d6574686f64732063616c6c6564206279206e6f6e2da165627a7a7230582023402095581a452365a40b5c86a59662ac9f832f26b7bb7e9999234f20fe7ddc00290000000000000000000000005a5f158fb01b03a9df99337386516ebcbd1b93eb00000000000000000000000001fd2b8c9c81044d37352704f1ce9ada7e1b6ae20000000000000000000000000000000000000000000000001bc16d674ec80000

Deployed Bytecode

0x6080604052600436106101695763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166301f60217811461016b5780630cf9349d146101925780633d74e856146101a757806341c0e1b5146101bf5780634b24f3a6146101d45780634d61537f146101ec578063548f896c1461021d57806357246d23146102355780635e83b463146102665780636b5c5f391461028057806379141f80146102955780638da5cb5b146102f5578063b539cd551461030a578063bcce60401461031f578063becf40b614610334578063bf020f6114610349578063c10753291461035e578063cc6db55f14610382578063cf96ce031461039a578063d06c54fb146103b2578063d579fd44146103c7578063d6d30a51146103e8578063d702087f14610400578063df88126f14610421578063e163b75b14610436578063e1fdb4b414610466578063f8bb201c1461047e578063fbd668a91461049f575b005b34801561017757600080fd5b506101806104b7565b60408051918252519081900360200190f35b34801561019e57600080fd5b506101806104bd565b3480156101b357600080fd5b506101696004356104c3565b3480156101cb57600080fd5b5061016961052a565b3480156101e057600080fd5b5061016960043561059a565b3480156101f857600080fd5b50610201610601565b60408051600160a060020a039092168252519081900360200190f35b34801561022957600080fd5b50610169600435610610565b34801561024157600080fd5b5061024a610677565b604080516001608060020a039092168252519081900360200190f35b61016960043560243560443560643560843560a435610686565b34801561028c57600080fd5b50610201610d09565b3480156102a157600080fd5b506102ad600435610d18565b6040805196875260ff9586166020880152939094168584015264ffffffffff9182166060860152166080840152600160a060020a0390911660a0830152519081900360c00190f35b34801561030157600080fd5b50610201610d7b565b34801561031657600080fd5b50610180610d8a565b34801561032b57600080fd5b50610180610d90565b34801561034057600080fd5b50610180610d96565b34801561035557600080fd5b50610180610d9c565b34801561036a57600080fd5b50610169600160a060020a0360043516602435610da2565b34801561038e57600080fd5b50610169600435610f0a565b3480156103a657600080fd5b50610169600435610f71565b3480156103be57600080fd5b50610169610fd8565b3480156103d357600080fd5b50610169600160a060020a036004351661107d565b3480156103f457600080fd5b50610169600435611174565b34801561040c57600080fd5b50610169600160a060020a03600435166112fd565b34801561042d57600080fd5b5061024a61138e565b34801561044257600080fd5b506101696bffffffffffffffffffffffff19600435811690602435166044356113a4565b34801561047257600080fd5b50610169600435611655565b34801561048a57600080fd5b50610169600160a060020a0360043516611812565b3480156104ab57600080fd5b506101696004356118a3565b60035481565b60025481565b600554600160a060020a03163314610525576040805160e560020a62461bcd0281526020600482015260266024820152600080516020611e5f833981519152604482015260d160020a6537bbb732b91702606482015290519081900360840190fd5b600255565b600554600160a060020a0316331461058c576040805160e560020a62461bcd0281526020600482015260266024820152600080516020611e5f833981519152604482015260d160020a6537bbb732b91702606482015290519081900360840190fd5b600554600160a060020a0316ff5b600554600160a060020a031633146105fc576040805160e560020a62461bcd0281526020600482015260266024820152600080516020611e5f833981519152604482015260d160020a6537bbb732b91702606482015290519081900360840190fd5b600455565b600854600160a060020a031681565b600554600160a060020a03163314610672576040805160e560020a62461bcd0281526020600482015260266024820152600080516020611e5f833981519152604482015260d160020a6537bbb732b91702606482015290519081900360840190fd5b600155565b6009546001608060020a031681565b6000838152600a602052604081206001810154909190819081908190819081906c010000000000000000000000009004600160a060020a03161561073a576040805160e560020a62461bcd02815260206004820152602160248201527f4265742073686f756c6420626520696e20612027636c65616e2720737461746560448201527f2e00000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b34955060018c11801561074e575060648c11155b15156107a4576040805160e560020a62461bcd02815260206004820152601e60248201527f4d6f64756c6f2073686f756c642062652077697468696e2072616e67652e0000604482015290519081900360640190fd5b662386f26fc1000086101580156107c55750693f870857a3e0e38000008611155b151561081b576040805160e560020a62461bcd02815260206004820152601e60248201527f416d6f756e742073686f756c642062652077697468696e2072616e67652e0000604482015290519081900360640190fd5b60008d1180156108305750650100000000008d105b1515610886576040805160e560020a62461bcd02815260206004820152601c60248201527f4d61736b2073686f756c642062652077697468696e2072616e67652e00000000604482015290519081900360640190fd5b438b10156108de576040805160e560020a62461bcd02815260206004820152601360248201527f436f6d6d69742068617320657870697265642e00000000000000000000000000604482015290519081900360640190fd5b8a8a60405160200180838152602001828152602001925050506040516020818303038152906040526040518082805190602001908083835b602083106109355780518252601f199092019160209182019101610916565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390209450600185601b8b8b604051600081526020016040526040518085600019166000191681526020018460ff1681526020018360001916600019168152602001826000191660001916815260200194505050505060206040516020810390808403906000865af11580156109d9573d6000803e3d6000fd5b5050604051601f190151600854600160a060020a039081169116149050610a4a576040805160e560020a62461bcd02815260206004820152601d60248201527f4543445341207369676e6174757265206973206e6f742076616c69642e000000604482015290519081900360640190fd5b60288c11610a9d57603f7920000000001000000000080000000004000000000200000000018e027e01041041041041041041041041041041041041041041041041041041041041160693508c9250610b2d565b60008d118015610aad57508b8d11155b1515610b29576040805160e560020a62461bcd02815260206004820152602e60248201527f48696768206d6f64756c6f2072616e67652c206265744d61736b206c6172676560448201527f72207468616e206d6f64756c6f2e000000000000000000000000000000000000606482015290519081900360840190fd5b8c93505b610b38868d86611991565b60075491935091508601821115610b99576040805160e560020a62461bcd02815260206004820152601a60248201527f6d617850726f666974206c696d69742076696f6c6174696f6e2e000000000000604482015290519081900360640190fd5b600980546001608060020a03608060020a808304821686018216810292821692909217808216850182166fffffffffffffffffffffffffffffffff19919091161792839055303183821692909304811691909101161115610c44576040805160e560020a62461bcd02815260206004820152601f60248201527f43616e6e6f74206166666f726420746f206c6f73652074686973206265742e00604482015290519081900360640190fd5b604080518b815290517f5bdd2fc99022530157777690475b670d3872f32262eb1d47d9ba8000dad58f879181900360200190a150509284556001909301805460ff191660ff998a161761ff00191661010099909416989098029290921766ffffffffff00001916620100004364ffffffffff90811691909102919091176bffffffffff0000000000000019166701000000000000009190921602176bffffffffffffffffffffffff16336c010000000000000000000000000217909555505050505050565b600b54600160a060020a031681565b6000908152600a602052604090208054600190910154909160ff8083169261010081049091169162010000820464ffffffffff908116926701000000000000008104909116916c01000000000000000000000000909104600160a060020a031690565b600554600160a060020a031681565b60075481565b60015481565b60005481565b60045481565b600554600160a060020a03163314610e04576040805160e560020a62461bcd0281526020600482015260266024820152600080516020611e5f833981519152604482015260d160020a6537bbb732b91702606482015290519081900360840190fd5b3031811115610e82576040805160e560020a62461bcd028152602060048201526024808201527f496e63726561736520616d6f756e74206c6172676572207468616e2062616c6160448201527f6e63652e00000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b60095430316001608060020a03808316608060020a90930481169290920190911682011115610efb576040805160e560020a62461bcd02815260206004820152601160248201527f4e6f7420656e6f7567682066756e64732e000000000000000000000000000000604482015290519081900360640190fd5b610f06828283611acb565b5050565b600554600160a060020a03163314610f6c576040805160e560020a62461bcd0281526020600482015260266024820152600080516020611e5f833981519152604482015260d160020a6537bbb732b91702606482015290519081900360840190fd5b600355565b600554600160a060020a03163314610fd3576040805160e560020a62461bcd0281526020600482015260266024820152600080516020611e5f833981519152604482015260d160020a6537bbb732b91702606482015290519081900360840190fd5b600055565b600654600160a060020a0316331461104c576040805160e560020a62461bcd02815260206004820152602660248201527f43616e206f6e6c792061636365707420707265617070726f766564206e657720604482015260d160020a6537bbb732b91702606482015290519081900360840190fd5b6006546005805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055565b600554600160a060020a031633146110df576040805160e560020a62461bcd0281526020600482015260266024820152600080516020611e5f833981519152604482015260d160020a6537bbb732b91702606482015290519081900360840190fd5b600554600160a060020a0382811691161415611145576040805160e560020a62461bcd02815260206004820152601d60248201527f43616e6e6f7420617070726f76652063757272656e74206f776e65722e000000604482015290519081900360640190fd5b6006805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600554600160a060020a031633146111d6576040805160e560020a62461bcd0281526020600482015260266024820152600080516020611e5f833981519152604482015260d160020a6537bbb732b91702606482015290519081900360840190fd5b3031811115611254576040805160e560020a62461bcd028152602060048201526024808201527f496e63726561736520616d6f756e74206c6172676572207468616e2062616c6160448201527f6e63652e00000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b60095430316001608060020a03808316608060020a909304811692909201909116820111156112cd576040805160e560020a62461bcd02815260206004820152601160248201527f4e6f7420656e6f7567682066756e64732e000000000000000000000000000000604482015290519081900360640190fd5b600980546fffffffffffffffffffffffffffffffff1981166001608060020a039182169390930116919091179055565b600554600160a060020a0316331461135f576040805160e560020a62461bcd0281526020600482015260266024820152600080516020611e5f833981519152604482015260d160020a6537bbb732b91702606482015290519081900360840190fd5b6008805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600954608060020a90046001608060020a031681565b600b5460009081908190600160a060020a03163314611433576040805160e560020a62461bcd02815260206004820152602c60248201527f4f6e6c7943726f7570696572206d6574686f64732063616c6c6564206279206e60448201527f6f6e2d63726f75706965722e0000000000000000000000000000000000000000606482015290519081900360840190fd5b604080516bffffffffffffffffffffffff19808916602080840191909152908816603483015282516028818403018152604890920192839052815191929182918401908083835b602083106114995780518252601f19909201916020918201910161147a565b51815160209384036101000a600019018019909216911617905260408051929094018290039091206000818152600a909252929020600181015492975095505062010000900464ffffffffff169250504382109050611568576040805160e560020a62461bcd02815260206004820152603360248201527f736574746c6542657420696e207468652073616d6520626c6f636b206173207060448201527f6c6163654265742c206f72206265666f72652e00000000000000000000000000606482015290519081900360840190fd5b60fa81014311156115e9576040805160e560020a62461bcd02815260206004820152602260248201527f426c6f636b686173682063616e2774206265207175657269656420627920455660448201527f4d2e000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b80408414611641576040805160e560020a62461bcd02815260206004820152601160248201527f626c6f636b4861736820696e76616c6964000000000000000000000000000000604482015290519081900360640190fd5b61164d82878787611b7e565b505050505050565b6000818152600a6020526040812080549091808215156116e5576040805160e560020a62461bcd02815260206004820152602260248201527f4265742073686f756c6420626520696e20616e2027616374697665272073746160448201527f7465000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600184015464ffffffffff620100009091041660fa014311611777576040805160e560020a62461bcd02815260206004820152602260248201527f426c6f636b686173682063616e2774206265207175657269656420627920455660448201527f4d2e000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b60008455600184015461179790849060ff80821691610100900416611991565b600980546001608060020a03608060020a8083048216869003821602918116919091178082168490039091166fffffffffffffffffffffffffffffffff19919091161790556001860154919350915061180b90600160a060020a036c01000000000000000000000000909104168480611acb565b5050505050565b600554600160a060020a03163314611874576040805160e560020a62461bcd0281526020600482015260266024820152600080516020611e5f833981519152604482015260d160020a6537bbb732b91702606482015290519081900360840190fd5b600b805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600554600160a060020a03163314611905576040805160e560020a62461bcd0281526020600482015260266024820152600080516020611e5f833981519152604482015260d160020a6537bbb732b91702606482015290519081900360840190fd5b693f870857a3e0e3800000811061198c576040805160e560020a62461bcd02815260206004820152602260248201527f6d617850726f6669742073686f756c6420626520612073616e65206e756d626560448201527f722e000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600755565b60008060008360001080156119a65750848411155b15156119fc576040805160e560020a62461bcd02815260206004820152601d60248201527f57696e2070726f626162696c697479206f7574206f662072616e67652e000000604482015290519081900360640190fd5b600254861015611a0d576000611a11565b6004545b6000549092506064908702049050600154811015611a2e57506001545b808201861015611aae576040805160e560020a62461bcd02815260206004820152602260248201527f42657420646f65736e2774206576656e20636f76657220686f7573652065646760448201527f652e000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b8385838389030302811515611abf57fe5b04925050935093915050565b604051600160a060020a0384169083156108fc029084906000818181858888f1935050505015611b3957604080518281529051600160a060020a038516917fd4f43975feb89f48dd30cabbb32011045be187d1e11c8ea9faa43efc35282519919081900360200190a2611b79565b604080518381529051600160a060020a038516917fac464fe4d3a86b9121261ac0a01dd981bfe0777c7c9d9c8f4473d31a9c0f9d2d919081900360200190a25b505050565b8354600185015460ff808216916101008104909116906c010000000000000000000000009004600160a060020a031660008080808080808a1515611c32576040805160e560020a62461bcd02815260206004820152602260248201527f4265742073686f756c6420626520696e20616e2027616374697665272073746160448201527f7465000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b60008f600001819055508d8c8e60405160200180846bffffffffffffffffffffffff19166bffffffffffffffffffffffff191681526014018360001916600019168152602001826bffffffffffffffffffffffff19166bffffffffffffffffffffffff1916815260140193505050506040516020818303038152906040526040518082805190602001908083835b60208310611cdf5780518252601f199092019160209182019101611cc0565b5181516020939093036101000a6000190180199091169216919091179052604051920182900390912099508c925089915050811515611d1a57fe5b069550611d288b8b8b611991565b90955093506000925082915060288a11611d685760018f0154600287900a6701000000000000009091041664ffffffffff1615611d63578492505b611d74565b88861015611d74578492505b600980546001608060020a03608060020a808304821689900382160291161790556002548b10611de7576003548a88811515611dac57fe5b04811515611db657fe5b069050801515611de757600980546fffffffffffffffffffffffffffffffff1981169091556001608060020a031691505b6000821115611e3057604080518381529051600160a060020a038a16917fc388db0e8aa560a59633c094a0d0aa21322cd6234836fd5bac00fc5ae63b5783919081900360200190a25b611e4d8884840115611e4457838501611e47565b60015b85611acb565b50505050505050505050505050505056004f6e6c794f776e6572206d6574686f64732063616c6c6564206279206e6f6e2da165627a7a7230582023402095581a452365a40b5c86a59662ac9f832f26b7bb7e9999234f20fe7ddc0029

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

0000000000000000000000005a5f158fb01b03a9df99337386516ebcbd1b93eb00000000000000000000000001fd2b8c9c81044d37352704f1ce9ada7e1b6ae20000000000000000000000000000000000000000000000001bc16d674ec80000

-----Decoded View---------------
Arg [0] : _secretSigner (address): 0x5a5f158fb01B03A9df99337386516eBCbD1B93eB
Arg [1] : _croupier (address): 0x01FD2b8c9C81044D37352704F1ce9adA7E1b6AE2
Arg [2] : _maxProfit (uint256): 2000000000000000000

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000005a5f158fb01b03a9df99337386516ebcbd1b93eb
Arg [1] : 00000000000000000000000001fd2b8c9c81044d37352704f1ce9ada7e1b6ae2
Arg [2] : 0000000000000000000000000000000000000000000000001bc16d674ec80000


Swarm Source

bzzr://23402095581a452365a40b5c86a59662ac9f832f26b7bb7e9999234f20fe7ddc

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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