contract Minaxis  is StandardToken, Ownable {



    string public constant name = "Minaxis";

    string public constant symbol = "MIN";

    uint public constant decimals = 18;

    uint256 public constant initialSupply = 10000000 * (10 ** uint256(decimals));



    uint public totalWeiToBeDistributed = 0;



    // Constructor

    function Minaxis () {

        totalSupply = initialSupply;

        balances[msg.sender] = initialSupply; // Send all tokens to owner

        /*****************************************/

        addresses[1] = msg.sender;

        indexes[msg.sender] = 1;

        lastIndex = 1;

        /*****************************************/

    }



    function getAddresses() constant returns (address[]){

        address[] memory addrs = new address[](lastIndex);

        for(uint i = 0; i < lastIndex; i++){

            addrs[i] = addresses[i+1];

        }

        return addrs;

    }



    function setTotalWeiToBeDistributed(uint _totalWei) onlyOwner {

      totalWeiToBeDistributed = _totalWei;

    }



    function distributeEth(uint startIndex, uint endIndex) onlyOwner {

      for(uint i = startIndex; i < endIndex; ++i){

        address holder = addresses[i+1];

        uint reward = (balances[holder]*totalWeiToBeDistributed)/(totalSupply);

        if(!holder.send(reward)) throw;

      }

    }



    function withdrawEth() onlyOwner {

      if(!owner.send(this.balance)) throw;

    }



    function() payable {}

}
function Minaxis () {

    totalSupply = initialSupply;

    balances[msg.sender] = initialSupply; // Send all tokens to owner

    /*****************************************/

    addresses[1] = msg.sender;

    indexes[msg.sender] = 1;

    lastIndex = 1;

    /*****************************************/

}

// Constructor