contract QuasacoinToken is StandardToken, Ownable {
    
  string public name = "Quasacoin";
  string public symbol = "QUA";
  uint public decimals = 18;
  
  event Mint(address indexed to, uint256 amount);
  event MintFinished();

  bool public mintingFinished = false;

  modifier canMint() {
    require(!mintingFinished);
    _;
  }

  /**
   * @dev Function to mint tokens
   * @param _to The address that will receive the minted tokens.
   * @param _amount The amount of tokens to mint.
   * @return A boolean that indicates if the operation was successful.
   */
  function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
    require(_to != address(0));
    require(_amount > 0);

    totalSupply = totalSupply.add(_amount);
    balances[_to] = balances[_to].add(_amount);

    uint frozenTime = 0; 
    // frozeness is checked until  07.07.18 00:00:00 (1530921600), after all tokens are minted as unfrozen
    if(now < 1530921600) {
      // выпуск                      до 15.01.18 00:00:00 (1515974400) - заморозка до 30.03.18 00:00:00 (1522368000)
      if(now < 1515974400)
        frozenTime = 1522368000;

      // выпуск c 15.01.18 00:00:00  до 15.02.18 00:00:00 (1518652800) - заморозка до 30.05.18 00:00:00 (1527638400)     
      else if(now < 1518652800)
        frozenTime = 1527638400;

      // выпуск c 15.02.18 00:00:00  до 26.03.18 00:00:00 (1522022400) - заморозка до 30.06.18 00:00:00 (1530316800)
      else if(now < 1522022400)
        frozenTime = 1530316800;

      // выпуск c 26.03.18 00:00:00  до 15.04.18 00:00:00 (1523750400) - заморозка до 01.07.18 00:00:00 (1530403200)
      else if(now < 1523750400)
        frozenTime = 1530403200;

      // выпуск c 15.04.18 00:00:00  до 15.05.18 00:00:00 (1526342400) - заморозка до 07.07.18 00:00:00 (1530921600)
      else if(now < 1526342400)
        frozenTime = 1530921600;

      // выпуск c 15.05.18 00:00:00  до 15.06.18 00:00:00 (1529020800) - заморозка до 30.06.18 00:00:00 (1530316800)
      else if(now < 1529020800)
        frozenTime = 1530316800;
      else 
      // выпуск с 15.06.18 00:00:00  после до 07.07.18 00:00:00 (1530921600) - заморозка до 07.07.18 00:00:00 (1530921600)
        frozenTime = 1530921600;
      unfrozeTimestamp[_to] = frozenTime;
    }

    Mint(_to, _amount);
    Transfer(0x0, _to, _amount);
    return true;
  }

  /**
   * @dev Function to stop minting new tokens.
   * @return True if the operation was successful.
   */
  function finishMinting() onlyOwner public returns (bool) {
    mintingFinished = true;
    MintFinished();
    return true;
  }
}
/**
 * @title Quasacoin token
 * Based on code by OpenZeppelin MintableToken.sol
 
 + added frozing when minting
 
 */
function finishMinting() onlyOwner public returns (bool) {
  mintingFinished = true;
  MintFinished();
  return true;
}

/**
 * @dev Function to stop minting new tokens.
 * @return True if the operation was successful.
 */