Sponsored Link:   ARNA Genomics - FIRST BLOCKCHAIN BIOTECH ECOSYSTEM. Join ICO Now!
Contract Overview | SmartBillionsToken
ETH Balance: 6,268.94959501710274595 Ether
ETH USD Value: $2,301,582.15 (@ $367.14/ETH)
No Of Transactions: 47229 txns
Token Tracker 0x6F6DEb5db0C4994A8283A01D6CFeEB27Fc3bBe9C
  Latest 25 txns from a total Of 47229 transactions View All

TxHash Age From To Value [TxFee]
0xb72f237d8cfccd1ab414efff30e2d43f6afc3e2960653fc8ee8a69a050b5b3a1 38 secs ago0xd698036d64e81504f64046d0a2936ca243076ae0  IN   SmartBillionsToken0.002 Ether0.000078372
0x3fffd363642759365fae37719ff10b8e3efcc833c2fca2f2fd07a0c47236dff01 min ago0x8f7d93cdfc8e68e2a6fb12a56747a2e01dae56c6  IN   SmartBillionsToken0.001 Ether0.000360324
0x822a601684f0010a6bdd699e7701357bd203279c7791e8d6145e140cc5633ba34 mins ago0x326fc193ac9c548f4a2255f9f157beb185c77a3c  IN   SmartBillionsToken0.002 Ether0.000079815
0xd077c81ed0f94fc93e24473a22010a4ab381b4371e440276fb1811182377afbd4 mins ago0xcb1848a93ca0e8f8361a8b1eccc171009123f707  IN   SmartBillionsToken0.002 Ether0.000090081
0x05eaeeb365e9987a67f854c686afe6d7926ea88cd083f44cdbb9ad5a953dbc406 mins ago0x51f429c237c4069ac7e374704f3397db2599ac64  IN   SmartBillionsToken0.001 Ether0.000360324
0x9980bcaa4e4de49b03258f8e890bf999cb92d0465f7a4e6c3cd7ef105cb3e7c57 mins ago0x51f429c237c4069ac7e374704f3397db2599ac64  IN   SmartBillionsToken0.001 Ether0.000295904
0xcba14701cdc1f8ece7cf05aa92b5cd45c541ae9ebf128279d749cfa4b14019887 mins ago0x8f7d93cdfc8e68e2a6fb12a56747a2e01dae56c6  IN   SmartBillionsToken0.001 Ether0.000301456
0xc32c068c6b15172c3d3a86d3c76d483536162a5945d719bf6bfab389869ad7d67 mins ago0x326fc193ac9c548f4a2255f9f157beb185c77a3c  IN   SmartBillionsToken0.002 Ether0.000073986
0xc643f391cc575f95c0af7af2588e47961d4ed09b3f9946775c0cdeb5c6aafa0e7 mins ago0xd698036d64e81504f64046d0a2936ca243076ae0  IN   SmartBillionsToken0.003 Ether0.000078372
0xae5f1165cfa3d420331986eb556fbf2eeeb10225d48daabb6f01eaa34911c1b47 mins ago0x16f18a1128ceb213e151e3c127ccbf95f1dec0a1  IN   SmartBillionsToken0.001 Ether0.000360324
0xd08af060dd755ec69dd1b5e0382681f17bb05037909f291f6097c8644a4b6fb710 mins ago0xd698036d64e81504f64046d0a2936ca243076ae0  IN   SmartBillionsToken0.002 Ether0.000078372
0x12f6d41d4472f07995e98f59475d87d6ce682afdb9cfc714853528a0e463a73910 mins ago0x51f429c237c4069ac7e374704f3397db2599ac64  IN   SmartBillionsToken0.001 Ether0.000360324
0x17aeafc7fe879361a5958d21ffea8146bdcd6ce356d6f255b4bee0d0e7c332d011 mins ago0x73db4e4bdaae66c5fd9e1d32d5dfa8b6a62d6cda  IN   SmartBillionsToken0.003 Ether0.000078362
0xbea9866c48b2a95bd5c0a90a3fb42fd76e60739f5ad0278b49574211f6ccf24412 mins ago0x51f429c237c4069ac7e374704f3397db2599ac64  IN   SmartBillionsToken0.001 Ether0.000365876
0x4b44389a64b269de49e2857b7d7fb04f51c4ecf1fdd4645191474f6ff1f01f4b14 mins ago0x410489fb0d0e59a9d04915ac1dfcf253ba4e2c64  IN   SmartBillionsToken0.003 Ether0.000090071
0x2a06d34542d0c779eb9a42aa22601ecc8fd0fcbe0923266228334c7890fbfb0a16 mins ago0x16f18a1128ceb213e151e3c127ccbf95f1dec0a1  IN   SmartBillionsToken0.001 Ether0.000313488
0x70f3c7629b2285249eced63df6a1ef449313d368e19e21ec982e667a07cabd0717 mins ago0x326fc193ac9c548f4a2255f9f157beb185c77a3c  IN   SmartBillionsToken0.002 Ether0.00010178
0x20f25057bfe54a1db88700e94d99c3ec8107e23596d350947fae4050109ea86021 mins ago0xb52f1d320164521c7ee6edcdf62be3143eaaaad9  IN   SmartBillionsToken0.002 Ether0.000090081
0xfc1737a4376b4792c5242e4ca2e85728170fbcb4f281987994a65acf10c3540122 mins ago0x9d4422191d679dd0d65f6c3f91076475c6cebe90  IN   SmartBillionsToken0 Ether0.00102874
0xf2fb0a58d4fa35fb9751266545c6d45dba1d2b7629d4d50e965dfe7989d171e522 mins ago0x3ced39a7dbb97bd366780e2959ba565e45ed91b3  IN   SmartBillionsToken0.003 Ether0.000073986
0x8f706b9eb7b91433c2f2bcda507cbbc5048eed2355a8d2c74fb5bb48e4c6e36d22 mins ago0x326fc193ac9c548f4a2255f9f157beb185c77a3c  IN   SmartBillionsToken0.003 Ether0.000078372
0x339ce7c71c705f8e8ba03a726cf33b49c7767083628b26889a60e70df10cb19425 mins ago0xe4321372c368cd74539c923bc381328547e8aa09  IN   SmartBillionsToken0 Ether0.000182976
0x9e1bdc9c6f354549f5dfa2ff394a5ffcddd99393df1e99c289dd3331e155829326 mins ago0x73db4e4bdaae66c5fd9e1d32d5dfa8b6a62d6cda  IN   SmartBillionsToken0.003 Ether0.000091514
0x9d52d80b4098af1223600d463cd980bad033718350345932d8f005b009a14a6727 mins ago0x9d4422191d679dd0d65f6c3f91076475c6cebe90  IN   SmartBillionsToken0.001 Ether0.000313488
0x7d0924f9291a79efa5c9e68675f24cbc3a950e3a316259e21ce5d6c69b46559a29 mins ago0xb52f1d320164521c7ee6edcdf62be3143eaaaad9  IN   SmartBillionsToken0.003 Ether0.000090081
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
  Latest 25 Internal Txns, Click here to View More View All
ParentTxHash Block Age From To Value
0xfc1737a4376b4792c5242e4ca2e85728170fbcb4f281987994a65acf10c35401460019322 mins ago0x6f6deb5db0c4994a8283a01d6cfeeb27fc3bbe9c0x9d4422191d679dd0d65f6c3f91076475c6cebe900.003 Ether
0x8e1ac29f6cb9ae73891f898c4a459049507d84b6c83f32d25ff8ccf994f42958460012739 mins ago0x6f6deb5db0c4994a8283a01d6cfeeb27fc3bbe9c0x326fc193ac9c548f4a2255f9f157beb185c77a3c0.009 Ether
0x0677e3b074fa929732f0248eae89e6bdd6a1508d94411846b59b8f60899134c7460010246 mins ago0x6f6deb5db0c4994a8283a01d6cfeeb27fc3bbe9c0xb52f1d320164521c7ee6edcdf62be3143eaaaad90.006 Ether
0x2d8d22a575ab96514db6c9df7a36b1399796f9f8cec95fa2c7a9576f309da8a045996742 hrs 27 mins ago0x6f6deb5db0c4994a8283a01d6cfeeb27fc3bbe9c0x1f2938ca6340ab554b833ca3fa608cc488f5f8300.006 Ether
0x7e31b8525e5318cf9afe58488c31dbe635bbfce8229b68d00ac438b91b1c08ee45995203 hrs 1 min ago0x6f6deb5db0c4994a8283a01d6cfeeb27fc3bbe9c0xcb1848a93ca0e8f8361a8b1eccc171009123f7070.009 Ether
0x8d218550759970b42df35c3644fd496452b374bb8757b99e652fdf9797d1b9f645994713 hrs 12 mins ago0x6f6deb5db0c4994a8283a01d6cfeeb27fc3bbe9c0xb52f1d320164521c7ee6edcdf62be3143eaaaad90.009 Ether
0x10f0fa533933511185a794661095d587d500faabd662d386d35f0b10553cde3445993293 hrs 46 mins ago0x6f6deb5db0c4994a8283a01d6cfeeb27fc3bbe9c0xc1efd4582a8b144b64b0b4716597253d9cc3b3f40.006 Ether
0xb00c9634024cf5172f6a0f7924a370ab9cb842ca9112296c744bf5a8b21fb86745992514 hrs 4 mins ago0x6f6deb5db0c4994a8283a01d6cfeeb27fc3bbe9c0x33dc780be1506f8f4b0ac96c9f365596ab553bc60.003 Ether
0xffb4190593ddd731ed9d5748cac4dbc25e808ac146a73083b65e350993f0945a45991624 hrs 23 mins ago0x6f6deb5db0c4994a8283a01d6cfeeb27fc3bbe9c0xbb67d00eeea0897397eccf2fac7f838ebeeb39460.05252 Ether
0xaa631e8590dd1686af8242cc90873fe5c78f21373214c95b4c33098f4bc68d4b45990954 hrs 42 mins ago0x6f6deb5db0c4994a8283a01d6cfeeb27fc3bbe9c0xb86ee47fd86f0ae2ab8830c36c3cd0ada3750da60.003 Ether
0x8c3548ba2fd32f699b9ba424312cb11bac3dfe83e1abababebc6b26a1c93f6d045990694 hrs 47 mins ago0x6f6deb5db0c4994a8283a01d6cfeeb27fc3bbe9c0x33dc780be1506f8f4b0ac96c9f365596ab553bc60.003 Ether
0x244a12a4c07aec0eba213b34fc6dca437abfabb87ab963a65eb01610910f359145990464 hrs 52 mins ago0x6f6deb5db0c4994a8283a01d6cfeeb27fc3bbe9c0x33dc780be1506f8f4b0ac96c9f365596ab553bc60.003 Ether
0x4259a948587559019dc9f679c486f9a7897b6cedd9c6c87308015b885fc8159f45990284 hrs 57 mins ago0x6f6deb5db0c4994a8283a01d6cfeeb27fc3bbe9c0xb86ee47fd86f0ae2ab8830c36c3cd0ada3750da60.003 Ether
0xec0c2c13adc11461b173b06298ad08dc076302035af306b192c3f4e80d23b88745989675 hrs 13 mins ago0x6f6deb5db0c4994a8283a01d6cfeeb27fc3bbe9c0x33dc780be1506f8f4b0ac96c9f365596ab553bc60.025 Ether
0x2413d035dec8d3d1646fe356a3100550b74d0fb7ebda31447c46d3ed979fc5c745984267 hrs 15 mins ago0x6f6deb5db0c4994a8283a01d6cfeeb27fc3bbe9c0xb52f1d320164521c7ee6edcdf62be3143eaaaad90.006 Ether
0xa58efe95961ac1acf02e3e87f674da7ebe121fb331670d2eef424b8b1de6811545983497 hrs 34 mins ago0x6f6deb5db0c4994a8283a01d6cfeeb27fc3bbe9c0x7220d2bccf2127689ee9aee6e05ab903019808460.003 Ether
0x5c0301f6130988dbb55a527c16465aa01693952a6fa5919fc120f6463e7f46c745982038 hrs 11 mins ago0x6f6deb5db0c4994a8283a01d6cfeeb27fc3bbe9c0x3ced39a7dbb97bd366780e2959ba565e45ed91b30.006 Ether
0x7c51a278f19448465c1cdbd333841163f8652a34c7fa2f39ec6f412c5dcc204d45981138 hrs 34 mins ago0x6f6deb5db0c4994a8283a01d6cfeeb27fc3bbe9c0xb47a384f6aab6b619b5470d3db88a2bb1aa971090.009 Ether
0xb097a2fd1de5049267d99383a1f4ae33d8cc4bd1de6b89eb5ec01b30dbc048fe45981108 hrs 34 mins ago0x6f6deb5db0c4994a8283a01d6cfeeb27fc3bbe9c0xe060926e314bbe2b7eebe7024c1dabaf2f3d78d60.003 Ether
0x321b1d5add24e2170bb5385e3378aeebea0404b595769c82acc146af848b4e9145981088 hrs 35 mins ago0x6f6deb5db0c4994a8283a01d6cfeeb27fc3bbe9c0x73db4e4bdaae66c5fd9e1d32d5dfa8b6a62d6cda0.006 Ether
0x5e95db3942cdf70b926d4c6d7b1b62adde40bfaa43b9f13d7b5c988883cdb82445980228 hrs 55 mins ago0x6f6deb5db0c4994a8283a01d6cfeeb27fc3bbe9c0x326fc193ac9c548f4a2255f9f157beb185c77a3c0.075 Ether
0x95be342acc531a73dddbfa744ab83ea787af22068d6933934d2ba78675a9935c45978309 hrs 39 mins ago0x6f6deb5db0c4994a8283a01d6cfeeb27fc3bbe9c0xb8db64b27aaa855ce16b1c38a66f63a5ed1afbb90.003 Ether
0x977f578140002fb8472ebe60cac973258c2920d35fe2c3a3b3f6c84a98db083045977859 hrs 49 mins ago0x6f6deb5db0c4994a8283a01d6cfeeb27fc3bbe9c0xc1efd4582a8b144b64b0b4716597253d9cc3b3f40.009 Ether
0xbdfa1221f6cabc32f8803a4b408c6c991d78da804056a3bfdf46350bbde17316459745211 hrs 5 mins ago0x6f6deb5db0c4994a8283a01d6cfeeb27fc3bbe9c0x326fc193ac9c548f4a2255f9f157beb185c77a3c0.006 Ether
0x1b01f6b1aa6812d62274b84e7f61105bdd6377325d199a06703e69c8f9edb774459744211 hrs 8 mins ago0x6f6deb5db0c4994a8283a01d6cfeeb27fc3bbe9c0xcb1848a93ca0e8f8361a8b1eccc171009123f7070.009 Ether
[ Download CSV Export  ] 
Warning: The compiled contract might be susceptible to ZeroFunctionSelector (very low-severity) Solidity compiler bugs.

Contract Source Code Verified
Contract Name: SmartBillions
Compiler Version: v0.4.17+commit.bdeb9e52
Optimization Enabled: Yes
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts
pragma solidity ^0.4.17;

library SafeMath {
  function sub(uint a, uint b) internal pure returns (uint) {
    assert(b <= a);
    return a - b;
  }
  function add(uint a, uint b) internal pure returns (uint) {
    uint c = a + b;
    assert(c >= a);
    return c;
  }
}

contract ERC20Basic {
  uint public totalSupply;
  address public owner; //owner
  address public animator; //animator
  function balanceOf(address who) constant public returns (uint);
  function transfer(address to, uint value) public;
  event Transfer(address indexed from, address indexed to, uint value);
  function commitDividend(address who) internal; // pays remaining dividend
}

contract ERC20 is ERC20Basic {
  function allowance(address owner, address spender) constant public returns (uint);
  function transferFrom(address from, address to, uint value) public;
  function approve(address spender, uint value) public;
  event Approval(address indexed owner, address indexed spender, uint value);
}

contract BasicToken is ERC20Basic {
  using SafeMath for uint;
  mapping(address => uint) balances;

  modifier onlyPayloadSize(uint size) {
     assert(msg.data.length >= size + 4);
     _;
  }
  /**
  * @dev transfer token for a specified address
  * @param _to The address to transfer to.
  * @param _value The amount to be transferred.
  */
  function transfer(address _to, uint _value) public onlyPayloadSize(2 * 32) {
    commitDividend(msg.sender);
    balances[msg.sender] = balances[msg.sender].sub(_value);
    if(_to == address(this)) {
        commitDividend(owner);
        balances[owner] = balances[owner].add(_value);
        Transfer(msg.sender, owner, _value);
    }
    else {
        commitDividend(_to);
        balances[_to] = balances[_to].add(_value);
        Transfer(msg.sender, _to, _value);
    }
  }
  /**
  * @dev Gets the balance of the specified address.
  * @param _owner The address to query the the balance of. 
  * @return An uint representing the amount owned by the passed address.
  */
  function balanceOf(address _owner) constant public returns (uint balance) {
    return balances[_owner];
  }
}

contract StandardToken is BasicToken, ERC20 {
  mapping (address => mapping (address => uint)) allowed;

  /**
   * @dev Transfer tokens from one address to another
   * @param _from address The address which you want to send tokens from
   * @param _to address The address which you want to transfer to
   * @param _value uint the amount of tokens to be transfered
   */
  function transferFrom(address _from, address _to, uint _value) public onlyPayloadSize(3 * 32) {
    var _allowance = allowed[_from][msg.sender];
    commitDividend(_from);
    commitDividend(_to);
    allowed[_from][msg.sender] = _allowance.sub(_value);
    balances[_from] = balances[_from].sub(_value);
    balances[_to] = balances[_to].add(_value);
    Transfer(_from, _to, _value);
  }
  /**
   * @dev Aprove the passed address to spend the specified amount of tokens on beahlf of msg.sender.
   * @param _spender The address which will spend the funds.
   * @param _value The amount of tokens to be spent.
   */
  function approve(address _spender, uint _value) public {
    //  https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
    assert(!((_value != 0) && (allowed[msg.sender][_spender] != 0)));
    allowed[msg.sender][_spender] = _value;
    Approval(msg.sender, _spender, _value);
  }
  /**
   * @dev Function to check the amount of tokens than an owner allowed to a spender.
   * @param _owner address The address which owns the funds.
   * @param _spender address The address which will spend the funds.
   * @return A uint specifing the amount of tokens still avaible for the spender.
   */
  function allowance(address _owner, address _spender) constant public returns (uint remaining) {
    return allowed[_owner][_spender];
  }
}

/**
 * @title SmartBillions contract
 */
contract SmartBillions is StandardToken {

    // metadata
    string public constant name = "SmartBillions Token";
    string public constant symbol = "Smart"; // changed due to conflicts
    uint public constant decimals = 0;

    // contract state
    struct Wallet {
        uint208 balance; // current balance of user
    	uint16 lastDividendPeriod; // last processed dividend period of user's tokens
    	uint32 nextWithdrawTime; // next withdrawal possible after this timestamp
    }
    mapping (address => Wallet) wallets;
    struct Bet {
        uint192 value; // bet size
        uint32 betHash; // selected numbers
        uint32 blockNum; // blocknumber when lottery runs
    }
    mapping (address => Bet) bets;

    uint public walletBalance = 0; // sum of funds in wallets

    // investment parameters
    uint public investStart = 1; // investment start block, 0: closed, 1: preparation
    uint public investBalance = 0; // funding from investors
    uint public investBalanceGot = 0; // funding collected
    uint public investBalanceMax = 200000 ether; // maximum funding
    uint public dividendPeriod = 1;
    uint[] public dividends; // dividens collected per period, growing array

    // betting parameters
    uint public maxWin = 0; // maximum prize won
    uint public hashFirst = 0; // start time of building hashes database
    uint public hashLast = 0; // last saved block of hashes
    uint public hashNext = 0; // next available bet block.number
    uint public hashBetSum = 0; // used bet volume of next block
    uint public hashBetMax = 5 ether; // maximum bet size per block
    uint[] public hashes; // space for storing lottery results

    // constants
    uint public constant hashesSize = 16384 ; // 30 days of blocks
    uint public coldStoreLast = 0 ; // timestamp of last cold store transfer

    // events
    event LogBet(address indexed player, uint bethash, uint blocknumber, uint betsize);
    event LogLoss(address indexed player, uint bethash, uint hash);
    event LogWin(address indexed player, uint bethash, uint hash, uint prize);
    event LogInvestment(address indexed investor, address indexed partner, uint amount);
    event LogRecordWin(address indexed player, uint amount);
    event LogLate(address indexed player,uint playerBlockNumber,uint currentBlockNumber);
    event LogDividend(address indexed investor, uint amount, uint period);

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

    modifier onlyAnimator() {
        assert(msg.sender == animator);
        _;
    }

    // constructor
    function SmartBillions() public {
        owner = msg.sender;
        animator = msg.sender;
        wallets[owner].lastDividendPeriod = uint16(dividendPeriod);
        dividends.push(0); // not used
        dividends.push(0); // current dividend
    }

/* getters */
    
    /**
     * @dev Show length of allocated swap space
     */
    function hashesLength() constant external returns (uint) {
        return uint(hashes.length);
    }
    
    /**
     * @dev Show balance of wallet
     * @param _owner The address of the account.
     */
    function walletBalanceOf(address _owner) constant external returns (uint) {
        return uint(wallets[_owner].balance);
    }
    
    /**
     * @dev Show last dividend period processed
     * @param _owner The address of the account.
     */
    function walletPeriodOf(address _owner) constant external returns (uint) {
        return uint(wallets[_owner].lastDividendPeriod);
    }
    
    /**
     * @dev Show block number when withdraw can continue
     * @param _owner The address of the account.
     */
    function walletTimeOf(address _owner) constant external returns (uint) {
        return uint(wallets[_owner].nextWithdrawTime);
    }
    
    /**
     * @dev Show bet size.
     * @param _owner The address of the player.
     */
    function betValueOf(address _owner) constant external returns (uint) {
        return uint(bets[_owner].value);
    }
    
    /**
     * @dev Show block number of lottery run for the bet.
     * @param _owner The address of the player.
     */
    function betHashOf(address _owner) constant external returns (uint) {
        return uint(bets[_owner].betHash);
    }
    
    /**
     * @dev Show block number of lottery run for the bet.
     * @param _owner The address of the player.
     */
    function betBlockNumberOf(address _owner) constant external returns (uint) {
        return uint(bets[_owner].blockNum);
    }
    
    /**
     * @dev Print number of block till next expected dividend payment
     */
    function dividendsBlocks() constant external returns (uint) {
        if(investStart > 0) {
            return(0);
        }
        uint period = (block.number - hashFirst) / (10 * hashesSize);
        if(period > dividendPeriod) {
            return(0);
        }
        return((10 * hashesSize) - ((block.number - hashFirst) % (10 * hashesSize)));
    }

/* administrative functions */

    /**
     * @dev Change owner.
     * @param _who The address of new owner.
     */
    function changeOwner(address _who) external onlyOwner {
        assert(_who != address(0));
        commitDividend(msg.sender);
        commitDividend(_who);
        owner = _who;
    }

    /**
     * @dev Change animator.
     * @param _who The address of new animator.
     */
    function changeAnimator(address _who) external onlyAnimator {
        assert(_who != address(0));
        commitDividend(msg.sender);
        commitDividend(_who);
        animator = _who;
    }

    /**
     * @dev Set ICO Start block.
     * @param _when The block number of the ICO.
     */
    function setInvestStart(uint _when) external onlyOwner {
        require(investStart == 1 && hashFirst > 0 && block.number < _when);
        investStart = _when;
    }

    /**
     * @dev Set maximum bet size per block
     * @param _maxsum The maximum bet size in wei.
     */
    function setBetMax(uint _maxsum) external onlyOwner {
        hashBetMax = _maxsum;
    }

    /**
     * @dev Reset bet size accounting, to increase bet volume above safe limits
     */
    function resetBet() external onlyOwner {
        hashNext = block.number + 3;
        hashBetSum = 0;
    }

    /**
     * @dev Move funds to cold storage
     * @dev investBalance and walletBalance is protected from withdraw by owner
     * @dev if funding is > 50% admin can withdraw only 0.25% of balance weekly
     * @param _amount The amount of wei to move to cold storage
     */
    function coldStore(uint _amount) external onlyOwner {
        houseKeeping();
        require(_amount > 0 && this.balance >= (investBalance * 9 / 10) + walletBalance + _amount);
        if(investBalance >= investBalanceGot / 2){ // additional jackpot protection
            require((_amount <= this.balance / 400) && coldStoreLast + 60 * 60 * 24 * 7 <= block.timestamp);
        }
        msg.sender.transfer(_amount);
        coldStoreLast = block.timestamp;
    }

    /**
     * @dev Move funds to contract jackpot
     */
    function hotStore() payable external {
        walletBalance += msg.value;
        wallets[msg.sender].balance += uint208(msg.value);
        houseKeeping();
    }

/* housekeeping functions */

    /**
     * @dev Update accounting
     */
    function houseKeeping() public {
        if(investStart > 1 && block.number >= investStart + (hashesSize * 5)){ // ca. 14 days
            investStart = 0; // start dividend payments
        }
        else {
            if(hashFirst > 0){
		        uint period = (block.number - hashFirst) / (10 * hashesSize );
                if(period > dividends.length - 2) {
                    dividends.push(0);
                }
                if(period > dividendPeriod && investStart == 0 && dividendPeriod < dividends.length - 1) {
                    dividendPeriod++;
                }
            }
        }
    }

/* payments */

    /**
     * @dev Pay balance from wallet
     */
    function payWallet() public {
        if(wallets[msg.sender].balance > 0 && wallets[msg.sender].nextWithdrawTime <= block.timestamp){
            uint balance = wallets[msg.sender].balance;
            wallets[msg.sender].balance = 0;
            walletBalance -= balance;
            pay(balance);
        }
    }

    function pay(uint _amount) private {
        uint maxpay = this.balance / 2;
        if(maxpay >= _amount) {
            msg.sender.transfer(_amount);
            if(_amount > 1 finney) {
                houseKeeping();
            }
        }
        else {
            uint keepbalance = _amount - maxpay;
            walletBalance += keepbalance;
            wallets[msg.sender].balance += uint208(keepbalance);
            wallets[msg.sender].nextWithdrawTime = uint32(block.timestamp + 60 * 60 * 24 * 30); // wait 1 month for more funds
            msg.sender.transfer(maxpay);
        }
    }

/* investment functions */

    /**
     * @dev Buy tokens
     */
    function investDirect() payable external {
        invest(owner);
    }

    /**
     * @dev Buy tokens with affiliate partner
     * @param _partner Affiliate partner
     */
    function invest(address _partner) payable public {
        //require(fromUSA()==false); // fromUSA() not yet implemented :-(
        require(investStart > 1 && block.number < investStart + (hashesSize * 5) && investBalance < investBalanceMax);
        uint investing = msg.value;
        if(investing > investBalanceMax - investBalance) {
            investing = investBalanceMax - investBalance;
            investBalance = investBalanceMax;
            investBalanceGot = investBalanceMax;
            investStart = 0; // close investment round
            msg.sender.transfer(msg.value.sub(investing)); // send back funds immediately
        }
        else{
            investBalance += investing;
            investBalanceGot += investing;
        }
        if(_partner == address(0) || _partner == owner){
            walletBalance += investing / 10;
            wallets[owner].balance += uint208(investing / 10);} // 10% for marketing if no affiliates
        else{
            walletBalance += (investing * 5 / 100) * 2;
            wallets[owner].balance += uint208(investing * 5 / 100); // 5% initial marketing funds
            wallets[_partner].balance += uint208(investing * 5 / 100);} // 5% for affiliates
        wallets[msg.sender].lastDividendPeriod = uint16(dividendPeriod); // assert(dividendPeriod == 1);
        uint senderBalance = investing / 10**15;
        uint ownerBalance = investing * 16 / 10**17  ;
        uint animatorBalance = investing * 10 / 10**17  ;
        balances[msg.sender] += senderBalance;
        balances[owner] += ownerBalance ; // 13% of shares go to developers
        balances[animator] += animatorBalance ; // 8% of shares go to animator
        totalSupply += senderBalance + ownerBalance + animatorBalance;
        Transfer(address(0),msg.sender,senderBalance); // for etherscan
        Transfer(address(0),owner,ownerBalance); // for etherscan
        Transfer(address(0),animator,animatorBalance); // for etherscan
        LogInvestment(msg.sender,_partner,investing);
    }

    /**
     * @dev Delete all tokens owned by sender and return unpaid dividends and 90% of initial investment
     */
    function disinvest() external {
        require(investStart == 0);
        commitDividend(msg.sender);
        uint initialInvestment = balances[msg.sender] * 10**15;
        Transfer(msg.sender,address(0),balances[msg.sender]); // for etherscan
        delete balances[msg.sender]; // totalSupply stays the same, investBalance is reduced
        investBalance -= initialInvestment;
        wallets[msg.sender].balance += uint208(initialInvestment * 9 / 10);
        payWallet();
    }

    /**
     * @dev Pay unpaid dividends
     */
    function payDividends() external {
        require(investStart == 0);
        commitDividend(msg.sender);
        payWallet();
    }

    /**
     * @dev Commit remaining dividends before transfer of tokens
     */
    function commitDividend(address _who) internal {
        uint last = wallets[_who].lastDividendPeriod;
        if((balances[_who]==0) || (last==0)){
            wallets[_who].lastDividendPeriod=uint16(dividendPeriod);
            return;
        }
        if(last==dividendPeriod) {
            return;
        }
        uint share = balances[_who] * 0xffffffff / totalSupply;
        uint balance = 0;
        for(;last<dividendPeriod;last++) {
            balance += share * dividends[last];
        }
        balance = (balance / 0xffffffff);
        walletBalance += balance;
        wallets[_who].balance += uint208(balance);
        wallets[_who].lastDividendPeriod = uint16(last);
        LogDividend(_who,balance,last);
    }

/* lottery functions */

    function betPrize(Bet _player, uint24 _hash) constant private returns (uint) { // house fee 13.85%
        uint24 bethash = uint24(_player.betHash);
        uint24 hit = bethash ^ _hash;
        uint24 matches =
            ((hit & 0xF) == 0 ? 1 : 0 ) +
            ((hit & 0xF0) == 0 ? 1 : 0 ) +
            ((hit & 0xF00) == 0 ? 1 : 0 ) +
            ((hit & 0xF000) == 0 ? 1 : 0 ) +
            ((hit & 0xF0000) == 0 ? 1 : 0 ) +
            ((hit & 0xF00000) == 0 ? 1 : 0 );
        if(matches == 6){
            return(uint(_player.value) * 7000000);
        }
        if(matches == 5){
            return(uint(_player.value) * 20000);
        }
        if(matches == 4){
            return(uint(_player.value) * 500);
        }
        if(matches == 3){
            return(uint(_player.value) * 25);
        }
        if(matches == 2){
            return(uint(_player.value) * 3);
        }
        return(0);
    }
    
    /**
     * @dev Check if won in lottery
     */
    function betOf(address _who) constant external returns (uint)  {
        Bet memory player = bets[_who];
        if( (player.value==0) ||
            (player.blockNum<=1) ||
            (block.number<player.blockNum) ||
            (block.number>=player.blockNum + (10 * hashesSize))){
            return(0);
        }
        if(block.number<player.blockNum+256){
            return(betPrize(player,uint24(block.blockhash(player.blockNum))));
        }
        if(hashFirst>0){
            uint32 hash = getHash(player.blockNum);
            if(hash == 0x1000000) { // load hash failed :-(, return funds
                return(uint(player.value));
            }
            else{
                return(betPrize(player,uint24(hash)));
            }
	}
        return(0);
    }

    /**
     * @dev Check if won in lottery
     */
    function won() public {
        Bet memory player = bets[msg.sender];
        if(player.blockNum==0){ // create a new player
            bets[msg.sender] = Bet({value: 0, betHash: 0, blockNum: 1});
            return;
        }
        if((player.value==0) || (player.blockNum==1)){
            payWallet();
            return;
        }
        require(block.number>player.blockNum); // if there is an active bet, throw()
        if(player.blockNum + (10 * hashesSize) <= block.number){ // last bet too long ago, lost !
            LogLate(msg.sender,player.blockNum,block.number);
            bets[msg.sender] = Bet({value: 0, betHash: 0, blockNum: 1});
            return;
        }
        uint prize = 0;
        uint32 hash = 0;
        if(block.number<player.blockNum+256){
            hash = uint24(block.blockhash(player.blockNum));
            prize = betPrize(player,uint24(hash));
        }
        else {
            if(hashFirst>0){ // lottery is open even before swap space (hashes) is ready, but player must collect results within 256 blocks after run
                hash = getHash(player.blockNum);
                if(hash == 0x1000000) { // load hash failed :-(
                    //prize = uint(player.value); no refunds anymore
                    LogLate(msg.sender,player.blockNum,block.number);
                    bets[msg.sender] = Bet({value: 0, betHash: 0, blockNum: 1});
                    return();
                }
                else{
                    prize = betPrize(player,uint24(hash));
                }
	    }
            else{
                LogLate(msg.sender,player.blockNum,block.number);
                bets[msg.sender] = Bet({value: 0, betHash: 0, blockNum: 1});
                return();
            }
        }
        bets[msg.sender] = Bet({value: 0, betHash: 0, blockNum: 1});
        if(prize>0) {
            LogWin(msg.sender,uint(player.betHash),uint(hash),prize);
            if(prize > maxWin){
                maxWin = prize;
                LogRecordWin(msg.sender,prize);
            }
            pay(prize);
        }
        else{
            LogLoss(msg.sender,uint(player.betHash),uint(hash));
        }
    }

    /**
     * @dev Send ether to buy tokens during ICO
     * @dev or send less than 1 ether to contract to play
     * @dev or send 0 to collect prize
     */
    function () payable external {
        if(msg.value > 0){
            if(investStart>1){ // during ICO payment to the contract is treated as investment
                invest(owner);
            }
            else{ // if not ICO running payment to contract is treated as play
                play();
            }
            return;
        }
        //check for dividends and other assets
        if(investStart == 0 && balances[msg.sender]>0){
            commitDividend(msg.sender);}
        won(); // will run payWallet() if nothing else available
    }

    /**
     * @dev Play in lottery
     */
    function play() payable public returns (uint) {
        return playSystem(uint(keccak256(msg.sender,block.number)), address(0));
    }

    /**
     * @dev Play in lottery with random numbers
     * @param _partner Affiliate partner
     */
    function playRandom(address _partner) payable public returns (uint) {
        return playSystem(uint(keccak256(msg.sender,block.number)), _partner);
    }

    /**
     * @dev Play in lottery with own numbers
     * @param _partner Affiliate partner
     */
    function playSystem(uint _hash, address _partner) payable public returns (uint) {
        won(); // check if player did not win 
        uint24 bethash = uint24(_hash);
        require(msg.value <= 1 ether && msg.value < hashBetMax);
        if(msg.value > 0){
            if(investStart==0) { // dividends only after investment finished
                dividends[dividendPeriod] += msg.value / 20; // 5% dividend
            }
            if(_partner != address(0)) {
                uint fee = msg.value / 100;
                walletBalance += fee;
                wallets[_partner].balance += uint208(fee); // 1% for affiliates
            }
            if(hashNext < block.number + 3) {
                hashNext = block.number + 3;
                hashBetSum = msg.value;
            }
            else{
                if(hashBetSum > hashBetMax) {
                    hashNext++;
                    hashBetSum = msg.value;
                }
                else{
                    hashBetSum += msg.value;
                }
            }
            bets[msg.sender] = Bet({value: uint192(msg.value), betHash: uint32(bethash), blockNum: uint32(hashNext)});
            LogBet(msg.sender,uint(bethash),hashNext,msg.value);
        }
        putHashes(25); // players help collecing data, now much more than in last contract
        return(hashNext);
    }

/* database functions */

    /**
     * @dev Create hash data swap space
     * @param _sadd Number of hashes to add (<=256)
     */
    function addHashes(uint _sadd) public returns (uint) {
        require(hashFirst == 0 && _sadd > 0 && _sadd <= hashesSize);
        uint n = hashes.length;
        if(n + _sadd > hashesSize){
            hashes.length = hashesSize;
        }
        else{
            hashes.length += _sadd;
        }
        for(;n<hashes.length;n++){ // make sure to burn gas
            hashes[n] = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;
        }
        if(hashes.length>=hashesSize) { // assume block.number > 10
            hashFirst = block.number - ( block.number % 10);
            hashLast = hashFirst;
        }
        return(hashes.length);
    }

    /**
     * @dev Create hash data swap space, add 128 hashes
     */
    function addHashes128() external returns (uint) {
        return(addHashes(128));
    }

    function calcHashes(uint32 _lastb, uint32 _delta) constant private returns (uint) {
        // assert(!(_lastb % 10)); this is required
        return( ( uint(block.blockhash(_lastb  )) & 0xFFFFFF )
            | ( ( uint(block.blockhash(_lastb+1)) & 0xFFFFFF ) << 24 )
            | ( ( uint(block.blockhash(_lastb+2)) & 0xFFFFFF ) << 48 )
            | ( ( uint(block.blockhash(_lastb+3)) & 0xFFFFFF ) << 72 )
            | ( ( uint(block.blockhash(_lastb+4)) & 0xFFFFFF ) << 96 )
            | ( ( uint(block.blockhash(_lastb+5)) & 0xFFFFFF ) << 120 )
            | ( ( uint(block.blockhash(_lastb+6)) & 0xFFFFFF ) << 144 )
            | ( ( uint(block.blockhash(_lastb+7)) & 0xFFFFFF ) << 168 )
            | ( ( uint(block.blockhash(_lastb+8)) & 0xFFFFFF ) << 192 )
            | ( ( uint(block.blockhash(_lastb+9)) & 0xFFFFFF ) << 216 )
            | ( ( uint(_delta) / hashesSize) << 240)); 
    }

    function getHash(uint _block) constant private returns (uint32) {
        uint delta = (_block - hashFirst) / 10;
        uint hash = hashes[delta % hashesSize];
        if(delta / hashesSize != hash >> 240) {
            return(0x1000000); // load failed, incorrect data in hashes
        }
        uint slotp = (_block - hashFirst) % 10; 
        return(uint32((hash >> (24 * slotp)) & 0xFFFFFF));
    }
    
    /**
     * @dev Fill hash data
     */
    function putHash() public returns (bool) {
        uint lastb = hashLast;
        if(lastb == 0 || block.number <= lastb + 10) {
            return(false);
        }
        if(lastb < block.number - 245) {
            uint num = block.number - 245;
            lastb = num - (num % 10);
        }
        uint delta = (lastb - hashFirst) / 10;
        hashes[delta % hashesSize] = calcHashes(uint32(lastb),uint32(delta));
        hashLast = lastb + 10;
        return(true);
    }

    /**
     * @dev Fill hash data many times
     * @param _num Number of iterations
     */
    function putHashes(uint _num) public {
        uint n=0;
        for(;n<_num;n++){
            if(!putHash()){
                return;
            }
        }
    }
    
}

    Contract ABI  
[{"constant":false,"inputs":[{"name":"_partner","type":"address"}],"name":"invest","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_maxsum","type":"uint256"}],"name":"setBetMax","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"won","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"putHash","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"maxWin","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_partner","type":"address"}],"name":"playRandom","outputs":[{"name":"","type":"uint256"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"_hash","type":"uint256"},{"name":"_partner","type":"address"}],"name":"playSystem","outputs":[{"name":"","type":"uint256"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"animator","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"hashesSize","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_sadd","type":"uint256"}],"name":"addHashes","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"dividendsBlocks","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"betValueOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_who","type":"address"}],"name":"changeAnimator","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_num","type":"uint256"}],"name":"putHashes","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_who","type":"address"}],"name":"betOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"resetBet","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"hashes","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"walletBalanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"hashFirst","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"investBalanceGot","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"hashesLength","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"hashNext","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"dividends","outputs":[{"name":"","type":"uint256"}],"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":"_owner","type":"address"}],"name":"betBlockNumberOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"betHashOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"play","outputs":[{"name":"","type":"uint256"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"payWallet","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"investStart","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_who","type":"address"}],"name":"changeOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"addHashes128","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"hashLast","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"hotStore","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"hashBetMax","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"investDirect","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"walletTimeOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"investBalanceMax","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"walletBalance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_amount","type":"uint256"}],"name":"coldStore","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"coldStoreLast","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"houseKeeping","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"remaining","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"hashBetSum","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"payDividends","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"investBalance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"disinvest","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"dividendPeriod","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"walletPeriodOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_when","type":"uint256"}],"name":"setInvestStart","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"player","type":"address"},{"indexed":false,"name":"bethash","type":"uint256"},{"indexed":false,"name":"blocknumber","type":"uint256"},{"indexed":false,"name":"betsize","type":"uint256"}],"name":"LogBet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"player","type":"address"},{"indexed":false,"name":"bethash","type":"uint256"},{"indexed":false,"name":"hash","type":"uint256"}],"name":"LogLoss","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"player","type":"address"},{"indexed":false,"name":"bethash","type":"uint256"},{"indexed":false,"name":"hash","type":"uint256"},{"indexed":false,"name":"prize","type":"uint256"}],"name":"LogWin","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"investor","type":"address"},{"indexed":true,"name":"partner","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"LogInvestment","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"player","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"LogRecordWin","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"player","type":"address"},{"indexed":false,"name":"playerBlockNumber","type":"uint256"},{"indexed":false,"name":"currentBlockNumber","type":"uint256"}],"name":"LogLate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"investor","type":"address"},{"indexed":false,"name":"amount","type":"uint256"},{"indexed":false,"name":"period","type":"uint256"}],"name":"LogDividend","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"spender","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"}]

  Contract Creation Code Switch To Opcodes View
60606040526000600755600160085560006009556000600a55692a5a058fc295ed000000600b556001600c556000600e556000600f55600060105560006011556000601255674563918244f40000601355600060155534156200006157600080fd5b60018054600160a060020a03338116600160a060020a0319928316811780855560028054909416909117909255600c5491166000908152600560205260409020805461ffff9092167a0100000000000000000000000000000000000000000000000000000260d060020a61ffff0219909216919091179055600d805490918101620000ed83826200011f565b506000918252602082200155600d8054600181016200010d83826200011f565b5060009182526020822001556200016f565b8154818355818115116200014657600083815260209020620001469181019083016200014b565b505050565b6200016c91905b8082111562000168576000815560010162000152565b5090565b90565b6128fc806200017f6000396000f3006060604052361561028d5763ffffffff60e060020a60003504166303f9c793811461030857806306fdde031461031c5780630751076d146103a6578063095ea7b3146103bc57806312c8052f146103de57806313e4b51f146103e957806316d190e31461041057806318160ddd1461043557806323b872dd146104485780632406e9fa146104705780632669957614610484578063313ce5671461049b57806331c2b6e6146104ae57806337c43088146104dd578063380f3087146104f05780633de8d340146105065780633e43b6521461051957806340c73d1714610538578063413e90e7146105575780634288d7591461056d57806343146f361461058c578063501895ae1461059f57806366ce3bd2146105b55780636b486818146105d45780636cc7d828146105e757806370a08231146105fa57806370ccd928146106195780637227c7ce1461062c578063814b3fe01461063f5780638da5cb5b146106555780638eecddcf14610668578063904d22481461068757806393e84cd9146106a657806395d89b41146106ae5780639ce962ca146106c1578063a367d99a146106d4578063a6f9dae1146106e7578063a9059cbb14610706578063b3470e9714610728578063bc8517181461073b578063be1eefbf1461074e578063bfba902914610756578063c27509cf14610769578063c3c59aa914610771578063c416436514610790578063cd0a314b146107a3578063cd88333e146107b6578063d6d25008146107cc578063d9fa9335146107df578063dd62ed3e146107f2578063de46907114610817578063de88a3421461082a578063df12b94e1461083d578063df1ead8214610850578063e4cc98a514610863578063e73cc2eb14610876578063e76ece0114610895575b60003411156102ca57600160085411156102bb576001546102b690600160a060020a03166108ab565b6102c5565b6102c3610be8565b505b610306565b6008541580156102f05750600160a060020a033316600090815260036020526040812054115b156102fe576102fe33610c2d565b610306610df0565b005b610306600160a060020a03600435166108ab565b341561032757600080fd5b61032f61145e565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561036b578082015183820152602001610353565b50505050905090810190601f1680156103985780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156103b157600080fd5b610306600435611495565b34156103c757600080fd5b610306600160a060020a03600435166024356114b2565b34156102fe57600080fd5b34156103f457600080fd5b6103fc611550565b604051901515815260200160405180910390f35b341561041b57600080fd5b6104236115d5565b60405190815260200160405180910390f35b341561044057600080fd5b6104236115db565b341561045357600080fd5b610306600160a060020a03600435811690602435166044356115e1565b610423600160a060020a0360043516611703565b610423600435600160a060020a0360243516611747565b34156104a657600080fd5b610423611975565b34156104b957600080fd5b6104c161197a565b604051600160a060020a03909116815260200160405180910390f35b34156104e857600080fd5b610423611989565b34156104fb57600080fd5b61042360043561198f565b341561051157600080fd5b610423611a49565b341561052457600080fd5b610423600160a060020a0360043516611a97565b341561054357600080fd5b610306600160a060020a0360043516611abb565b341561056257600080fd5b610306600435611b26565b341561057857600080fd5b610423600160a060020a0360043516611b50565b341561059757600080fd5b610306611c9d565b34156105aa57600080fd5b610423600435611cc3565b34156105c057600080fd5b610423600160a060020a0360043516611ce2565b34156105df57600080fd5b610423611d06565b34156105f257600080fd5b610423611d0c565b341561060557600080fd5b610423600160a060020a0360043516611d12565b341561062457600080fd5b610423611d2d565b341561063757600080fd5b610423611d33565b341561064a57600080fd5b610423600435611d39565b341561066057600080fd5b6104c1611d47565b341561067357600080fd5b610423600160a060020a0360043516611d56565b341561069257600080fd5b610423600160a060020a0360043516611d7e565b610423610be8565b34156106b957600080fd5b61032f611da6565b34156106cc57600080fd5b610306611ddd565b34156106df57600080fd5b610423611e83565b34156106f257600080fd5b610306600160a060020a0360043516611e89565b341561071157600080fd5b610306600160a060020a0360043516602435611ef4565b341561073357600080fd5b61042361206d565b341561074657600080fd5b610423612079565b61030661207f565b341561076157600080fd5b6104236120ce565b6103066120d4565b341561077c57600080fd5b610423600160a060020a03600435166120e9565b341561079b57600080fd5b610423612111565b34156107ae57600080fd5b610423612117565b34156107c157600080fd5b61030660043561211d565b34156107d757600080fd5b6104236121f2565b34156107ea57600080fd5b6103066121f8565b34156107fd57600080fd5b610423600160a060020a03600435811690602435166122a0565b341561082257600080fd5b6104236122cb565b341561083557600080fd5b6103066122d1565b341561084857600080fd5b6104236122ef565b341561085b57600080fd5b6103066122f5565b341561086e57600080fd5b6104236123c2565b341561088157600080fd5b610423600160a060020a03600435166123c8565b34156108a057600080fd5b6103066004356123ee565b60008060008060016008541180156108c95750600854620140000143105b80156108d85750600b54600954105b15156108e357600080fd5b349350600954600b54038411156109545760098054600b5491829055600a829055600060085590039350600160a060020a0333166108fc61092a348763ffffffff61243516565b9081150290604051600060405180830381858888f19350505050151561094f57600080fd5b610965565b6009805485019055600a8054850190555b600160a060020a03851615806109885750600154600160a060020a038681169116145b156109dc5760078054600a8604908101909155600154600160a060020a031660009081526005602052604090208054600160d060020a03198116600160d060020a0391821690930116919091179055610a4e565b60078054606460058781029190910460028102909201909255600154600160a060020a03908116600090815260209390935260408084208054600160d060020a0319808216600160d060020a039283168701831617909255928a16855293208054938416938216909201169190911790555b600c54600160a060020a0333166000908152600560205260409020805461ffff90921660d060020a027bffff00000000000000000000000000000000000000000000000000001990921691909117905566038d7ea4c680008404925067016345785d8a00006010850204915067016345785d8a0000600a8502600160a060020a0333811660008181526003602052604080822080548a019055600154841682528082208054890190556002549093168152828120805495909404948501909355825486880185010183559293506000805160206128b18339815191529086905190815260200160405180910390a3600154600160a060020a031660006000805160206128b18339815191528460405190815260200160405180910390a3600254600160a060020a031660006000805160206128b18339815191528360405190815260200160405180910390a384600160a060020a031633600160a060020a03167f36a013c86c271c703c54dee591bc768e347954a0a9a1937dd17f5a29e9a8e6458660405190815260200160405180910390a35050505050565b6000610c273343604051600160a060020a03929092166c0100000000000000000000000002825260148201526034016040519081900390206000611747565b90505b90565b600160a060020a038116600090815260056020908152604080832054600390925282205460d060020a90910461ffff16919081901580610c6b575082155b15610cc557600c54600160a060020a0385166000908152600560205260409020805461ffff90921660d060020a027bffff000000000000000000000000000000000000000000000000000019909216919091179055610dea565b600c54831415610cd457610dea565b60008054600160a060020a0386168252600360205260409091205463ffffffff02811515610cfe57fe5b049150600090505b600c54831015610d3857600d805484908110610d1e57fe5b600091825260209091200154600190930192820201610d06565b6007805463ffffffff9092049182019055600160a060020a038416600081815260056020526040908190208054600160d060020a03198116600160d060020a039182168601909116177bffff0000000000000000000000000000000000000000000000000000191660d060020a61ffff8816021790557fe1e87f40e4de2a6b68365d854f85940aad44d84933d399007702c6d340da445f90839086905191825260208201526040908101905180910390a25b50505050565b610df8612857565b600160a060020a03331660009081526006602052604080822082916060905190810160409081529154600160c060020a038116825263ffffffff60c060020a82048116602084015260e060020a9091041691810191825293505163ffffffff161515610efe576060604051908101604090815260008083526020808401829052600183850152600160a060020a0333168252600690522081518154600160c060020a031916600160c060020a03919091161781556020820151815463ffffffff9190911660c060020a0260c060020a63ffffffff02199091161781556040820151815463ffffffff9190911660e060020a02600160e060020a0390911617905550611459565b8251600160c060020a03161580610f1f5750826040015163ffffffff166001145b15610f3157610f2c611ddd565b611459565b826040015163ffffffff164311610f4757600080fd5b4362028000604085015163ffffffff16011161104c5733600160a060020a03167f770d64c654906ebab085526dd881064f61f0e5990caa94c94167eb29bc4645c684604001514360405163ffffffff909216825260208201526040908101905180910390a26060604051908101604090815260008083526020808401829052600183850152600160a060020a0333168252600690522081518154600160c060020a031916600160c060020a03919091161781556020820151815463ffffffff9190911660c060020a0260c060020a63ffffffff02199091161781556040820151815463ffffffff9190911660e060020a02600160e060020a0390911617905550611459565b50600090508060408301516101000163ffffffff1643101561109057826040015163ffffffff16406001900462ffffff1690506110898382612447565b91506112aa565b6000600f5411156111bb576110ae836040015163ffffffff1661259c565b90508063ffffffff16630100000014156111b15733600160a060020a03167f770d64c654906ebab085526dd881064f61f0e5990caa94c94167eb29bc4645c684604001514360405163ffffffff909216825260208201526040908101905180910390a26060604051908101604090815260008083526020808401829052600183850152600160a060020a0333168252600690522081518154600160c060020a031916600160c060020a03919091161781556020820151815463ffffffff9190911660c060020a0260c060020a63ffffffff02199091161781556040820151815463ffffffff9190911660e060020a02600160e060020a0390911617905550611459565b6110898382612447565b33600160a060020a03167f770d64c654906ebab085526dd881064f61f0e5990caa94c94167eb29bc4645c684604001514360405163ffffffff909216825260208201526040908101905180910390a26060604051908101604090815260008083526020808401829052600183850152600160a060020a0333168252600690522081518154600160c060020a031916600160c060020a03919091161781556020820151815463ffffffff9190911660c060020a0260c060020a63ffffffff02199091161781556040820151815463ffffffff9190911660e060020a02600160e060020a0390911617905550611459565b6060604051908101604090815260008083526020808401829052600183850152600160a060020a0333168252600690522081518154600160c060020a031916600160c060020a03919091161781556020820151815463ffffffff9190911660c060020a0260c060020a63ffffffff02199091161781556040820151815463ffffffff9190911660e060020a02600160e060020a039091161790555060008211156114045733600160a060020a03167e362509948ea59afac5c6fa93fea5327b624bc705a6574f4e9f26e9d8bd7ccc846020015163ffffffff168363ffffffff168560405180848152602001838152602001828152602001935050505060405180910390a2600e548211156113fb57600e829055600160a060020a0333167f955214d16f858518f04c701d01a6e2f5668548b6be3c6f2f0f8981f77f2cfc068360405190815260200160405180910390a25b610f2c82612634565b33600160a060020a03167f7375ed8230669ea9d64a9db629d7ce9501779604a67c95c0111377cf09f5b9b9846020015163ffffffff168363ffffffff1660405191825260208201526040908101905180910390a25b505050565b60408051908101604052601381527f536d61727442696c6c696f6e7320546f6b656e00000000000000000000000000602082015281565b60015433600160a060020a039081169116146114ad57fe5b601355565b80158015906114e55750600160a060020a0333811660009081526004602090815260408083209386168352929052205415155b156114ec57fe5b600160a060020a03338116600081815260046020908152604080832094871680845294909152908190208490557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259084905190815260200160405180910390a35050565b6010546000908180821580611568575082600a014311155b1561157657600093506115cf565b60f543038310156115915760f41943019150600a8206820392505b50600f54600a908303046115a5838261271e565b6014805461400084069081106115b757fe5b600091825260209091200155600a8301601055600193505b50505090565b600e5481565b60005481565b6000606060643610156115f057fe5b600160a060020a0380861660009081526004602090815260408083203390941683529290522054915061162285610c2d565b61162b84610c2d565b61163b828463ffffffff61243516565b600160a060020a038087166000818152600460209081526040808320339095168352938152838220949094559081526003909252902054611682908463ffffffff61243516565b600160a060020a0380871660009081526003602052604080822093909355908616815220546116b7908463ffffffff61284116565b600160a060020a03808616600081815260036020526040908190209390935591908716906000805160206128b18339815191529086905190815260200160405180910390a35050505050565b60006117413343604051600160a060020a03929092166c01000000000000000000000000028252601482015260340160405190819003902083611747565b92915050565b6000806000611754610df0565b849150670de0b6b3a76400003411158015611770575060135434105b151561177b57600080fd5b600034111561195f5760085415156117b55760143404600d600c548154811015156117a257fe5b6000918252602090912001805490910190555b600160a060020a0384161561180b57506007805460643404908101909155600160a060020a03841660009081526005602052604090208054600160d060020a03808216840116600160d060020a03199091161790555b43600301601154101561182857600343016011553460125561184f565b6013546012541115611846576011805460010190553460125561184f565b60128054340190555b60606040519081016040908152600160c060020a033416825262ffffff841660208084019190915260115463ffffffff1682840152600160a060020a033316600090815260069091522081518154600160c060020a031916600160c060020a03919091161781556020820151815463ffffffff9190911660c060020a0260c060020a63ffffffff02199091161781556040820151815463ffffffff9190911660e060020a02600160e060020a0390911617905550601154600160a060020a033316907f063f4540040cf99a22f577ef321c170763020e6277e47275ed9b3d17ec14e13d9062ffffff8516903460405180848152602001838152602001828152602001935050505060405180910390a25b6119696019611b26565b50506011549392505050565b600081565b600254600160a060020a031681565b61400081565b600080600f5460001480156119a45750600083115b80156119b257506140008311155b15156119bd57600080fd5b5060145461400083820111156119e1576140006119db601482612877565b506119f4565b601480548401906119f29082612877565b505b601454811015611a2457600019601482815481101515611a1057fe5b6000918252602090912001556001016119f4565b6014546140009010611a3f57600a43064303600f8190556010555b5050601454919050565b60008060006008541115611a605760009150611a93565b600f5462028000904303049050600c54811115611a805760009150611a93565b600f546202800090430306620280000391505b5090565b600160a060020a0316600090815260066020526040902054600160c060020a031690565b60025433600160a060020a03908116911614611ad357fe5b600160a060020a0381161515611ae557fe5b611aee33610c2d565b611af781610c2d565b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60005b81811015611b4c57611b39611550565b1515611b4457611b4c565b600101611b29565b5050565b6000611b5a612857565b600160a060020a038316600090815260066020526040808220906060905190810160409081529154600160c060020a038116825263ffffffff60c060020a82048116602084015260e060020a909104169181019190915291508151600160c060020a03161580611bd557506001826040015163ffffffff1611155b80611be95750816040015163ffffffff1643105b80611c03575062028000604083015163ffffffff16014310155b15611c115760009250611c96565b81604001516101000163ffffffff16431015611c4357611c3c82836040015163ffffffff1640612447565b9250611c96565b6000600f541115611c9157611c61826040015163ffffffff1661259c565b90508063ffffffff1663010000001415611c87578151600160c060020a03169250611c96565b611c3c8282612447565b600092505b5050919050565b60015433600160a060020a03908116911614611cb557fe5b600343016011556000601255565b6014805482908110611cd157fe5b600091825260209091200154905081565b600160a060020a0316600090815260056020526040902054600160d060020a031690565b600f5481565b600a5481565b600160a060020a031660009081526003602052604090205490565b60145490565b60115481565b600d805482908110611cd157fe5b600154600160a060020a031681565b600160a060020a031660009081526006602052604090205460e060020a900463ffffffff1690565b600160a060020a031660009081526006602052604090205460c060020a900463ffffffff1690565b60408051908101604052600581527f536d617274000000000000000000000000000000000000000000000000000000602082015281565b600160a060020a033316600090815260056020526040812054600160d060020a03168190118015611e34575033600160a060020a03166000908152600560205260409020544260e060020a90910463ffffffff1611155b15611e805750600160a060020a03331660009081526005602052604090208054600160d060020a0319811690915560078054600160d060020a03909216918290039055611e8081612634565b50565b60085481565b60015433600160a060020a03908116911614611ea157fe5b600160a060020a0381161515611eb357fe5b611ebc33610c2d565b611ec581610c2d565b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60406044361015611f0157fe5b611f0a33610c2d565b600160a060020a033316600090815260036020526040902054611f33908363ffffffff61243516565b600160a060020a03338116600090815260036020526040902091909155838116309091161415611ff057600154611f7290600160a060020a0316610c2d565b600154600160a060020a0316600090815260036020526040902054611f9d908363ffffffff61284116565b60018054600160a060020a039081166000908152600360205260409081902093909355905481169133909116906000805160206128b18339815191529085905190815260200160405180910390a3611459565b611ff983610c2d565b600160a060020a038316600090815260036020526040902054612022908363ffffffff61284116565b600160a060020a0380851660008181526003602052604090819020939093559133909116906000805160206128b18339815191529085905190815260200160405180910390a3505050565b6000610c27608061198f565b60105481565b600780543490810190915533600160a060020a031660009081526005602052604090208054600160d060020a03198116600160d060020a03918216909301169190911790556120cc6121f8565b565b60135481565b6001546120cc90600160a060020a03166108ab565b600160a060020a031660009081526005602052604090205460e060020a900463ffffffff1690565b600b5481565b60075481565b60015433600160a060020a0390811691161461213557fe5b61213d6121f8565b60008111801561216e575080600754600a60095460090281151561215d57fe5b04010130600160a060020a03163110155b151561217957600080fd5b600a54600290046009541015156121ba57610190600160a060020a033016310481111580156121af57504260155462093a800111155b15156121ba57600080fd5b600160a060020a03331681156108fc0282604051600060405180830381858888f1935050505015156121eb57600080fd5b5042601555565b60155481565b60006001600854118015612213575060085462014000014310155b15612222576000600855611e80565b6000600f541115611e8057600f5462028000904303600d5491900491506001190181111561226957600d80546001810161225c8382612877565b5060009182526020822001555b600c548111801561227a5750600854155b801561228f57506001600d8054905003600c54105b15611e8057600c8054600101905550565b600160a060020a03918216600090815260046020908152604080832093909416825291909152205490565b60125481565b600854156122de57600080fd5b6122e733610c2d565b6120cc611ddd565b60095481565b6008546000901561230557600080fd5b61230e33610c2d565b50600160a060020a0333166000818152600360205260408082205466038d7ea4c68000810293916000805160206128b183398151915291905190815260200160405180910390a3600160a060020a033316600090815260036020526040812055600980548290038155600a90820233600160a060020a031660009081526005602052604090208054600160d060020a0319811693909204600160d060020a0392831601909116919091179055611e80611ddd565b600c5481565b600160a060020a031660009081526005602052604090205460d060020a900461ffff1690565b60015433600160a060020a0390811691161461240657fe5b600854600114801561241a57506000600f54115b801561242557508043105b151561243057600080fd5b600855565b60008282111561244157fe5b50900390565b60008060008085602001519250848318915062f0000082161561246b57600061246e565b60015b620f0000831615612480576000612483565b60015b61f000841615612494576000612497565b60015b610f008516156124a85760006124ab565b60015b60f08616156124bb5760006124be565b60015b600f8716156124ce5760006124d1565b60015b010101010160ff1690508062ffffff1660061415612500578551600160c060020a0316626acfc0029350612593565b8062ffffff1660051415612524578551600160c060020a0316614e20029350612593565b8062ffffff1660041415612548578551600160c060020a03166101f4029350612593565b8062ffffff166003141561256b578551600160c060020a03166019029350612593565b8062ffffff166002141561258e578551600160c060020a03166003029350612593565b600093505b50505092915050565b600080600080600a600f5486038115156125b257fe5b049250601461400084068154811015156125c857fe5b60009182526020909120015491507e01000000000000000000000000000000000000000000000000000000000000820461400084041461260e576301000000935061262c565b600f54600a90860306905080601802829060020a900462ffffff1693505b505050919050565b600230600160a060020a03163104600082821061269357600160a060020a03331683156108fc0284604051600060405180830381858888f19350505050151561267c57600080fd5b66038d7ea4c68000831115610f2c57610f2c6121f8565b506007805482840390810190915533600160a060020a0316600081815260056020526040908190208054600160d060020a03198116600160d060020a03918216860190911617600160e060020a031660e060020a4262278d000163ffffffff16021790556108fc84150290849051600060405180830381858888f19350505050151561145957600080fd5b600060f061400063ffffffff841663ffffffff8087164062ffffff908116630100000060018a0184164083160217660100000000000060028a810185164084169190910291909117690100000000000000000060038b01851640841602176c0100000000000000000000000060048b01851640841602176f0100000000000000000000000000000060058b0185164084160217720100000000000000000000000000000000000060068b0185164084160217750100000000000000000000000000000000000000000060078b018516408416021760c060020a60088b01851640841602177b0100000000000000000000000000000000000000000000000000000060098b01949094164092909216929092021793900a9190040217905092915050565b60008282018381101561285057fe5b9392505050565b606060405190810160409081526000808352602083018190529082015290565b81548183558181151161145957600083815260209020611459918101908301610c2a91905b80821115611a93576000815560010161289c5600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058204ba6d7642977dbac7f5692df6ca567d139dd60cd35c059046bb665715a1b25130029

   Swarm Source:
bzzr://4ba6d7642977dbac7f5692df6ca567d139dd60cd35c059046bb665715a1b2513
View All
Block Age txn Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward
Make sure to use the "downvote" button for any spammy posts, and the "upvote" for interesting conversations.