Contract 0x386771ba5705da638d889381471ec1025a824f53

 

TxHash Block Age From To Value [TxFee]
0xe1c95fd7a3fcce20171440dd3c4c8401fcd9044de2716cb7214673504cdb8fe65786368247 days 19 hrs ago0x9dbea040fde74f9014c873401675ccd298d302ba  IN   0x386771ba5705da638d889381471ec1025a824f530.01 Ether0.00040154
0xef6ec15ea941987efba30b323819781eb01711683a8df693bfaee213d945bf245786358247 days 19 hrs ago0x9dbea040fde74f9014c873401675ccd298d302ba  IN   0x386771ba5705da638d889381471ec1025a824f530.01 Ether0.00040154
0xfc9ddf683286d969628f4caa52182d06c1b5aa2d4643cf6a6f3907d94ae4b0615786351247 days 19 hrs ago0x9dbea040fde74f9014c873401675ccd298d302ba  IN   0x386771ba5705da638d889381471ec1025a824f530.01 Ether0.00040154
0x38e4a5a9d90869e8460b02ec2d6d7ac410096c1124dc7f7fbba6ffdaab791d535786336247 days 19 hrs ago0x9dbea040fde74f9014c873401675ccd298d302ba  IN   0x386771ba5705da638d889381471ec1025a824f530.01 Ether0.00040154
0xbc758cbad56d949039e09339c382a0ed203ac3ebbddd02f7ec3e3f19a3d2ec865786312247 days 20 hrs ago0x9dbea040fde74f9014c873401675ccd298d302ba  IN   0x386771ba5705da638d889381471ec1025a824f530.01 Ether0.00040154
0xb5b9b76c44ff82be88c4b155629470997e8b91e3aaae1104c04e931d46c890655786301247 days 20 hrs ago0x9dbea040fde74f9014c873401675ccd298d302ba  IN   0x386771ba5705da638d889381471ec1025a824f530.01 Ether0.00040154
0x9940ee1149c0e32bd13bb83ac6c4eb31bf1c65fea677459745f7449513135c995786292247 days 20 hrs ago0x9dbea040fde74f9014c873401675ccd298d302ba  IN   0x386771ba5705da638d889381471ec1025a824f530.01 Ether0.00040154
0xca398a52b1286d6ded581ab6e22e4fa9abd60840e4e558ca0046de0ad1b439365786280247 days 20 hrs ago0x9dbea040fde74f9014c873401675ccd298d302ba  IN   0x386771ba5705da638d889381471ec1025a824f530.01 Ether0.00040154
0x5acb649d1eacd4a13d24f6df752dbcb4f72dafc8175113533adec2190c2418935786274247 days 20 hrs ago0x9dbea040fde74f9014c873401675ccd298d302ba  IN   0x386771ba5705da638d889381471ec1025a824f530.01 Ether0.00055154
0x089809d7c24c3084ce0ceeb5db1a059a7f55021999b225d4a1b8c496469c73515786108247 days 20 hrs ago0x9dbea040fde74f9014c873401675ccd298d302ba  IN   0x386771ba5705da638d889381471ec1025a824f530.01 Ether0.00055154
0xab1439700c6f8db4175308c7fb763a9098b6076f39f8060b8720adfdae11c7a75786098247 days 20 hrs ago0x9dbea040fde74f9014c873401675ccd298d302ba  IN   0x386771ba5705da638d889381471ec1025a824f530.01 Ether0.00055154
0xd414baefe6cafaa5bd2bdca8ec416347e7504ca89dd23f40b45e776a6ec9d8445786092247 days 21 hrs ago0x9dbea040fde74f9014c873401675ccd298d302ba  IN   0x386771ba5705da638d889381471ec1025a824f530.01 Ether0.00055154
0x9b42fb7d35fee5968d6d290fb0afbfb8046dfdb5d9637b62e54f8d230ce60b545786084247 days 21 hrs ago0x9dbea040fde74f9014c873401675ccd298d302ba  IN   0x386771ba5705da638d889381471ec1025a824f530.01 Ether0.00055154
0x0cf7b1cdc3be731fe54187205d4a10598784c7b41b66d1a995e21720e6f8b5e65786075247 days 21 hrs ago0x9dbea040fde74f9014c873401675ccd298d302ba  IN   0x386771ba5705da638d889381471ec1025a824f530.01 Ether0.00055154
0x43553944d4c9f88191c7c624a8c5c5bad2fe330e93250646c87fcf3f8c6c93f45786072247 days 21 hrs ago0x9dbea040fde74f9014c873401675ccd298d302ba  IN   0x386771ba5705da638d889381471ec1025a824f530.01 Ether0.00055154
0xbf61d8d36db0a6e57446f80fe9f8a38ed53a1e8afa4013cfd0fb1eb458ba4d6a5786067247 days 21 hrs ago0x9dbea040fde74f9014c873401675ccd298d302ba  IN   0x386771ba5705da638d889381471ec1025a824f530.01 Ether0.00055154
0x481924bcc2ad9720a1955df5e880f91d28514ba03a3fc6fbe09e4a560fef58c85786063247 days 21 hrs ago0x9dbea040fde74f9014c873401675ccd298d302ba  IN   0x386771ba5705da638d889381471ec1025a824f530.01 Ether0.00055154
0xf7209c55eff3bf2f9f83bb44aefcb28359a98c96aaa4819f46cf968dd85ef5574619208448 days 16 hrs ago0x1973f023e4c03ef60ea34084b63e7790d463e595  IN   0x386771ba5705da638d889381471ec1025a824f530.01 Ether0.000421525
0xb60cd354002a2948c470a9e4ae6d768224eade9d56660b84d19e1f56849380954617017449 days 26 mins ago0x1973f023e4c03ef60ea34084b63e7790d463e595  IN   0x386771ba5705da638d889381471ec1025a824f530 Ether0.000131224
0xec5a738a14ccd52d86484eb8727aa99fc8108ab2531032ee459eef2a8c6e38434617009449 days 28 mins ago0x1973f023e4c03ef60ea34084b63e7790d463e595  IN   Contract Creation0 Ether0.00090537
[ Download CSV Export 

Latest 6 Internal Transactions Internal Transactions as a result of Contract Execution

Parent TxHash Block Age From To Value
0x003f8e106546b7e51c14e209cf8d04eb4652ad38b5e9d8cb37677145ef7e6c2b5786546247 days 19 hrs ago0x386771ba5705da638d889381471ec1025a824f530x1973f023e4c03ef60ea34084b63e7790d463e5950.001 Ether
0x003f8e106546b7e51c14e209cf8d04eb4652ad38b5e9d8cb37677145ef7e6c2b5786546247 days 19 hrs ago0x386771ba5705da638d889381471ec1025a824f530x48e9c58bb66dd0b0f218cf0448a797096d5851790.099 Ether
0x003f8e106546b7e51c14e209cf8d04eb4652ad38b5e9d8cb37677145ef7e6c2b5786546247 days 19 hrs ago0x48e9c58bb66dd0b0f218cf0448a797096d5851790x386771ba5705da638d889381471ec1025a824f530.01 Ether
0x4cfbb46a715101a9bf6cdcc9bceae9b6b78bc11759c88d8890f039fce7a3e9aa5786245247 days 20 hrs ago0x386771ba5705da638d889381471ec1025a824f530x1973f023e4c03ef60ea34084b63e7790d463e5950.001 Ether
0x4cfbb46a715101a9bf6cdcc9bceae9b6b78bc11759c88d8890f039fce7a3e9aa5786245247 days 20 hrs ago0x386771ba5705da638d889381471ec1025a824f530x48e9c58bb66dd0b0f218cf0448a797096d5851790.099 Ether
0x4cfbb46a715101a9bf6cdcc9bceae9b6b78bc11759c88d8890f039fce7a3e9aa5786245247 days 20 hrs ago0x48e9c58bb66dd0b0f218cf0448a797096d5851790x386771ba5705da638d889381471ec1025a824f530.01 Ether
[ Download CSV Export 
Warning: The compiled contract might be susceptible to ExpExponentCleanup (medium/high-severity), NestedArrayFunctionCallDecoder (medium-severity), ZeroFunctionSelector (very low-severity), DelegateCallReturnValue (low-severity), ECRecoverMalformedInput (medium-severity), SkipEmptyStringLiteral (low-severity) Solidity Compiler Bugs.

Contract Source Code Verified (Similar Match)
Note: This contract matches the deployed ByteCode of the Verified Source Code for Contract 0x4403e15053786abaef11d73f2a08a54c9f58fc34
Contract Name: simplelottery
Compiler Version: v0.4.11+commit.68ef5810
Optimization Enabled: No
Runs (Optimizer):  200


Contract Source Code
pragma solidity ^0.4.11;
contract simplelottery {
    enum State { Started, Locked }
    State public state = State.Started;
    struct Guess{
      address addr;
      //uint    guess;
    }
    uint arraysize=1000;
    uint constant maxguess=1000000;
    uint bettingprice = 1 ether;
    Guess[1000] guesses;
    uint    numguesses = 0;
    bytes32 curhash = '';
    uint _gameindex = 1;
    uint _starttime = 0;
    modifier inState(State _state) {
      require(state == _state);
      _;
    }
    address developer = 0x0;
    address _winner   = 0x0;
    event SentPrizeToWinner(address winner, uint money, uint gameindex, uint lotterynumber, uint starttime, uint finishtime);
    event SentDeveloperFee(uint amount, uint balance);
    
    function simplelottery() 
    {
      if(developer==address(0)){
        developer = msg.sender;
        state = State.Started;
        _starttime = block.timestamp;
      }
    }
    
    function setBettingCondition(uint _contenders, uint _bettingprice)
    {
      if(msg.sender != developer)
        return;
      arraysize  = _contenders;
      if(arraysize>1000)
        arraysize = 1000;
      bettingprice = _bettingprice;
    }
    
    function findWinner(uint value)
    {
      uint i = value % numguesses;
      _winner = guesses[i].addr;
    }
    
      function getMaxContenders() constant returns(uint){
      return arraysize;
    }

    function getBettingPrice() constant returns(uint){
      return bettingprice;
    }

    function getDeveloperAddress() constant returns(address)
    {
      return developer;
    }
    
    function getDeveloperFee() constant returns(uint)
    {
      uint developerfee = this.balance/100;
      return developerfee;
    }
    
    function getBalance() constant returns(uint)
    {
       return this.balance;
    }
    
    function getLotteryMoney() constant returns(uint)
    {
      uint developerfee = getDeveloperFee();
      uint prize = (this.balance - developerfee);
      return prize;
    }

    function getBettingStatus()
      constant
      returns (uint, uint, uint, uint, uint, uint, uint)
    {
      return ((uint)(state), _gameindex, _starttime, numguesses, getLotteryMoney(), this.balance, bettingprice);
    }



    function finish()
    {
      if(msg.sender != developer)
        return;
      _finish();
    }
    
    function _finish() private
    {
      state = State.Locked;
      uint block_timestamp = block.timestamp;
      uint lotterynumber = (uint(curhash)+block_timestamp)%(maxguess+1);
      findWinner(lotterynumber);
      uint prize = getLotteryMoney();
      uint numwinners = 1;
      uint remain = this.balance - (prize*numwinners);

      _winner.transfer(prize);
      SentPrizeToWinner(_winner, prize, _gameindex, lotterynumber, _starttime, block_timestamp);

      // give delveoper the money left behind
      developer.transfer(remain); 
      SentDeveloperFee(remain, this.balance);
      numguesses = 0;
      _gameindex++;
      state = State.Started;
      _starttime = block.timestamp;
    }
    
    function () payable
    {
        _addguess();
    }

    function addguess() 
      inState(State.Started)
      payable
    {
      _addguess();
    }
    
    function _addguess() private
      inState(State.Started)
    {
      require(msg.value >= bettingprice);
      curhash = sha256(block.timestamp, block.coinbase, block.difficulty, curhash);
      if((uint)(numguesses+1)<=arraysize) {
        guesses[numguesses++].addr = msg.sender;
        if((uint)(numguesses)>=arraysize){
          _finish();
        }
      }
    }
}

Contract ABI
[{"constant":false,"inputs":[{"name":"value","type":"uint256"}],"name":"findWinner","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"getBalance","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"getBettingStatus","outputs":[{"name":"","type":"uint256"},{"name":"","type":"uint256"},{"name":"","type":"uint256"},{"name":"","type":"uint256"},{"name":"","type":"uint256"},{"name":"","type":"uint256"},{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"getDeveloperAddress","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"getMaxContenders","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"getBettingPrice","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"getDeveloperFee","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"getLotteryMoney","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_contenders","type":"uint256"},{"name":"_bettingprice","type":"uint256"}],"name":"setBettingCondition","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"addguess","outputs":[],"payable":true,"type":"function"},{"constant":true,"inputs":[],"name":"state","outputs":[{"name":"","type":"uint8"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"finish","outputs":[],"payable":false,"type":"function"},{"inputs":[],"payable":false,"type":"constructor"},{"payable":true,"type":"fallback"},{"anonymous":false,"inputs":[{"indexed":false,"name":"winner","type":"address"},{"indexed":false,"name":"money","type":"uint256"},{"indexed":false,"name":"gameindex","type":"uint256"},{"indexed":false,"name":"lotterynumber","type":"uint256"},{"indexed":false,"name":"starttime","type":"uint256"},{"indexed":false,"name":"finishtime","type":"uint256"}],"name":"SentPrizeToWinner","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"amount","type":"uint256"},{"indexed":false,"name":"balance","type":"uint256"}],"name":"SentDeveloperFee","type":"event"}]

Contract Creation Code
60606040526000600060006101000a81548160ff0219169083600181111561002357fe5b02179055506103e8600155670de0b6b3a764000060025560006103eb5560006103ec9060001916905560016103ed5560006103ee5560006103ef60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060006103f060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555034156100e657fe5b5b600073ffffffffffffffffffffffffffffffffffffffff166103ef60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156101ae57336103ef60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600060006101000a81548160ff021916908360018111156101a057fe5b0217905550426103ee819055505b5b5b610a23806101bf6000396000f300606060405236156100b8576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305e49d1d146100c957806312065fe0146100e9578063179dfbf31461010f57806322a27f3b1461015f5780633bee8726146101b157806371b804ee146101d757806377482b18146101fd5780637842aded146102235780637847352a146102495780638f701eaa14610272578063c19d93fb1461027c578063d56b2889146102b0575b6100c75b6100c46102c2565b5b565b005b34156100d157fe5b6100e76004808035906020019091905050610445565b005b34156100f157fe5b6100f96104d7565b6040518082815260200191505060405180910390f35b341561011757fe5b61011f6104f7565b6040518088815260200187815260200186815260200185815260200184815260200183815260200182815260200197505050505050505060405180910390f35b341561016757fe5b61016f610567565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101b957fe5b6101c1610593565b6040518082815260200191505060405180910390f35b34156101df57fe5b6101e761059e565b6040518082815260200191505060405180910390f35b341561020557fe5b61020d6105a9565b6040518082815260200191505060405180910390f35b341561022b57fe5b6102336105db565b6040518082815260200191505060405180910390f35b341561025157fe5b6102706004808035906020019091908035906020019091905050610610565b005b61027a610696565b005b341561028457fe5b61028c6106d9565b6040518082600181111561029c57fe5b60ff16815260200191505060405180910390f35b34156102b857fe5b6102c06106ec565b005b60008060018111156102d057fe5b600060009054906101000a900460ff1660018111156102eb57fe5b1415156102f85760006000fd5b600254341015151561030a5760006000fd5b60024241446103ec54600060405160200152604051808581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c01000000000000000000000000028152601401838152602001826000191660001916815260200194505050505060206040518083038160008661646e5a03f1151561039b57fe5b5050604051805190506103ec816000191690555060015460016103eb5401111515610440573360036103eb6000815480929190600101919050556103e8811015156103e257fe5b0160005b5060000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001546103eb5410151561043f5761043e610754565b5b5b5b5b50565b60006103eb548281151561045557fe5b0690506003816103e88110151561046857fe5b0160005b5060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166103f060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b5050565b60003073ffffffffffffffffffffffffffffffffffffffff163190505b90565b6000600060006000600060006000600060009054906101000a900460ff16600181111561052057fe5b6103ed546103ee546103eb546105346105db565b3073ffffffffffffffffffffffffffffffffffffffff163160025496509650965096509650965096505b90919293949596565b60006103ef60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505b90565b600060015490505b90565b600060025490505b90565b6000600060643073ffffffffffffffffffffffffffffffffffffffff16318115156105d057fe5b0490508091505b5090565b6000600060006105e96105a9565b9150813073ffffffffffffffffffffffffffffffffffffffff16310390508092505b505090565b6103ef60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561066d57610692565b816001819055506103e8600154111561068a576103e86001819055505b806002819055505b5050565b60008060018111156106a457fe5b600060009054906101000a900460ff1660018111156106bf57fe5b1415156106cc5760006000fd5b6106d46102c2565b5b5b50565b600060009054906101000a900460ff1681565b6103ef60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561074957610752565b610751610754565b5b565b600060006000600060006001600060006101000a81548160ff0219169083600181111561077d57fe5b02179055504294506001620f424001856103ec54600190040181151561079f57fe5b0693506107ab84610445565b6107b36105db565b9250600191508183023073ffffffffffffffffffffffffffffffffffffffff16310390506103f060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051809050600060405180830381858888f19350505050151561083a57fe5b7f16772b6ac3e9823e1f39326dbe356dac767fad821f4a2af003066838235e1bbd6103f060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846103ed54876103ee548a604051808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001868152602001858152602001848152602001838152602001828152602001965050505050505060405180910390a16103ef60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051809050600060405180830381858888f19350505050151561095157fe5b7ff758ff59202247fe26bd4bd951f620cf543dc36b500de667d055cb5816def873813073ffffffffffffffffffffffffffffffffffffffff1631604051808381526020018281526020019250505060405180910390a160006103eb819055506103ed600081548092919060010191905055506000600060006101000a81548160ff021916908360018111156109e257fe5b0217905550426103ee819055505b50505050505600a165627a7a723058209e8490a5179c96c678f45d2721d5eb2862af3bb9793d35cd13251dd702226f9c0029


   Swarm Source:
bzzr://9e8490a5179c96c678f45d2721d5eb2862af3bb9793d35cd13251dd702226f9c
Block Age transaction Difficulty GasUsed Reward
Block Age Uncle Number Difficulty GasUsed Reward
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.