ETH Price: $2,112.72 (+6.60%)

Contract

0x26B5962250B779ab0F33970738A46FcFb00a70b9
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

More Info

Private Name Tags

Funded By

N/A

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Shutdown55738942018-05-07 20:15:222858 days ago1525724122IN
0x26B59622...Fb00a70b9
0 ETH0.000040463
Lotto Count55644012018-05-06 4:53:552859 days ago1525582435IN
0x26B59622...Fb00a70b9
0.000001 ETH0.0006705710
Lotto Count55643922018-05-06 4:51:122859 days ago1525582272IN
0x26B59622...Fb00a70b9
0.000001 ETH0.0014424
Lotto Count55643852018-05-06 4:48:482859 days ago1525582128IN
0x26B59622...Fb00a70b9
0.000001 ETH0.0007212
Lotto Count55643642018-05-06 4:44:412859 days ago1525581881IN
0x26B59622...Fb00a70b9
0.000001 ETH0.0003612
Lotto Count55526522018-05-04 3:12:542861 days ago1525403574IN
0x26B59622...Fb00a70b9
0 ETH0.0006705710
Add Ticket55513932018-05-03 21:59:332862 days ago1525384773IN
0x26B59622...Fb00a70b9
0.101 ETH0.000107093.1
Add Ticket55513232018-05-03 21:45:002862 days ago1525383900IN
0x26B59622...Fb00a70b9
0.101 ETH0.000138184
Add Ticket55512982018-05-03 21:39:492862 days ago1525383589IN
0x26B59622...Fb00a70b9
0.101 ETH0.000198184
Lotto Count55512742018-05-03 21:35:332862 days ago1525383333IN
0x26B59622...Fb00a70b9
2 ETH0.000628244

Latest 2 internal transactions

Advanced mode:
Parent Transaction Hash Method Block
From
To
Transfer55738942018-05-07 20:15:222858 days ago1525724122
0x26B59622...Fb00a70b9
2.303 ETH
Transfer55515912018-05-03 22:49:002862 days ago1525387740
0x26B59622...Fb00a70b9
1 ETH
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
Contract Self Destruct called at Txn Hash 0xc12576ac12a5931e3201e63f2f33dc4f1b77083c1de89354d5e2567ba702a8a6


Contract Source Code Verified (Exact Match)

Contract Name:
NewLottery

Compiler Version
v0.4.23+commit.124ca40d

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
/**
 *Submitted for verification at Etherscan.io on 2018-05-03
*/

pragma solidity ^0.4.20;

/* library/Owned.sol */
contract Owned {
    address owner;
    function Owned() {
        owner = msg.sender;
    }
    modifier onlyOwner() {
        assert(msg.sender == owner);
        _;
    }
    function transferOwnership(address newOwner) external onlyOwner {
        if (newOwner != address(0)) {
            owner = newOwner;
        }
    }
}

contract NewLottery is Owned {

    //CONSTANT
    uint256 private maxTickets;
    uint256 public minimumBounty;
    uint256 public ticketPrice;

    //LOTO REGISTER
    uint256 public lottoIndex;
    uint256 lastTicketTime;

    //LOTTO VARIABLES
    uint8 _direction;
    uint256 numtickets;
    uint256 totalBounty;
    address owner;

    event NewTicket(address indexed fromAddress, bool success);
    event LottoComplete(address indexed fromAddress, uint indexed lottoIndex, uint256 reward);

    /// Create a new Lotto
    function LottoCount() public payable
    {
        owner = msg.sender;

        ticketPrice = 0.101 * 10**18;
        minimumBounty = 1 * 10**18;
        maxTickets = 10;

        _direction = 0;
        lottoIndex = 1;
        lastTicketTime = 0;

        numtickets = 0;
        totalBounty = msg.value;
        require(totalBounty >= minimumBounty);
    }


   function getBalance() public view returns (uint256 balance)
    {
        balance = 0;

        if(owner == msg.sender) balance = this.balance;

        return balance;
    }


    function withdraw() onlyOwner public
    {
        //reset values
        lottoIndex += 1;
        numtickets = 0;
        totalBounty = 0;

        owner.transfer(this.balance);
    }

    function shutdown() onlyOwner public
    {
        suicide(msg.sender);
    }

    function getLastTicketTime() public view returns (uint256 time)
    {
        time = lastTicketTime;
        return time;
    }

    function AddTicket() public payable
    {
        require(msg.value == ticketPrice);
        require(numtickets < maxTickets);

        //update bif
        lastTicketTime = now;
        totalBounty += ticketPrice;
        bool success = numtickets == maxTickets;

        NewTicket(msg.sender, success);

        //check if winner
        if(success)
        {
            PayWinner(msg.sender);
        }
    }

    function PayWinner( address winner ) private
    {
        require(numtickets == maxTickets);

        //calc reward
        uint ownerTax = 5 * totalBounty / 100;
        uint winnerPrice = totalBounty - ownerTax;

        LottoComplete(msg.sender, lottoIndex, winnerPrice);

        //reset values
        lottoIndex += 1;
        numtickets = 0;
        totalBounty = 0;

        //change max tickets to give unpredictability
        if(_direction == 0 && maxTickets < 20) maxTickets += 1;
        if(_direction == 1 && maxTickets > 10) maxTickets -= 1;

        if(_direction == 0 && maxTickets == 20) _direction = 1;
        if(_direction == 1 && maxTickets == 10) _direction = 0;

        //give real money
        owner.transfer(ownerTax);
        winner.transfer(winnerPrice);
    }
}

Contract Security Audit

Contract ABI

API
[{"constant":true,"inputs":[],"name":"getBalance","outputs":[{"name":"balance","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"ticketPrice","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getLastTicketTime","outputs":[{"name":"time","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"withdraw","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"LottoCount","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"lottoIndex","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"AddTicket","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"minimumBounty","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"shutdown","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"fromAddress","type":"address"},{"indexed":false,"name":"success","type":"bool"}],"name":"NewTicket","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"fromAddress","type":"address"},{"indexed":true,"name":"lottoIndex","type":"uint256"},{"indexed":false,"name":"reward","type":"uint256"}],"name":"LottoComplete","type":"event"}]

608060405260008054600160a060020a033316600160a060020a0319909116179055610560806100306000396000f3006080604052600436106100a35763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166312065fe081146100a85780631209b1f6146100cf57806319c97154146100e45780633ccfd60b146100f95780637741fc52146101105780637a15eb8d14610118578063b204bb5d1461012d578063cdf016ca14610135578063f2fde38b1461014a578063fc0e74d11461016b575b600080fd5b3480156100b457600080fd5b506100bd610180565b60408051918252519081900360200190f35b3480156100db57600080fd5b506100bd6101aa565b3480156100f057600080fd5b506100bd6101b0565b34801561010557600080fd5b5061010e6101b6565b005b61010e610224565b34801561012457600080fd5b506100bd610297565b61010e61029d565b34801561014157600080fd5b506100bd610327565b34801561015657600080fd5b5061010e600160a060020a036004351661032d565b34801561017757600080fd5b5061010e610381565b60095460009033600160a060020a03908116911614156101a75750600160a060020a033016315b90565b60035481565b60055490565b60005433600160a060020a039081169116146101ce57fe5b600480546001019055600060078190556008819055600954604051600160a060020a0391821692309092163180156108fc0292909190818181858888f19350505050158015610221573d6000803e3d6000fd5b50565b6009805473ffffffffffffffffffffffffffffffffffffffff191633600160a060020a0316179055670166d2f702508000600355670de0b6b3a76400006002819055600a60019081556006805460ff1916905560045560006005819055600755346008819055101561029557600080fd5b565b60045481565b60035460009034146102ae57600080fd5b600154600754106102be57600080fd5b504260055560035460088054909101905560015460075460408051919092148082529151600160a060020a033316917f23de19158786940de5dda06fd0b7b6cb38f4a275de8e5aa97841291762e9892c919081900360200190a2801561022157610221336103a5565b60025481565b60005433600160a060020a0390811691161461034557fe5b600160a060020a038116156102215760008054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff1990911617905550565b60005433600160a060020a0390811691161461039957fe5b33600160a060020a0316ff5b6000806001546007541415156103ba57600080fd5b6008546064906005020491508160085403905060045433600160a060020a03167fdc5dff36369474a27c3e9316fd6e5682d3eed3a3c023aa2a2ebcb553c954d387836040518082815260200191505060405180910390a36004805460010190556000600781905560085560065460ff1615801561043957506014600154105b156104475760018054810190555b60065460ff16600114801561045e5750600a600154115b1561046e57600180546000190190555b60065460ff1615801561048357506001546014145b15610496576006805460ff191660011790555b60065460ff1660011480156104ad5750600154600a145b156104bd576006805460ff191690555b600954604051600160a060020a039091169083156108fc029084906000818181858888f193505050501580156104f7573d6000803e3d6000fd5b50604051600160a060020a0384169082156108fc029083906000818181858888f1935050505015801561052e573d6000803e3d6000fd5b505050505600a165627a7a72305820ed42512a312d0a44d7fd0d4a9154549bb0c9337bb4763bc3fd08242c04f508880029

Deployed Bytecode

0x6080604052600436106100a35763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166312065fe081146100a85780631209b1f6146100cf57806319c97154146100e45780633ccfd60b146100f95780637741fc52146101105780637a15eb8d14610118578063b204bb5d1461012d578063cdf016ca14610135578063f2fde38b1461014a578063fc0e74d11461016b575b600080fd5b3480156100b457600080fd5b506100bd610180565b60408051918252519081900360200190f35b3480156100db57600080fd5b506100bd6101aa565b3480156100f057600080fd5b506100bd6101b0565b34801561010557600080fd5b5061010e6101b6565b005b61010e610224565b34801561012457600080fd5b506100bd610297565b61010e61029d565b34801561014157600080fd5b506100bd610327565b34801561015657600080fd5b5061010e600160a060020a036004351661032d565b34801561017757600080fd5b5061010e610381565b60095460009033600160a060020a03908116911614156101a75750600160a060020a033016315b90565b60035481565b60055490565b60005433600160a060020a039081169116146101ce57fe5b600480546001019055600060078190556008819055600954604051600160a060020a0391821692309092163180156108fc0292909190818181858888f19350505050158015610221573d6000803e3d6000fd5b50565b6009805473ffffffffffffffffffffffffffffffffffffffff191633600160a060020a0316179055670166d2f702508000600355670de0b6b3a76400006002819055600a60019081556006805460ff1916905560045560006005819055600755346008819055101561029557600080fd5b565b60045481565b60035460009034146102ae57600080fd5b600154600754106102be57600080fd5b504260055560035460088054909101905560015460075460408051919092148082529151600160a060020a033316917f23de19158786940de5dda06fd0b7b6cb38f4a275de8e5aa97841291762e9892c919081900360200190a2801561022157610221336103a5565b60025481565b60005433600160a060020a0390811691161461034557fe5b600160a060020a038116156102215760008054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff1990911617905550565b60005433600160a060020a0390811691161461039957fe5b33600160a060020a0316ff5b6000806001546007541415156103ba57600080fd5b6008546064906005020491508160085403905060045433600160a060020a03167fdc5dff36369474a27c3e9316fd6e5682d3eed3a3c023aa2a2ebcb553c954d387836040518082815260200191505060405180910390a36004805460010190556000600781905560085560065460ff1615801561043957506014600154105b156104475760018054810190555b60065460ff16600114801561045e5750600a600154115b1561046e57600180546000190190555b60065460ff1615801561048357506001546014145b15610496576006805460ff191660011790555b60065460ff1660011480156104ad5750600154600a145b156104bd576006805460ff191690555b600954604051600160a060020a039091169083156108fc029084906000818181858888f193505050501580156104f7573d6000803e3d6000fd5b50604051600160a060020a0384169082156108fc029083906000818181858888f1935050505015801561052e573d6000803e3d6000fd5b505050505600a165627a7a72305820ed42512a312d0a44d7fd0d4a9154549bb0c9337bb4763bc3fd08242c04f508880029

Swarm Source

bzzr://ed42512a312d0a44d7fd0d4a9154549bb0c9337bb4763bc3fd08242c04f50888

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.