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

    // event LogWithdraw(
    //     address indexed _from,
    //     address indexed _assetAddress,
    //     uint amount
    // );

    /**
     * @dev Withdraw asset.
     * @param _assetAddress Asset to be withdrawn.
     */
    function withdraw(address _assetAddress) public onlyOwner {
        uint256 assetBalance;
        if (_assetAddress == ETHER) {
            address self = address(this); // workaround for a possible solidity bug
            assetBalance = self.balance;
            msg.sender.transfer(assetBalance);
        } else {
            assetBalance = IERC20(_assetAddress).balanceOf(address(this));
            IERC20(_assetAddress).safeTransfer(msg.sender, assetBalance);
        }
        // emit LogWithdraw(msg.sender, _assetAddress, assetBalance);
    }
}
/**
 Ensures that any contract that inherits from this contract is able to
 withdraw funds that are accidentally received or stuck.
 */
function withdraw(address _assetAddress) public onlyOwner {
    uint256 assetBalance;
    if (_assetAddress == ETHER) {
        address self = address(this); // workaround for a possible solidity bug
        assetBalance = self.balance;
        msg.sender.transfer(assetBalance);
    } else {
        assetBalance = IERC20(_assetAddress).balanceOf(address(this));
        IERC20(_assetAddress).safeTransfer(msg.sender, assetBalance);
    }
    // emit LogWithdraw(msg.sender, _assetAddress, assetBalance);
}

/**
 * @dev Withdraw asset.
 * @param _assetAddress Asset to be withdrawn.
 */