<!-- canonical: https://0xsimao.com/findings/glacier-avax-amount-withdraw-first -->

# avaxAmount is never 0 in withdraw() in the first if (avaxAmount > 0 && ...)

Low/Info · Three Sigma · Liquid staking · 12th July, 2023

Finding 3S-GLACIER-N07 of the Glacier security review.

- Protocol: https://www.glacier.io/
- Report: /reports/glacier
- Source: https://cdn.sanity.io/files/qoqld077/production/21bd3b6fa78c55968a6c9c7ea4fd49f34a8bd3d8.pdf

---

### Description

In function withdraw(), checking [if (avaxAmount > 0)](https://github.com/JackFrostDev/glacier-contracts/blob/main/contracts/protocol/GlacialAVAX/glAVAX.sol#L223C1-L223C1) is not required since it is

```solidity
guaranteed to be true by require(amount > 0, "ZERO_WITHDRAW");
function withdraw(uint256 amount) external nonReentrant {
    ... require(amount > 0, "ZERO_WITHDRAW");
    ... if (avaxAmount > 0 && depositAmount > 0) { // avaxAmount is never 0 ... }
    ...
```

### Recommendation

Remove avaxAmount > 0 from the if statement.

### Status

Currently being reviewed by the team.

---

Related findings:

- [`totalCdsDepositedAmountWithOptionFees` is incorrectly reduced in `CDSLib::withdrawUser()`, leading to stuck option fees](https://0xsimao.com/findings/autonomint-fees-reduced-withdraw-stuck): Autonomint
- [Missing Update to `omnichain.totalAvailableLiquidationAmount` in `withdrawUser`](https://0xsimao.com/findings/autonomint-omnichain-available-liquidation-withdraw): Autonomint
- [Halted withdrawals in BatchOut:withdrawFulfill() due to tokens transfer() reverting on 0 transfer amount](https://0xsimao.com/findings/clip-finance-i-halted-withdrawals-withdraw-transfer): Clip Finance Strategies
- [Users redeeming early will withdraw `Ra` without decreasing the amount locked, which will lead to stolen funds when withdrawing after expiry](https://0xsimao.com/findings/cork-protocol-redeeming-withdraw-locked-stolen): Cork Protocol
