TossMyCoin (50% chance of win) and verified contract

TdechaTdecha Member Posts: 6
edited April 2016 in Smart Contracts and Dapps
Dear all,

After LittleCactus, let me present you "TossMyCoin"

This is a fair tossing coin game where one can win 180% of its bet. There is 1 chance on 2 to win and 1 chance on 2 to lose. Besides, it is already precharged with a few ETH :p

How to enter ?

Send at least 0.01 ETH to 0xEE1a0710FcC892999D39A1710f2C16Dba1F28ae6
To send ETH, you have to use the official wallet or use the geth command line

eth.sendTransaction({from: eth.coinbase, value: web3.toWei(1, 'ether'), to: '0xEE1a0710FcC892999D39A1710f2C16Dba1F28ae6', gas: 250000})

Contract verified :

What are the rules ?

To take a bet, simply send at least 0.01 ETH to the contract. If your bet is higher than 80% the current balance of the contract, the excess is returned to you and only the remaining in the contract is bet on.
You have 50% chance to win.


Although the contract code is verified, this is a bet game which means that it doesn't create value. It only redistributes investments according to the code.
This might seem to be a game but it's still money you are sending in the end. The creator is not in charge of the holdings, everything is on the blockchain.
Please review the code before investing


  • falxfalx Member Posts: 6
    edited April 2016
    You're kidding, right ?

    var toss = uint(sha3(msg.gas)) + uint(sha3(block.timestamp));
    if (toss % 2 == 0){
    balance = balance + amount ;
    reward = amount * 2;

    1. This code in no way produces a "fair" coin, because it almost certainly won't produce random coin tosses. This code will NEVER pass a randomness test.

    2. Get ready to have your contract drained with impunity, because the seed [sha3(msg.gas) + sha3(block.timestamp)] is predictible.

    Malroy can break this contract in two ways:

    a) By detecting the bias in the toss output and capitalize on that.
    b) By predicting the seed and choosing to bet at advantageous times.

    How do you expect to make money with this ?
    Post edited by falx on
Sign In or Register to comment.