<!-- canonical: https://0xsimao.com/findings/singularity-curve-schnorr-proof-griefed -->

# All curve params should be signed by the schnorr private key in the proof, or users may be griefed

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

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

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

---

### Description

An example of this issue is for example [here](https://github.com/portalgateme/darkpool-v1-zk-contracts-fork/blob/master/contracts/defi/curve/CurveRemoveLiquidityAssetManager.sol#L224-L227).
If the last bit of isLegacy is 0, it checks address(this).balance, otherwise it
IERC20(_WETH_ADDRESS).balanceOf(address(this)). This means that if for the same
pool, the wrong isLegacy is used, 0 outAmounts[i] will be recorded.

### Recommendation

Either send the curve params in the proof and sign them with the schnorr private key or set
a mapping from pool to the correct pool params.

### Status

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