Skip to content
Verified contractPartial

Lottery

Address0xa80fb59eee33ed9ea3f2d5a725be3f0e2f8b8545
Balance

0.0001 ETH

 

Transactions

13

 

Compiler

solc 0.1.3

 

Same code

Only this contract

 

Details

Compiler
solc 0.1.3+commit.028f561d
Language
solidity
Optimization
No
License
Not stated
Match
Partialcreation code: no, runtime code: yes
Verified on Sourcify
Created in block
131,640
Creation transaction
0xf693e9482a…4a87d69460

Lottery.sol

// Recovered by EthereumHistory (ethereumhistory.com) -sw
contract owned {
    address owner;
    function owned() { owner = msg.sender; }
}
contract mortal is owned {
    function kill() { if (msg.sender == owner) suicide(owner); }
}
contract Lottery is mortal {
    struct Entry {
        address player;
        uint amount;
        uint time;
    }
    address creator;
    uint prizePool;
    uint ticketPrice;
    uint numEntries;
    mapping (uint => Entry) entries;
    uint lastDraw;

    event PrintStr(string message);
    event PrintInt(uint value);
    event Play(address indexed player, uint indexed amount, uint[] numbers);

    function Lottery() { creator = msg.sender; }

    function play(uint[] numbers, int x, bool y) {
        if (msg.value < 100000000000000) { PrintStr("Not enough ETH"); return; }
        else PrintStr("OK");
        entries[numEntries] = Entry(msg.sender, msg.value, now);
        numEntries = numEntries + 1;
        prizePool = prizePool + msg.value;
        Play(msg.sender, msg.value, numbers);
        uint ts = now;
        uint minute = now / 60;
        if (minute > lastDraw) {
            PrintStr("Run draw");
            runDraw();
            lastDraw = minute;
        }
    }
    function getNumEntries() returns (uint n) { n = numEntries; }
    function getPrizePool() returns (uint p) { p = prizePool; }
    function getInfo() returns (uint r) { entries; r = 1; }
    function runDraw() {
        uint total = 0;
        PrintStr("nEntries");
        PrintInt(numEntries);
        for (uint8 i = 0; i < numEntries; i++) {
            Entry e = entries[i];
            PrintInt(e.time);
            total = total + e.time;
        }
        PrintStr("***");
        PrintInt(total);
        PrintStr("***");
        numEntries = 0;
    }
}
Compiler settingsShow
{
  "optimizer": {
    "runs": 200,
    "enabled": false
  }
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.