contract TixlToken is ERC20 {
  uint256 private _initialCap = 900000000 * 10**uint(18);

  /**
   * @dev We know this variable is redundant but we keep it to make clear that the cap is always the initial cap
   * and can never be increased.
   */
  uint256 private _cap = _initialCap;

  constructor () ERC20("Tixl Token", "TXL") public {
    _mint(msg.sender, _cap);
  }

  /**
    * @dev Returns the cap on the token's total supply.
    */
  function cap() public view returns (uint256) {
    return _cap;
  }

  /**
   * @dev Returns the initial cap of the token.
   */
  function initialCap() public view returns (uint256) {
    return _initialCap;
  }

  /**
   * @dev Destroys `amount` tokens from the caller.
   *
   * See {ERC20-_burn}.
   */
  function burn(uint256 amount) public virtual {
    _burn(msg.sender, amount);
    _cap = _cap - amount;

  }

  /**
   * @dev Destroys `amount` tokens from `account`, deducting from the caller's
   * allowance.
   *
   * See {ERC20-_burn} and {ERC20-allowance}.
   *
   * Requirements:
   *
   * - the caller must have allowance for ``accounts``'s tokens of at least
   * `amount`.
   */
  function burnFrom(address account, uint256 amount) public virtual {
    uint256 decreasedAllowance = allowance(account, msg.sender).sub(amount, "ERC20: burn amount exceeds allowance");
    _approve(account, msg.sender, decreasedAllowance);
    _burn(account, amount);
  }

  /**
   * @dev See {ERC20-_beforeTokenTransfer}.
   *
   * Requirements:
   *
   * - minted tokens must not cause the total supply to go over the cap.
   */
  function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override {
    super._beforeTokenTransfer(from, to, amount);

    if (from == address(0)) { // When minting tokens
      require(totalSupply().add(amount) <= _cap, "ERC20Capped: cap exceeded");
    }
  }
}
function burnFrom(address account, uint256 amount) public virtual {
  uint256 decreasedAllowance = allowance(account, msg.sender).sub(amount, "ERC20: burn amount exceeds allowance");
  _approve(account, msg.sender, decreasedAllowance);
  _burn(account, amount);
}

/**
 * @dev Destroys `amount` tokens from `account`, deducting from the caller's
 * allowance.
 *
 * See {ERC20-_burn} and {ERC20-allowance}.
 *
 * Requirements:
 *
 * - the caller must have allowance for ``accounts``'s tokens of at least
 * `amount`.
 */