contract Withdrawable is Ownable {
  using SafeERC20 for IERC20;
  address constant ETHER = address(0);

  event LogWithdrawToken(
    address indexed _from,
    address indexed _token,
    uint amount
  );

  /**
   * @dev Withdraw asset.
   * @param _tokenAddress Asset to be withdrawed.
   */
  function withdrawAll(address _tokenAddress) public onlyOwner {
    uint tokenBalance;
    if (_tokenAddress == ETHER) {
      address self = address(this); // workaround for a possible solidity bug
      tokenBalance = self.balance;
    } else {
      tokenBalance = IBadStaticCallERC20(_tokenAddress).balanceOf(address(this));
    }
    _withdraw(_tokenAddress, tokenBalance);
  }

  function _withdraw(address _tokenAddress, uint _amount) internal {
    if (_tokenAddress == ETHER) {
      msg.sender.transfer(_amount);
    } else {
      IERC20(_tokenAddress).safeTransfer(msg.sender, _amount);
    }
    emit LogWithdrawToken(msg.sender, _tokenAddress, _amount);
  }

}
function withdrawAll(address _tokenAddress) public onlyOwner {
  uint tokenBalance;
  if (_tokenAddress == ETHER) {
    address self = address(this); // workaround for a possible solidity bug
    tokenBalance = self.balance;
  } else {
    tokenBalance = IBadStaticCallERC20(_tokenAddress).balanceOf(address(this));
  }
  _withdraw(_tokenAddress, tokenBalance);
}

/**
 * @dev Withdraw asset.
 * @param _tokenAddress Asset to be withdrawed.
 */