Skip to content
Verified contractPartial

BitcoinDice

Address0xa9340192a30a64978cd8dc131071ce66019d50fc
Balance

0 ETH

 

Transactions

2

 

Compiler

solc 0.1.6

 

Same code

Only this contract

 

Details

Compiler
solc 0.1.6+commit.d41f8b7c
Language
solidity
Optimization
No
License
Not stated
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
464,859
Creation transaction
0x788be8bae5…770428f574

BitcoinDice.sol

// Recovered by EthereumHistory (ethereumhistory.com) -sw
contract EtherDice {
    function bet(uint8 a, bool b, uint8 c) returns (int);
}

contract BitcoinBridge {
    function queuePayment(bytes data) returns (bool);
}

contract BitcoinDice {
    address public bitcoinBridge;
    address public etherdice;
    bool locked = false;
    uint lockedAt;
    bytes data;

    function BitcoinDice(address _bitcoinBridge, address _etherdice) {
        bitcoinBridge = _bitcoinBridge;
        etherdice = _etherdice;
    }

    function() {
        if (msg.sender != etherdice) {
            if (locked && now - lockedAt < 7200) {
                msg.sender.send(msg.value);
                return;
            }
            if (EtherDice(etherdice).bet.value(msg.value).gas(500000)(11, true, 1) == -1) {
                msg.sender.send(msg.value);
                return;
            }
            locked = true;
            lockedAt = now;
            data = msg.data;
        } else {
            BitcoinBridge(bitcoinBridge).queuePayment.value(msg.value)(data);
            locked = false;
        }
    }
}
Compiler settingsShow
{
  "optimizer": {
    "runs": 200,
    "enabled": false
  }
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.