abstract contract ERC20Mintable is Context, Ownable, ERC20 {
  event Mint(address indexed to, uint256 amount);
  event MintFinished();

  bool public mintingFinished = false;

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

  modifier hasMintPermission() {
    require(_msgSender() == owner());
    _;
  }

  /**
   * @dev Function to mint tokens
   * @param _to The address that will receive the minted tokens.
   * @param _amount The amount of tokens to mint.
   */
  function mint(address _to, uint256 _amount) virtual hasMintPermission canMint public {
    _mint(_to, _amount);
  }

  /**
   * @dev Function to stop minting new tokens.
   * @return True if the operation was successful.
   */
  function finishMinting() onlyOwner canMint public returns (bool) {
    mintingFinished = true;
    emit MintFinished();
    return true;
  }
}
/**
 * @title Mintable token
 */
function finishMinting() onlyOwner canMint public returns (bool) {
  mintingFinished = true;
  emit MintFinished();
  return true;
}

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