Contract Overview
Balance: 0.189 Ether
Ether Value: $15.62 (@ $82.66/ETH)
Transactions: 120 txns
Misc:
Address Watch: Add To Watch List
Contract Creator: 0x42abdd654de6aba2d157a1ba39245ea596eb9717at txn 0xb13e77dd6ccdadedeae73a9526f7a192d8201e44cba01d9661f473e0fd40b3e8
Token Balance:
 Latest 25 transactions from a total of 120 transactions

TxHash Age From To Value [TxFee]
0x80528b165cde1ed21ee4c53fa3c0db569c8ffb0b90e59d83f6d42241750f9f32420 days 23 hrs ago0x8b6514ac8be8c00ca388b027b8f82853002946df  IN   0x608c460a08b10ca06b9b5fe45451cf2552fa2e4f0.045 Ether0.000863631
0x7586c358a3b4dd3688741ca5fb75d9e86f31f4153528a64ab9a7ebc8137f6856420 days 23 hrs ago0x8b6514ac8be8c00ca388b027b8f82853002946df  IN   0x608c460a08b10ca06b9b5fe45451cf2552fa2e4f0.045 Ether0.001438745
0x109ac22ff13c70522d65210ca69621a05e19873649b127aac772da8fd678fdf0421 days 5 mins ago0xaa9e5c82810e553f87d92c84180f1d7a39fff8dd  IN   0x608c460a08b10ca06b9b5fe45451cf2552fa2e4f0.045 Ether0.000287813
0x5a1e04213992154de6cbcc65b15622d5cf9e572d46c31b1694cd8ba33fd34e48421 days 11 mins ago0x8b6514ac8be8c00ca388b027b8f82853002946df  IN   0x608c460a08b10ca06b9b5fe45451cf2552fa2e4f0.009 Ether0.000025492
0xf9128d0b122831a8db732da53d4aa83c4667129d3585ff23f08a63582444d10e421 days 15 mins ago0x78e8c455c998d5a023ce5df5296702bead0b4cd1  IN   0x608c460a08b10ca06b9b5fe45451cf2552fa2e4f0.045 Ether0.004448486
0x96d92fa314462ce45addb6c8d267c3530e1744829d4bb3739a13c7416b24a113421 days 20 mins ago0x78e8c455c998d5a023ce5df5296702bead0b4cd1  IN   0x608c460a08b10ca06b9b5fe45451cf2552fa2e4f0 Ether0.003083094
0xa426ef044120847990214bb52b334b0175e8a30f19d6a2ea31b0dc8b143f4d69421 days 30 mins ago0x1d858dfbff7d2557e86a92e7a5593981bea12c94  IN   0x608c460a08b10ca06b9b5fe45451cf2552fa2e4f0 Ether0.000114298
0xf4c773c08e0ad01f7e050f1d80cec53287c2c73a66d51b09e63c236557f0417c421 days 31 mins ago0x1d858dfbff7d2557e86a92e7a5593981bea12c94  IN   0x608c460a08b10ca06b9b5fe45451cf2552fa2e4f0 Ether0.000240964
0xb8b0de13716b232fe83e1514db814734979a0ed3bce84fe3fc8fc0a35f97a211421 days 7 hrs ago0x1d858dfbff7d2557e86a92e7a5593981bea12c94  IN   0x608c460a08b10ca06b9b5fe45451cf2552fa2e4f0 Ether0.000062879
0x6893f02c64c131fe06ee054c51173373518a433e980323063798b1b6458a8ad2421 days 8 hrs ago0x962e2a26874d64b0e078d3bba3c4c7c931628756  IN   0x608c460a08b10ca06b9b5fe45451cf2552fa2e4f0.045 Ether0.004031174
0xc346a78d2299549a102cb3dbb94618e57a40187319397556bf72d840db0e7287421 days 10 hrs ago0xc4a624705b860cf51f4403de84dd5f8dd9df1a80  IN   0x608c460a08b10ca06b9b5fe45451cf2552fa2e4f0.045 Ether0.001439385
0xd1baac3bececedc9fcd3e9ddb1d7283a6983df57eaafdd7f29672d8f16045caa421 days 11 hrs ago0x9fc9dc228c4ef7f9c3e3440136de537b48e32c42  IN   0x608c460a08b10ca06b9b5fe45451cf2552fa2e4f0.045 Ether0.004028486
0x9b99d27e4c6f333e7811404b09c1519386613cdbe2115e9c01d71ef2cd34088e421 days 11 hrs ago0x7387546e70a7268c4b23170cba4f74b95af3e9ec  IN   0x608c460a08b10ca06b9b5fe45451cf2552fa2e4f0.018 Ether0.000144486
0xee0f39d7348ec4cc074687cc6d8c314a77bfb76e93ce9f0d4b2d506ee2d85976421 days 13 hrs ago0xe8d9ad4bfcd008cd7c2cad26c0f13b2bfcf5d588  IN   0x608c460a08b10ca06b9b5fe45451cf2552fa2e4f0.045 Ether0.002589741
0xa54f688d54318e7f65b996ebecddb8363e1a3c018de4acf6d42a8cca3c8ce712421 days 16 hrs ago0xf5dc757b459e0a5b1ccb43b40aa32295e80cbade  IN   0x608c460a08b10ca06b9b5fe45451cf2552fa2e4f0.045 Ether0.004028486
0x6cc8508fae4fc6e71429ca05a4a7d0d10dfaa646c0767c82891e84070f8aa74b421 days 16 hrs ago0xd030d38ef928071f6297f8edbe2d10177afa75dc  IN   0x608c460a08b10ca06b9b5fe45451cf2552fa2e4f0.036 Ether0.000240016
0x50b07f5de3973f0371f2aabecc1aa767ab4aa501410daaa76b26de19b7272795421 days 17 hrs ago0xd030d38ef928071f6297f8edbe2d10177afa75dc  IN   0x608c460a08b10ca06b9b5fe45451cf2552fa2e4f0.009 Ether0.000096753
0x9c9698161e7cbf0be8b88b53cecbf7f71f611c08d79d3b621e63ee873cdcfc52421 days 18 hrs ago0x971617c423caf0d868d0d8475329342576fa38aa  IN   0x608c460a08b10ca06b9b5fe45451cf2552fa2e4f0.009 Ether0.002031813
0x8d3a874b0b534d67805a9cf8e858023111a26f900f5d9cdb4f743bb45445e3da421 days 18 hrs ago0xdcdd945cd685193f68e395583221dfe445f0ba0c  IN   0x608c460a08b10ca06b9b5fe45451cf2552fa2e4f0.045 Ether0.000287749
0x86095c5c610643fd2c63cf2206dcf83cf771339a1488c60ac19f57bd55be17ec421 days 18 hrs ago0xaa9e5c82810e553f87d92c84180f1d7a39fff8dd  IN   0x608c460a08b10ca06b9b5fe45451cf2552fa2e4f0.045 Ether0.000287877
0x31ff31159be6d521bc006f4f7b7e923a2822b5419bc3618da78b6db2bbbaa1d9421 days 19 hrs ago0xaa9e5c82810e553f87d92c84180f1d7a39fff8dd  IN   0x608c460a08b10ca06b9b5fe45451cf2552fa2e4f0.045 Ether0.000287813
0x0d1d032ad3f88be0663f21e0465dfa261e2b47867663f5fa4ea3f670406976f7421 days 19 hrs ago0x4526eeb81f23733c5d19ccb6fa1ba632d310cd12  IN   0x608c460a08b10ca06b9b5fe45451cf2552fa2e4f0.045 Ether0.006045417
0x591a428e3adfad8e99074c1a68d075a322a1ab0019147f5f251caa4a5525efb6421 days 19 hrs ago0x164b1a5b7ddddb868d83f2e28187636a1e03e3b1  IN   0x608c460a08b10ca06b9b5fe45451cf2552fa2e4f0.009 Ether0.000774024
0xc700deb5ec914616403104a2ce629635e62460b024aa794ee164ed7becfb20aa423 days 5 hrs ago0x190f0723374774dc44fa2a1ffa68f44b8274dec4  IN   0x608c460a08b10ca06b9b5fe45451cf2552fa2e4f0.018 Ether0.000144486
0x233588ef32facc574e93fc8495873861d76def65831b49cfba40e668d2cabbfa423 days 10 hrs ago0x190f0723374774dc44fa2a1ffa68f44b8274dec4  IN   0x608c460a08b10ca06b9b5fe45451cf2552fa2e4f0.045 Ether0.000287941
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
 Latest 2 Internal Transactions

ParentTxHash Block Age From To Value
0xa426ef044120847990214bb52b334b0175e8a30f19d6a2ea31b0dc8b143f4d694396456421 days 30 mins ago0x608c460a08b10ca06b9b5fe45451cf2552fa2e4f0x549b38e8e5fb1ba4acd4187d8b7c8a04deb532060.542 Ether
0xa426ef044120847990214bb52b334b0175e8a30f19d6a2ea31b0dc8b143f4d694396456421 days 30 mins ago0x608c460a08b10ca06b9b5fe45451cf2552fa2e4f0x78e8c455c998d5a023ce5df5296702bead0b4cd12.5 Ether
[ Download CSV Export  ] 
Warning: The Compiled Contract might be susceptible to ExpExponentCleanup (medium/high-severity), EventStructWrongData (very low-severity), NestedArrayFunctionCallDecoder (medium-severity), ZeroFunctionSelector (very low-severity) SolidityCompiler Bugs.

Contract Source Code Verified (Exact Match)
Contract Name: EthereumLottery
Compiler Text: v0.4.17+commit.bdeb9e52
Optimization Enabled: Yes
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts

pragma solidity ^0.4.15;

contract BTCRelay {
    function getLastBlockHeight() public returns (int);
    function getBlockchainHead() public returns (int);
    function getFeeAmount(int blockHash) public returns (int);
    function getBlockHeader(int blockHash) public returns (bytes32[5]);
    function storeBlockHeader(bytes blockHeader) public returns (int);
}

contract Escrow {
    function deposit(address recipient) payable;
}

contract EthereumLottery {
    uint constant GAS_LIMIT_DEPOSIT = 300000;
    uint constant GAS_LIMIT_BUY = 450000;

    struct Lottery {
        uint jackpot;
        int decidingBlock;
        uint numTickets;
        uint numTicketsSold;
        uint ticketPrice;
        int winningTicket;
        address winner;
        uint finalizationBlock;
        address finalizer;
        string message;
        mapping (uint => address) tickets;
        int nearestKnownBlock;
        int nearestKnownBlockHash;
    }

    address public owner;
    address public admin;
    address public proposedOwner;

    int public id = -1;
    uint public lastInitTimestamp;
    uint public lastSaleTimestamp;

    uint public recentActivityIdx;
    uint[1000] public recentActivity;

    mapping (int => Lottery) public lotteries;

    address public btcRelay;
    address public escrow;

    enum Reason { TicketSaleClosed, TicketAlreadySold, InsufficientGas }
    event PurchaseFailed(address indexed buyer, uint mark, Reason reason);
    event PurchaseSuccessful(address indexed buyer, uint mark);

    modifier onlyOwner {
        require(msg.sender == owner);
        _;
    }

    modifier onlyAdminOrOwner {
        require(msg.sender == owner || msg.sender == admin);
        _;
    }

    modifier afterInitialization {
        require(id >= 0);
        _;
    }

    function EthereumLottery(address _btcRelay,
                             address _escrow) {
        owner = msg.sender;
        admin = msg.sender;
        btcRelay = _btcRelay;
        escrow = _escrow;
    }

    function needsInitialization() constant returns (bool) {
        return id == -1 || lotteries[id].finalizationBlock > 0;
    }

    function initLottery(uint _jackpot, uint _numTickets, uint _ticketPrice)
             onlyAdminOrOwner {
        require(needsInitialization());
        require(_numTickets * _ticketPrice > _jackpot);

        id += 1;
        lotteries[id].jackpot = _jackpot;
        lotteries[id].decidingBlock = -1;
        lotteries[id].numTickets = _numTickets;
        lotteries[id].ticketPrice = _ticketPrice;
        lotteries[id].winningTicket = -1;

        lastInitTimestamp = block.timestamp;
        lastSaleTimestamp = 0;
    }

    function buyTickets(uint[] _tickets, uint _mark, bytes _extraData)
             payable afterInitialization {
        if (msg.gas < GAS_LIMIT_BUY) {
            PurchaseFailed(msg.sender, _mark, Reason.InsufficientGas);
            return;
        }

        if (lotteries[id].numTicketsSold == lotteries[id].numTickets) {
            PurchaseFailed(msg.sender, _mark, Reason.TicketSaleClosed);
            return;
        }

        require(_tickets.length > 0);
        require(msg.value == _tickets.length * lotteries[id].ticketPrice);

        for (uint i = 0; i < _tickets.length; i++) {
            uint ticket = _tickets[i];
            require(ticket >= 0);
            require(ticket < lotteries[id].numTickets);

            if (lotteries[id].tickets[ticket] != 0) {
                PurchaseFailed(msg.sender, _mark, Reason.TicketAlreadySold);
                return;
            }
        }

        for (i = 0; i < _tickets.length; i++) {
            ticket = _tickets[i];
            lotteries[id].tickets[ticket] = msg.sender;
            recentActivity[recentActivityIdx] = ticket;

            recentActivityIdx += 1;
            if (recentActivityIdx >= recentActivity.length) {
                recentActivityIdx = 0;
            }
        }

        lotteries[id].numTicketsSold += _tickets.length;
        lastSaleTimestamp = block.timestamp;

        BTCRelay(btcRelay).storeBlockHeader(_extraData);

        PurchaseSuccessful(msg.sender, _mark);
    }

    function needsBlockFinalization()
             afterInitialization constant returns (bool) {
        // Check the timestamp of the latest block known to BTCRelay
        // and require it to be no more than 2 hours older than the
        // timestamp of our block. This should ensure that BTCRelay
        // is reasonably up to date.
        uint btcTimestamp;
        int blockHash = BTCRelay(btcRelay).getBlockchainHead();
        (,btcTimestamp) = getBlockHeader(blockHash);

        uint delta = 0;
        if (btcTimestamp < block.timestamp) {
            delta = block.timestamp - btcTimestamp;
        }

        return delta < 2 * 60 * 60 &&
               lotteries[id].numTicketsSold == lotteries[id].numTickets &&
               lotteries[id].decidingBlock == -1;
    }

    function finalizeBlock()
             afterInitialization {
        require(needsBlockFinalization());

        // At this point we know that the timestamp of the latest block
        // known to BTCRelay is within 2 hours of what the Ethereum network
        // considers 'now'. If we assume this to be correct within +/- 3 hours,
        // we can conclude that 'out there' in the real world at most 5 hours
        // have passed. Assuming an actual block time of 9 minutes for Bitcoin,
        // we can use the Poisson distribution to calculate, that if we wait for
        // 54 more blocks, then the probability for all of these 54 blocks
        // having already been mined in 5 hours is less than 0.1 %.
        int blockHeight = BTCRelay(btcRelay).getLastBlockHeight();
        lotteries[id].decidingBlock = blockHeight + 54;
    }

    function needsLotteryFinalization()
             afterInitialization constant returns (bool) {
        int blockHeight = BTCRelay(btcRelay).getLastBlockHeight();
        return lotteries[id].decidingBlock != -1 &&
               blockHeight >= lotteries[id].decidingBlock + 6 &&
               lotteries[id].finalizationBlock == 0;
    }

    function finalizeLottery(uint _steps)
             afterInitialization {
        require(needsLotteryFinalization());

        if (lotteries[id].nearestKnownBlock != lotteries[id].decidingBlock) {
            walkTowardsBlock(_steps);
        } else {
            int winningTicket = lotteries[id].nearestKnownBlockHash %
                                int(lotteries[id].numTickets);
            address winner = lotteries[id].tickets[uint(winningTicket)];

            lotteries[id].winningTicket = winningTicket;
            lotteries[id].winner = winner;
            lotteries[id].finalizationBlock = block.number;
            lotteries[id].finalizer = tx.origin;

            if (winner != 0) {
                uint value = lotteries[id].jackpot;
                bool successful =
                    winner.call.gas(GAS_LIMIT_DEPOSIT).value(value)();
                if (!successful) {
                    Escrow(escrow).deposit.value(value)(winner);
                }
            }

            var _ = admin.call.gas(GAS_LIMIT_DEPOSIT).value(this.balance)();
        }
    }

    function walkTowardsBlock(uint _steps) internal {
        int blockHeight;
        int blockHash;
        if (lotteries[id].nearestKnownBlock == 0) {
            blockHeight = BTCRelay(btcRelay).getLastBlockHeight();
            blockHash = BTCRelay(btcRelay).getBlockchainHead();
        } else {
            blockHeight = lotteries[id].nearestKnownBlock;
            blockHash = lotteries[id].nearestKnownBlockHash;
        }

        // Walk only a few steps to keep an upper limit on gas costs.
        for (uint step = 0; step < _steps; step++) {
            blockHeight -= 1;
            (blockHash,) = getBlockHeader(blockHash);

            if (blockHeight == lotteries[id].decidingBlock) { break; }
        }

        // Store the progress to pick up from there next time.
        lotteries[id].nearestKnownBlock = blockHeight;
        lotteries[id].nearestKnownBlockHash = blockHash;
    }

    function getBlockHeader(int blockHash)
             internal returns (int prevBlockHash, uint timestamp) {
        // We expect free access to BTCRelay.
        int fee = BTCRelay(btcRelay).getFeeAmount(blockHash);
        require(fee == 0);

        // Code is based on tjade273's BTCRelayTools.
        bytes32[5] memory blockHeader =
            BTCRelay(btcRelay).getBlockHeader(blockHash);

        prevBlockHash = 0;
        for (uint i = 0; i < 32; i++) {
            uint pos = 68 + i;  // prev. block hash starts at position 68
            byte data = blockHeader[pos / 32][pos % 32];
            prevBlockHash = prevBlockHash | int(data) * int(0x100 ** i);
        }

        timestamp = 0;
        for (i = 0; i < 4; i++) {
            pos = 132 + i;  // timestamp starts at position 132
            data = blockHeader[pos / 32][pos % 32];
            timestamp = timestamp | uint(data) * uint(0x100 ** i);
        }

        return (prevBlockHash, timestamp);
    }

    function getMessageLength(string _message) constant returns (uint) {
        return bytes(_message).length;
    }

    function setMessage(int _id, string _message)
             afterInitialization {
        require(lotteries[_id].winner != 0);
        require(lotteries[_id].winner == msg.sender);
        require(getMessageLength(_message) <= 500);
        lotteries[_id].message = _message;
    }

    function getLotteryDetailsA(int _id)
             constant returns (int _actualId, uint _jackpot,
                               int _decidingBlock,
                               uint _numTickets, uint _numTicketsSold,
                               uint _lastSaleTimestamp, uint _ticketPrice) {
        if (_id == -1) {
            _actualId = id;
        } else {
            _actualId = _id;
        }
        _jackpot = lotteries[_actualId].jackpot;
        _decidingBlock = lotteries[_actualId].decidingBlock;
        _numTickets = lotteries[_actualId].numTickets;
        _numTicketsSold = lotteries[_actualId].numTicketsSold;
        _lastSaleTimestamp = lastSaleTimestamp;
        _ticketPrice = lotteries[_actualId].ticketPrice;
    }

    function getLotteryDetailsB(int _id)
             constant returns (int _actualId,
                               int _winningTicket, address _winner,
                               uint _finalizationBlock, address _finalizer,
                               string _message,
                               int _prevLottery, int _nextLottery,
                               int _blockHeight) {
        if (_id == -1) {
            _actualId = id;
        } else {
            _actualId = _id;
        }
        _winningTicket = lotteries[_actualId].winningTicket;
        _winner = lotteries[_actualId].winner;
        _finalizationBlock = lotteries[_actualId].finalizationBlock;
        _finalizer = lotteries[_actualId].finalizer;
        _message = lotteries[_actualId].message;

        if (_actualId == 0) {
            _prevLottery = -1;
        } else {
            _prevLottery = _actualId - 1;
        }
        if (_actualId == id) {
            _nextLottery = -1;
        } else {
            _nextLottery = _actualId + 1;
        }

        _blockHeight = BTCRelay(btcRelay).getLastBlockHeight();
    }

    function getTicketDetails(int _id, uint _offset, uint _n, address _addr)
             constant returns (uint8[] details) {
        require(_offset + _n <= lotteries[_id].numTickets);

        details = new uint8[](_n);
        for (uint i = 0; i < _n; i++) {
            address addr = lotteries[_id].tickets[_offset + i];
            if (addr == _addr && _addr != 0) {
                details[i] = 2;
            } else if (addr != 0) {
                details[i] = 1;
            } else {
                details[i] = 0;
            }
        }
    }

    function getTicketOwner(int _id, uint _ticket) constant returns (address) {
        require(_id >= 0);
        return lotteries[_id].tickets[_ticket];
    }

    function getRecentActivity()
             constant returns (int _id, uint _idx, uint[1000] _recentActivity) {
        _id = id;
        _idx = recentActivityIdx;
        for (uint i = 0; i < recentActivity.length; i++) {
            _recentActivity[i] = recentActivity[i];
        }
    }

    function setAdmin(address _admin) onlyOwner {
        admin = _admin;
    }

    function proposeOwner(address _owner) onlyOwner {
        proposedOwner = _owner;
    }

    function acceptOwnership() {
        require(proposedOwner != 0);
        require(msg.sender == proposedOwner);
        owner = proposedOwner;
    }
}

    Contract ABI  
[{"constant":true,"inputs":[],"name":"lastInitTimestamp","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"int256"}],"name":"lotteries","outputs":[{"name":"jackpot","type":"uint256"},{"name":"decidingBlock","type":"int256"},{"name":"numTickets","type":"uint256"},{"name":"numTicketsSold","type":"uint256"},{"name":"ticketPrice","type":"uint256"},{"name":"winningTicket","type":"int256"},{"name":"winner","type":"address"},{"name":"finalizationBlock","type":"uint256"},{"name":"finalizer","type":"address"},{"name":"message","type":"string"},{"name":"nearestKnownBlock","type":"int256"},{"name":"nearestKnownBlockHash","type":"int256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_tickets","type":"uint256[]"},{"name":"_mark","type":"uint256"},{"name":"_extraData","type":"bytes"}],"name":"buyTickets","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"recentActivity","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"needsBlockFinalization","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"needsLotteryFinalization","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_id","type":"int256"},{"name":"_offset","type":"uint256"},{"name":"_n","type":"uint256"},{"name":"_addr","type":"address"}],"name":"getTicketDetails","outputs":[{"name":"details","type":"uint8[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_message","type":"string"}],"name":"getMessageLength","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_admin","type":"address"}],"name":"setAdmin","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"finalizeBlock","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"acceptOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_id","type":"int256"}],"name":"getLotteryDetailsB","outputs":[{"name":"_actualId","type":"int256"},{"name":"_winningTicket","type":"int256"},{"name":"_winner","type":"address"},{"name":"_finalizationBlock","type":"uint256"},{"name":"_finalizer","type":"address"},{"name":"_message","type":"string"},{"name":"_prevLottery","type":"int256"},{"name":"_nextLottery","type":"int256"},{"name":"_blockHeight","type":"int256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getRecentActivity","outputs":[{"name":"_id","type":"int256"},{"name":"_idx","type":"uint256"},{"name":"_recentActivity","type":"uint256[1000]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"recentActivityIdx","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"id","outputs":[{"name":"","type":"int256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"int256"},{"name":"_message","type":"string"}],"name":"setMessage","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_owner","type":"address"}],"name":"proposeOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"needsInitialization","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_jackpot","type":"uint256"},{"name":"_numTickets","type":"uint256"},{"name":"_ticketPrice","type":"uint256"}],"name":"initLottery","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"proposedOwner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"btcRelay","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_id","type":"int256"}],"name":"getLotteryDetailsA","outputs":[{"name":"_actualId","type":"int256"},{"name":"_jackpot","type":"uint256"},{"name":"_decidingBlock","type":"int256"},{"name":"_numTickets","type":"uint256"},{"name":"_numTicketsSold","type":"uint256"},{"name":"_lastSaleTimestamp","type":"uint256"},{"name":"_ticketPrice","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"escrow","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_id","type":"int256"},{"name":"_ticket","type":"uint256"}],"name":"getTicketOwner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_steps","type":"uint256"}],"name":"finalizeLottery","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"lastSaleTimestamp","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"admin","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_btcRelay","type":"address"},{"name":"_escrow","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"buyer","type":"address"},{"indexed":false,"name":"mark","type":"uint256"},{"indexed":false,"name":"reason","type":"uint8"}],"name":"PurchaseFailed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"buyer","type":"address"},{"indexed":false,"name":"mark","type":"uint256"}],"name":"PurchaseSuccessful","type":"event"}]

  Contract Creation Code Switch To Opcodes View
6060604052600019600355341561001557600080fd5b604051604080611c1c833981016040528080519190602001805160008054600160a060020a03338116600160a060020a031992831681179093556001805483169093179092556103f08054968316968216969096179095556103f18054919092169416939093179092555050611b8c806100906000396000f3006060604052361561014e5763ffffffff60e060020a60003504166302baaf408114610153578063179b51b1146101785780631b33157a146102975780631b7cf89914610328578063347cda881461033e5780633a79a55c146103655780634d4aa77f146103785780635f8af054146103f3578063704b6c021461044457806375395a581461046357806379ba5097146104765780637bf0e0541461048957806388d0b42d146105735780638da5cb5b146105ce578063a509b030146105fd578063af640d0f14610610578063b3a1362a14610623578063b5ed298a14610679578063b625353914610698578063b91bb31c146106ab578063d153b60c146106c7578063debbc6eb146106da578063e23caa06146106ed578063e2fdcc1714610741578063e67eed4414610754578063ea7f7a591461076d578063f5c217da14610783578063f851a44014610796575b600080fd5b341561015e57600080fd5b6101666107a9565b60405190815260200160405180910390f35b341561018357600080fd5b61018e6004356107af565b604051808d81526020018c81526020018b81526020018a815260200189815260200188815260200187600160a060020a0316600160a060020a0316815260200186815260200185600160a060020a0316600160a060020a031681526020018060200184815260200183815260200182810382528581815460018160011615610100020316600290048152602001915080546001816001161561010002031660029004801561027d5780601f106102525761010080835404028352916020019161027d565b820191906000526020600020905b81548152906001019060200180831161026057829003601f168201915b50509d505050505050505050505050505060405180910390f35b610326600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284375094965061081795505050505050565b005b341561033357600080fd5b610166600435610be0565b341561034957600080fd5b610351610bf5565b604051901515815260200160405180910390f35b341561037057600080fd5b610351610ce4565b341561038357600080fd5b6103a0600435602435604435600160a060020a0360643516610dc4565b60405160208082528190810183818151815260200191508051906020019060200280838360005b838110156103df5780820151838201526020016103c7565b505050509050019250505060405180910390f35b34156103fe57600080fd5b61016660046024813581810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610edd95505050505050565b341561044f57600080fd5b610326600160a060020a0360043516610ee7565b341561046e57600080fd5b610326610f31565b341561048157600080fd5b610326610fda565b341561049457600080fd5b61049f60043561103d565b604051808a815260200189815260200188600160a060020a0316600160a060020a0316815260200187815260200186600160a060020a0316600160a060020a0316815260200180602001858152602001848152602001838152602001828103825286818151815260200191508051906020019080838360005b83811015610530578082015183820152602001610518565b50505050905090810190601f16801561055d5780820380516001836020036101000a031916815260200191505b509a505050505050505050505060405180910390f35b341561057e57600080fd5b6105866111f4565b604051838152602081018390526040810182617d0080838360005b838110156105b95780820151838201526020016105a1565b50505050905001935050505060405180910390f35b34156105d957600080fd5b6105e1611247565b604051600160a060020a03909116815260200160405180910390f35b341561060857600080fd5b610166611256565b341561061b57600080fd5b61016661125c565b341561062e57600080fd5b610326600480359060446024803590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061126295505050505050565b341561068457600080fd5b610326600160a060020a0360043516611304565b34156106a357600080fd5b61035161134e565b34156106b657600080fd5b61032660043560243560443561137b565b34156106d257600080fd5b6105e1611437565b34156106e557600080fd5b6105e1611446565b34156106f857600080fd5b610703600435611456565b60405196875260208701959095526040808701949094526060860192909252608085015260a084015260c083019190915260e0909101905180910390f35b341561074c57600080fd5b6105e16114b7565b341561075f57600080fd5b6105e16004356024356114c7565b341561077857600080fd5b610326600435611502565b341561078e57600080fd5b6101666116fe565b34156107a157600080fd5b6105e1611704565b60045481565b6103ef602052600090815260409020805460018201546002830154600384015460048501546005860154600687015460078801546008890154600b8a0154600c8b0154999a98999798969795969495600160a060020a0394851695939490921692600901918c565b60008060006003541215151561082c57600080fd5b6206ddd05a10156108945733600160a060020a03167f30fb641b8def53b5cbac985d2438ff724798a80a8887f82566ebcebb33a809f68560026040518083815260200182600281111561087b57fe5b60ff1681526020019250505060405180910390a2610bd9565b6003805460009081526103ef60205260409020600281015491015414156108f95733600160a060020a03167f30fb641b8def53b5cbac985d2438ff724798a80a8887f82566ebcebb33a809f68560006040518083815260200182600281111561087b57fe5b600085511161090757600080fd5b60035460009081526103ef6020526040902060040154855102341461092b57600080fd5b600091505b84518210156109fe5784828151811061094557fe5b906020019060200201519050600081101561095f57600080fd5b60035460009081526103ef6020526040902060020154811061098057600080fd5b60035460009081526103ef60209081526040808320848452600a01909152902054600160a060020a0316156109f35733600160a060020a03167f30fb641b8def53b5cbac985d2438ff724798a80a8887f82566ebcebb33a809f68560016040518083815260200182600281111561087b57fe5b600190910190610930565b600091505b8451821015610aa557848281518110610a1857fe5b9060200190602002015160035460009081526103ef60209081526040808320848452600a019091529020805473ffffffffffffffffffffffffffffffffffffffff191633600160a060020a031617905560065490915081906007906103e88110610a7e57fe5b015560068054600101908190556103e89010610a9a5760006006555b600190910190610a03565b84516003805460009081526103ef60205260408082209092018054909301909255426005556103f054600160a060020a031691632b8616299186919051602001526040518263ffffffff1660e060020a0281526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610b35578082015183820152602001610b1d565b50505050905090810190601f168015610b625780820380516001836020036101000a031916815260200191505b5092505050602060405180830381600087803b1515610b8057600080fd5b6102c65a03f11515610b9157600080fd5b50505060405180515050600160a060020a0333167fd36711665fc21bf1b85b0d418dbd344aadc6c179646ee976400fc6b209df60e18560405190815260200160405180910390a25b5050505050565b6007816103e88110610bee57fe5b0154905081565b600080600080600060035412151515610c0d57600080fd5b6103f054600160a060020a03166309dd0e816000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610c5657600080fd5b6102c65a03f11515610c6757600080fd5b505050604051805190509150610c7c82611713565b9350600091505042831015610c915782420390505b611c2081108015610cba57506003805460009081526103ef602052604090206002810154910154145b8015610cdc575060035460009081526103ef6020526040902060010154600019145b935050505090565b600080600060035412151515610cf957600080fd5b6103f054600160a060020a031663023948726000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610d4257600080fd5b6102c65a03f11515610d5357600080fd5b505050604051805160035460009081526103ef60205260409020600101549092506000191480159150610d9e575060035460009081526103ef60205260409020600101546006018112155b8015610dbd575060035460009081526103ef6020526040902060070154155b91505b5090565b610dcc611a68565b60008581526103ef602052604081206002015481908686011115610def57600080fd5b84604051805910610dfd5750595b90808252806020026020018201604052509250600091505b84821015610ed3575060008681526103ef602090815260408083208885018452600a01909152902054600160a060020a0390811690841681148015610e625750600160a060020a03841615155b15610e8b576002838381518110610e7557fe5b60ff909216602092830290910190910152610ec8565b600160a060020a03811615610ea8576001838381518110610e7557fe5b6000838381518110610eb657fe5b60ff9092166020928302909101909101525b600190910190610e15565b5050949350505050565b6000815192915050565b60005433600160a060020a03908116911614610f0257600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008060035412151515610f4457600080fd5b610f4c610bf5565b1515610f5757600080fd5b6103f054600160a060020a031663023948726000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610fa057600080fd5b6102c65a03f11515610fb157600080fd5b505050604051805160035460009081526103ef6020526040902060369091016001909101555050565b600254600160a060020a03161515610ff157600080fd5b60025433600160a060020a0390811691161461100c57600080fd5b6002546000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055565b600080600080600061104d611a68565b600080600089600019141561106657600354985061106a565b8998505b60008981526103ef6020908152604091829020600581015460068201546007830154600884015460099094018054939e50600160a060020a039283169d50909b509216985090926002600019600184161561010002019092169190910491601f8301819004810201905190810160405280929190818152602001828054600181600116156101000203166002900480156111455780601f1061111a57610100808354040283529160200191611145565b820191906000526020600020905b81548152906001019060200180831161112857829003601f168201915b50505050509350886000141561115f576000199250611166565b6001890392505b60035489141561117a576000199150611181565b8860010191505b6103f054600160a060020a031663023948726000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156111ca57600080fd5b6102c65a03f115156111db57600080fd5b5050506040518051905090509193959799909294969850565b6000806111ff611a7a565b600354600654909350915060005b6103e8811015611241576007816103e8811061122557fe5b015482826103e8811061123457fe5b602002015260010161120d565b50909192565b600054600160a060020a031681565b60065481565b60035481565b600354600090121561127357600080fd5b60008281526103ef6020526040902060060154600160a060020a0316151561129a57600080fd5b60008281526103ef602052604090206006015433600160a060020a039081169116146112c557600080fd5b6101f46112d182610edd565b11156112dc57600080fd5b60008281526103ef602052604090206009018180516112ff929160200190611aa3565b505050565b60005433600160a060020a0390811691161461131f57600080fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60006003546000191480611375575060035460009081526103ef6020526040812060070154115b90505b90565b60005433600160a060020a03908116911614806113a6575060015433600160a060020a039081169116145b15156113b157600080fd5b6113b961134e565b15156113c457600080fd5b8181028390116113d357600080fd5b60038054600190810180835560009081526103ef602052604080822096909655825481528581206000199201829055825481528581206002019490945581548452848420600490810193909355905483529282206005908101939093554290559055565b600254600160a060020a031681565b6103f054600160a060020a031681565b6000806000806000806000876000191415611475576003549650611479565b8796505b50505060008481526103ef602052604090208054600182015460028301546003840154600554600490950154989a9399509197909650909450919250565b6103f154600160a060020a031681565b6000808312156114d657600080fd5b5060009182526103ef60209081526040808420928452600a9092019052902054600160a060020a031690565b6000806000806000806003541215151561151b57600080fd5b611523610ce4565b151561152e57600080fd5b60035460009081526103ef602052604090206001810154600b909101541461155e57611559866118df565b6116f6565b60035460009081526103ef602052604090206002810154600c9091015481151561158457fe5b6003805460009081526103ef6020818152604080842096909507808452600a8701825285842054929091526005909501859055825482528382206006018054600160a060020a0392831673ffffffffffffffffffffffffffffffffffffffff19918216811790925584548452858420436007909101559354835293909120600801805490921632909116179055909550935083156116c85760035460009081526103ef602052604090819020549350600160a060020a03851690620493e090859051600060405180830381858888f1935050505091508115156116c8576103f154600160a060020a031663f340fa01848660405160e060020a63ffffffff8516028152600160a060020a0390911660048201526024016000604051808303818588803b15156116b257600080fd5b6125ee5a03f115156116c357600080fd5b505050505b600154600160a060020a0390811690620493e090301631604051600060405180830381858888f19450505050505b505050505050565b60055481565b600154600160a060020a031681565b6000806000611720611b1d565b6103f05460009081908190600160a060020a0316630aece23c89836040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561177857600080fd5b6102c65a03f1151561178957600080fd5b5050506040518051955050841561179f57600080fd5b6103f054600160a060020a0316631f79443689600060405160a0015260405160e060020a63ffffffff8416028152600481019190915260240160a060405180830381600087803b15156117f157600080fd5b6102c65a03f1151561180257600080fd5b5050506040518060a001604052935060009650600092505b60208310156118735760448301915083602083046005811061183857fe5b6020020151602083066020811061184b57fe5b1a60f860020a029050826101000a8160f860020a90040287179650828060010193505061181a565b60009550600092505b60048310156118d55760848301915083602083046005811061189a57fe5b602002015160208306602081106118ad57fe5b1a60f860020a029050826101000a8160f860020a90040286179550828060010193505061187c565b5050505050915091565b60035460009081526103ef60205260408120600b01548190819015156119d1576103f054600160a060020a031663023948726000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561194857600080fd5b6102c65a03f1151561195957600080fd5b50505060405180516103f054909450600160a060020a031690506309dd0e816000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156119af57600080fd5b6102c65a03f115156119c057600080fd5b5050506040518051905091506119f4565b60035460009081526103ef60205260409020600b810154600c9091015490935091505b5060005b83811015611a3d57600183039250611a0f82611713565b5060035460009081526103ef6020526040902060010154909250831415611a3557611a3d565b6001016119f8565b506003805460009081526103ef6020526040808220600b01949094559054815291909120600c015550565b60206040519081016040526000815290565b617d006040519081016040526103e8815b6000815260200190600190039081611a8b5790505090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611ae457805160ff1916838001178555611b11565b82800160010185558215611b11579182015b82811115611b11578251825591602001919060010190611af6565b50610dc0929150611b46565b60a06040519081016040526005815b60008152600019919091019060200181611b2c5790505090565b61137891905b80821115610dc05760008155600101611b4c5600a165627a7a723058208203c24ff4a7f2ab86627b07d7faa85bde30cbbe3ffa1e139db5946180c162bf002900000000000000000000000041f274c0023f83391de4e0733c609df5a124c3d4000000000000000000000000e28942df3b9502193a3547e6f6bad16ce63b1e2d

    Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000041f274c0023f83391de4e0733c609df5a124c3d4000000000000000000000000e28942df3b9502193a3547e6f6bad16ce63b1e2d

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 00000000000000000000000041f274c0023f83391de4e0733c609df5a124c3d4
Arg [1] : 000000000000000000000000e28942df3b9502193a3547e6f6bad16ce63b1e2d


   Swarm Source:
bzzr://8203c24ff4a7f2ab86627b07d7faa85bde30cbbe3ffa1e139db5946180c162bf

 

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.