<!-- canonical: https://0xsimao.com/findings/mitosis-aggregate-hook-several-ambiguous -->

# In AggregateHook, several if (newAmount == 0) checks are ambiguous

Low/Info · Three Sigma · Cross-chain liquidity layer 1 · 25th June, 2024

Finding 3S-Mitosis-N19 of the Mitosis security review.

- Protocol: https://mitosis.org/
- Report: /reports/mitosis
- Source: https://cdn.sanity.io/files/qoqld077/production/b6b3bd7bb47407d99e76abb7c6dc615c1db5018e.pdf

---

### Description

In AggregateHook::reportRedeem(), AggregateHook::previewReportClaim() and
AggregateHook::reportClaim(), it sets newAmount to prevAmount if newAmount is null,
which is always, as it is initialized by default to null.

### Recommendation

Modify the code to make the intent more clear.

### Status

Addressed in [#b9b9ef0](https://github.com/mitosis-org/evm/pull/207/commits/b9b9ef0ebf2aa32370244f42e18b95be91ca834e).

---

Related findings:

- [Users always pay fee on the full swapped amount in the `DeliHook`, even if the swap is smaller](https://0xsimao.com/findings/bmx-fee-full-swapped-hook): BMX
