<!-- canonical: https://0xsimao.com/findings/singularity-footers-curve-corresponding-outs -->

# Note footers should not be 0 in curveRemoveLiquidity() if the corresponding assetOuts are non null

Crit/High · Three Sigma · Private DeFi access · 26th February, 2024

Finding 3S-SG-H01 of the Singularity security review.

- Protocol: https://www.thesingularity.network/
- Report: /reports/singularity
- Source: https://cdn.sanity.io/files/qoqld077/production/45b8aac56a2b8e3b557df4329ac9bf8220b64012.pdf

---

### Description

In curveRemoveLiquidity(), the note footer should not be allowed to be 0 if assetOut is
non null, as this could lead to duplicate note footers.

### Recommendation

Revert if the note footer is 0 but the corresponding asset out is not.

### Status

Addressed in [#8b300f0](https://github.com/portalgateme/darkpool-v1-zk-contracts-fork/commit/8b300f07a28f2c073154c8de3e9e90ba64ef1934).

---

Related findings:

- [removeLiquidity() in the amm calculates marginToRemove without updating the margin with the funding payment](https://0xsimao.com/findings/nftperp-i-calculates-margin-updating-payment): Nftperp Exchange
- [`SyrupBitcoinRouter::requestRedeem()` could also check if the asset picked to redeem has liquidity](https://0xsimao.com/findings/maple-finance-iii-syrup-bitcoin-redeem-picked): Maple Withdrawal Queue
