contract Freezable is ERC20 {

  mapping (address => uint256) private _freeze;

  /**
   * Event that notifies clients about the amount frozen
   * @param from Address owner of the frozen funds
   * @param value Amount of tokens frozen
   */
  event Freeze(
    address indexed from,
    uint256 value
  );

  /**
   * Event that notifies clients about the amount unfrozen
   * @param from Address owner of the unfrozen funds
   * @param value Amount of tokens unfrozen
   */
  event Unfreeze(
    address indexed from,
    uint256 value
  );

  /**
   * @dev Gets the frozen balance of the specified address.
   * @param account The address to query the frozen balance of.
   * @return An uint256 representing the amount frozen by the passed address.
   */
  function freezeOf(address account) public view returns (uint256) {
    return _freeze[account];
  }

  /**
   * @dev Freezes a specific amount of tokens
   * @param amount uint256 The amount of token to be frozen
   */
  function freeze(uint256 amount) public {
    require(balances[msg.sender] >= amount, "Freezable: Amount to be frozen exceeds the account balance");
    require(amount > 0, "Freezable: Can not freeze negative amount");
    balances[msg.sender] = balances[msg.sender].sub(amount);
    _freeze[msg.sender] = _freeze[msg.sender].add(amount);
    emit Freeze(msg.sender, amount);
  }

  /**
   * @dev Unfreezes a specific amount of tokens
   * @param amount uint256 The amount of token to be unfrozen
   */
  function unfreeze(uint256 amount) public {
    require(_freeze[msg.sender] >= amount, "Freezable: Amount to be unfrozen exceeds the account balance");
    require(amount > 0, "Freezable: Can not unfreeze negative amount");
    _freeze[msg.sender] = _freeze[msg.sender].sub(amount);
    balances[msg.sender] = balances[msg.sender].add(amount);
    emit Unfreeze(msg.sender, amount);
  }
}
/**
 * @title Freezable Token
 * @dev Token that can be frozen.
 */
function freeze(uint256 amount) public {
  require(balances[msg.sender] >= amount, "Freezable: Amount to be frozen exceeds the account balance");
  require(amount > 0, "Freezable: Can not freeze negative amount");
  balances[msg.sender] = balances[msg.sender].sub(amount);
  _freeze[msg.sender] = _freeze[msg.sender].add(amount);
  emit Freeze(msg.sender, amount);
}

/**
 * @dev Freezes a specific amount of tokens
 * @param amount uint256 The amount of token to be frozen
 */