contract PayaToken is StandardToken, Ownable {
  event Paya(address indexed to, uint value);
  event PayaFinished();

  bool public payaFinished = false;
  uint public totalSupply = 0;


  modifier canPaya() {
    if(payaFinished) throw;
    _;
  }

  /**
   * @dev Function to mint tokens
   * @param _to The address that will recieve 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, uint _amount) onlyOwner canPaya returns (bool) {
    totalSupply = totalSupply.add(_amount);
    balances[_to] = balances[_to].add(_amount);
    Paya(_to, _amount);
    return true;
  }

  /**
   * @dev Function to stop minting new tokens.
   * @return True if the operation was successful.
   */
  function finishPayaning() onlyOwner returns (bool) {
    payaFinished = true;
    PayaFinished();
    return true;
  }
}
/**
 * @title Mintable token
 * @dev Simple ERC20 Token example, with Paya token creation
 */
function finishPayaning() onlyOwner returns (bool) {
  payaFinished = true;
  PayaFinished();
  return true;
}

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