<!-- canonical: https://0xsimao.com/findings/nftperp-ii-add-adding-greater-verbosity -->

# Add a 0 address check on the pool when adding liquidity for greater verbosity

Low/Info · Three Sigma · NFT perpetuals · 29th January, 2024

Finding 3S-NFTPerp-N07 of the Nftperp Matching Engine security review.

- Report: /reports/nftperp-ii
- Source: https://cdn.sanity.io/files/qoqld077/production/87f617e82d5468500e950a669f30607376b37c32.pdf

---

### Description

[AmmRouter:addLiquidity()](https://github.com/nftperp/NFTPerp-V2-Contracts/blob/8ea05fc0ecf299ca8374b571486846652c8725f8/src/AMMRouter.sol#L283) does not have an explicit check regarding the existence of the
pool with the given id, making it only revert when calling poolsAdded[i].addLiquidity()
due to internal EVM checks.

### Recomendation

Place an explicit check for this situation.

### Status

Addressed in [#51fb761](https://github.com/nftperp/NFTPerp-V2-Contracts/commit/51fb7619e5697de055d21e19614b71fe24db683c)

---

Related findings:

- [BRC20Factory::addSigner() and Vault::addSigner() must not allow adding the zero address as a signer](https://0xsimao.com/findings/orange-brc20-signer-adding-zero): Orange Bridge
- [Bad check in `Vesting.sol::_resetVestingPlans` will prevent users from adding additional liquidity in `SymmVesting.sol`](https://0xsimao.com/findings/symmio-staking-and-vesting-vesting-plans-additional-symm): Symmio, Staking and Vesting
- [Attackers can include other users nullifiers to make their funds stuck when adding liquidity to curve](https://0xsimao.com/findings/singularity-include-nullifiers-stuck-curve): Singularity
- [Consider adding a check to ensure that fees, delegate cover and so on have been explicitly set.](https://0xsimao.com/findings/maple-finance-iii-ensure-fees-delegate-explicitly): Maple Finance
