Overview
Balance: 0 Ether
Ether Value: $0
Transactions: 7 txns
Misc:
Address Watch: Add To Watch List
 Latest 7 txns

TxHash Age From To Value [TxFee]
0xd8f7a7cb8e5377db9db3e96928e487f8814a6acaad650af61a7f8b69e2b346c9304 days 8 hrs ago0x6f0dc69f855cc34fcf4b67fb8663307a615ea565  IN   0x741f1923974464efd0aa70e77800ba5d9ed189020 Ether0.0000200235
0xe3bd21760e334b153005bd040ab3f23411c1d8cf49f7d9b615e8d35b4ee8e553305 days 11 hrs ago0x6f0dc69f855cc34fcf4b67fb8663307a615ea565  IN   0x741f1923974464efd0aa70e77800ba5d9ed189020.000007777777777 Ether0.000021088
0x72d07bbc8a1d9c0efdc9a94006933936b06b8e63be417d64a208aef2850d392d305 days 12 hrs ago0x6f0dc69f855cc34fcf4b67fb8663307a615ea565  IN   0x741f1923974464efd0aa70e77800ba5d9ed189021.4 Ether0.0000234839
0x7063672e4b4639aa4015279580f04902ee51747bc96ea6c58667a1d8c03442d3305 days 12 hrs ago0x6f0dc69f855cc34fcf4b67fb8663307a615ea565  IN   0x741f1923974464efd0aa70e77800ba5d9ed189020 Ether0.00008013117
0x5be8ee6f54bf9ff82542f27b4c9131dd1d3cc1e199c6798791676e154cf5d3cc305 days 12 hrs ago0x96d31e409d938448b4285f3acc2ed0ab276746e1  IN   0x741f1923974464efd0aa70e77800ba5d9ed189020.1 Ether0.00010278
0x00e953fd06844ddf081690293c6ab2ea4c28ec6c38c9c036c06af43893564f77305 days 12 hrs ago0x6f0dc69f855cc34fcf4b67fb8663307a615ea565  IN   0x741f1923974464efd0aa70e77800ba5d9ed189020.1 Ether0.000064047
0x7ba8096bb1fdd480da3e15cade292c36d0035f2d434257ed1a2b4b3181349cea305 days 12 hrs ago0x6f0dc69f855cc34fcf4b67fb8663307a615ea565  IN    Contract Creation0 Ether0.0006835296
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
 Latest 2 Internal Transactions

ParentTxHash Block Age From To Value
0xd8f7a7cb8e5377db9db3e96928e487f8814a6acaad650af61a7f8b69e2b346c95071507304 days 8 hrs ago0x741f1923974464efd0aa70e77800ba5d9ed189020x6f0dc69f855cc34fcf4b67fb8663307a615ea5651.400007777777777777 Ether
0x5be8ee6f54bf9ff82542f27b4c9131dd1d3cc1e199c6798791676e154cf5d3cc5064481305 days 12 hrs ago0x741f1923974464efd0aa70e77800ba5d9ed189020x96d31e409d938448b4285f3acc2ed0ab276746e10.2 Ether
[ Download CSV Export  ] 
Contract Self Destruct Called At TxHash 0xd8f7a7cb8e5377db9db3e96928e487f8814a6acaad650af61a7f8b69e2b346c9

Warning: The Compiled Contract might be susceptible to ExpExponentCleanup (medium/high-severity), EventStructWrongData (very low-severity), NestedArrayFunctionCallDecoder (medium-severity) SolidityCompiler Bugs.

Contract Source Code Verified (Exact Match)
Contract Name: OpenAddressLottery
Compiler Text: v0.4.19+commit.c4cbbb05
Optimization Enabled: No
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts

pragma solidity ^0.4.19;
/*
 * This is a distributed lottery that chooses random addresses as lucky addresses. If these
 * participate, they get the jackpot: 7 times the price of their bet.
 * Of course one address can only win once. The owner regularly reseeds the secret
 * seed of the contract (based on which the lucky addresses are chosen), so if you did not win,
 * just wait for a reseed and try again!
 *
 * Jackpot chance:   1 in 8
 * Ticket price: Anything larger than (or equal to) 0.1 ETH
 * Jackpot size: 7 times the ticket price
 *
 * HOW TO PARTICIPATE: Just send any amount greater than (or equal to) 0.1 ETH to the contract's address
 * Keep in mind that your address can only win once
 *
 * If the contract doesn't have enough ETH to pay the jackpot, it sends the whole balance.
*/

contract OpenAddressLottery{
    struct SeedComponents{
        uint component1;
        uint component2;
        uint component3;
        uint component4;
    }
    
    address owner; //address of the owner
    uint private secretSeed; //seed used to calculate number of an address
    uint private lastReseed; //last reseed - used to automatically reseed the contract every 1000 blocks
    uint LuckyNumber = 7; //if the number of an address equals 7, it wins
        
    mapping (address => bool) winner; //keeping track of addresses that have already won
    
    function OpenAddressLottery() {
        owner = msg.sender;
        reseed(SeedComponents((uint)(block.coinbase), block.difficulty, block.gaslimit, block.timestamp)); //generate a quality random seed
    }
    
    function participate() payable {
        if(msg.value<0.1 ether)
            return; //verify ticket price
        
        // make sure he hasn't won already
        require(winner[msg.sender] == false);
        
        if(luckyNumberOfAddress(msg.sender) == LuckyNumber){ //check if it equals 7
            winner[msg.sender] = true; // every address can only win once
            
            uint win=msg.value*7; //win = 7 times the ticket price
            
            if(win>this.balance) //if the balance isnt sufficient...
                win=this.balance; //...send everything we've got
            msg.sender.transfer(win);
        }
        
        if(block.number-lastReseed>1000) //reseed if needed
            reseed(SeedComponents((uint)(block.coinbase), block.difficulty, block.gaslimit, block.timestamp)); //generate a quality random seed
    }
    
    function luckyNumberOfAddress(address addr) constant returns(uint n){
        // calculate the number of current address - 1 in 8 chance
        n = uint(keccak256(uint(addr), secretSeed)[0]) % 8;
    }
    
    function reseed(SeedComponents components) internal {
        secretSeed = uint256(keccak256(
            components.component1,
            components.component2,
            components.component3,
            components.component4
        )); //hash the incoming parameters and use the hash to (re)initialize the seed
        lastReseed = block.number;
    }
    
    function kill() {
        require(msg.sender==owner);
        
        selfdestruct(msg.sender);
    }
    
    function forceReseed() { //reseed initiated by the owner - for testing purposes
        require(msg.sender==owner);
        
        SeedComponents s;
        s.component1 = uint(msg.sender);
        s.component2 = uint256(block.blockhash(block.number - 1));
        s.component3 = block.difficulty*(uint)(block.coinbase);
        s.component4 = tx.gasprice * 7;
        
        reseed(s); //reseed
    }
    
    function () payable { //if someone sends money without any function call, just assume he wanted to participate
        if(msg.value>=0.1 ether && msg.sender!=owner) //owner can't participate, he can only fund the jackpot
            participate();
    }

}

    Contract ABI  
[{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"luckyNumberOfAddress","outputs":[{"name":"n","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"kill","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"forceReseed","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"participate","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"}]

  Contract Creation Code Switch To Opcodes View
60606040526007600355341561001457600080fd5b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506100a76080604051908101604052804173ffffffffffffffffffffffffffffffffffffffff168152602001448152602001458152602001428152506100ac64010000000002610519176401000000009004565b6100fe565b8060000151816020015182604001518360600151604051808581526020018481526020018381526020018281526020019450505050506040518091039020600190046001819055504360028190555050565b6105978061010d6000396000f300606060405260043610610062576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806337354a68146100d757806341c0e1b51461012457806380ca7aec14610139578063d11711a21461014e575b67016345785d8a000034101580156100c757506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b156100d5576100d4610158565b5b005b34156100e257600080fd5b61010e600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061030c565b6040518082815260200191505060405180910390f35b341561012f57600080fd5b6101376103ab565b005b341561014457600080fd5b61014c61041f565b005b610156610158565b005b600067016345785d8a000034101561016f57610309565b60001515600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415156101ce57600080fd5b6003546101da3361030c565b14156102b9576001600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506007340290503073ffffffffffffffffffffffffffffffffffffffff1631811115610278573073ffffffffffffffffffffffffffffffffffffffff163190505b3373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015156102b857600080fd5b5b6103e860025443031115610308576103076080604051908101604052804173ffffffffffffffffffffffffffffffffffffffff16815260200144815260200145815260200142815250610519565b5b5b50565b600060088273ffffffffffffffffffffffffffffffffffffffff1660015460405180838152602001828152602001925050506040518091039020600060208110151561035457fe5b1a7f0100000000000000000000000000000000000000000000000000000000000000027f010000000000000000000000000000000000000000000000000000000000000090048115156103a357fe5b069050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561040657600080fd5b3373ffffffffffffffffffffffffffffffffffffffff16ff5b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561047c57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff16816000018190555060014303406001900481600101819055504173ffffffffffffffffffffffffffffffffffffffff164402816002018190555060073a0281600301819055506105168160806040519081016040529081600082015481526020016001820154815260200160028201548152602001600382015481525050610519565b50565b80600001518160200151826040015183606001516040518085815260200184815260200183815260200182815260200194505050505060405180910390206001900460018190555043600281905550505600a165627a7a723058206b596e01d5865f77a048963f5552069d7c81e298834762b54349dc70ffffe0d00029

   Swarm Source:
bzzr://6b596e01d5865f77a048963f5552069d7c81e298834762b54349dc70ffffe0d0

 

View All
Block Age transaction Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.