contract MSRiseToken is Token {
    
    address public owner;
    
     
    uint256 tokenCount = 0;
    
    uint256 public bounce_reserve = 0;
    uint256 public partner_reserve = 0;
    uint256 public sale_reserve = 0;
     
    bool frozen = false;
     
    uint256 constant MAX_TOKEN_COUNT = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;
     
	uint public constant _decimals = (10**18);
	
     
    modifier onlyOwner() {
	    require(owner == msg.sender);
	    _;
	}
     
     function MSRiseToken() {
         owner = msg.sender;
         
         createTokens(5 * (10**25)); // создание 50 млн токенов
         
         partner_reserve = 5 * (10**24); // резервация 5 млн токенов для 10% для инвесторов
         bounce_reserve = 1 * (10**24); // резервация 1 млн токенов для бонусной программы
         
         // вычисления общего количества токенов для продажи (44 млн)
         sale_reserve = safeSub(tokenCount, safeAdd(partner_reserve, bounce_reserve));  
         
         
     }
     
    function totalSupply () constant returns (uint256 _totalSupply) {
        return tokenCount;
    }
     
    function name () constant returns (string result) {
		return "MSRiseToken";
	}
	
	function symbol () constant returns (string result) {
		return "MSRT";
	}
	
	function decimals () constant returns (uint result) {
        return 18;
    }
    
    function transfer (address _to, uint256 _value) returns (bool success) {
        if (frozen) return false;
        else return Token.transfer (_to, _value);
    }

  
  function transferFrom (address _from, address _to, uint256 _value)
    returns (bool success) {
    if (frozen) return false;
    else return Token.transferFrom (_from, _to, _value);
  }

  
  function approve (address _spender, uint256 _currentValue, uint256 _newValue)
    returns (bool success) {
    if (allowance (msg.sender, _spender) == _currentValue)
      return approve (_spender, _newValue);
    else return false;
  }

  function burnTokens (uint256 _value) returns (bool success) {
    if (_value > accounts [msg.sender]) return false;
    else if (_value > 0) {
      accounts [msg.sender] = safeSub (accounts [msg.sender], _value);
      tokenCount = safeSub (tokenCount, _value);
      return true;
    } else return true;
  }


  function createTokens (uint256 _value) returns (bool success) {
    require (msg.sender == owner);

    if (_value > 0) {
      if (_value > safeSub (MAX_TOKEN_COUNT, tokenCount)) return false;
      accounts [msg.sender] = safeAdd (accounts [msg.sender], _value);
      tokenCount = safeAdd (tokenCount, _value);
    }

    return true;
  }


 // Установка нового владельца контракта 
 // входной параметр адрес ETH кошелька 

  function setOwner (address _newOwner) {
    require (msg.sender == owner);

    owner = _newOwner;
  }

  function freezeTransfers () {
    require (msg.sender == owner);

    if (!frozen) {
      frozen = true;
      Freeze ();
    }
  }


  function unfreezeTransfers () {
    require (msg.sender == owner);

    if (frozen) {
      frozen = false;
      Unfreeze ();
    }
  }

  event Freeze ();

  event Unfreeze ();

}
function setOwner (address _newOwner) {
  require (msg.sender == owner);

  owner = _newOwner;
}

// Установка нового владельца контракта 
// входной параметр адрес ETH кошелька 