<!-- canonical: https://0xsimao.com/findings/singularity-commitments-nullifiers-footers-revert -->

# Setting note commitments, nullifiers and note footers used should revert if they are already set to prevent exploits

Low/Info · Three Sigma · Private DeFi access · 26th February, 2024

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

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

---

### Description

Setting note commitments, nullifiers and note footers should never happen after they are
already set, in which case the transaction should revert, as it is some clear attempt of an
exploit.

### Recommendation

Revert if they are already set.

### Status

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

---

Related findings:

- [`Claimers` can receive less `feePerClaim` than they should if some prizes are already claimed or if reverts because of a reverting hook](https://0xsimao.com/findings/pooltogether-the-prize-layer-for-defi-claimers-fee-reverts-hook): PoolTogether Prize Layer
- [Anyone will DoS setting a new rewards duration which harms the protocol/users as they will receive too much or too little rewards](https://0xsimao.com/findings/exactly-protocol-update-staking-contract-ii-rewards-duration-harms-little): Exactly Protocol Update - Staking Contract
- [KeyringCoreV2Base::blacklistEntity() and KeyringCoreV2Base::unblacklistEntity() could check that the addresses are not already set](https://0xsimao.com/findings/keyring-ii-blacklist-entity-unblacklist-addresses): Keyring Credentials
- [Allow lenders to set a minimum amount of asset they would take for their shares](https://0xsimao.com/findings/maple-finance-ii-lenders-minimum-they-shares): Maple Withdrawal Manager
