<!-- canonical: https://0xsimao.com/findings/nftperp-ii-duplicate-size-fill-static -->

# Duplicate size to fill check in _staticFillToAmm()

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

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

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

---

### Description

[_staticFillToAmm()](https://github.com/nftperp/NFTPerp-V2-Contracts/blob/8ea05fc0ecf299ca8374b571486846652c8725f8/src/ClearingHouseBase.sol#L493-L495) checks twice the size to fill.

### Recommendation

Remove the second check as it is never triggered.

### Status

Addressed in [#1c107ae](https://github.com/nftperp/NFTPerp-V2-Contracts/commit/1c107ae2d889510fe56b6565ee4c28b374af5bcc)

---

Related findings:

- [MapleLoan, proposeNewTerms() could have a check for duplicate selectors.](https://0xsimao.com/findings/maple-finance-iii-propose-terms-duplicate-selectors): Maple Finance
- [BRC20Factory constructor is missing a duplicate check](https://0xsimao.com/findings/orange-brc20-factory-constructor-duplicate): Orange Bridge
- [Signer duplicate check can be performed by requiring signers being sent ordered](https://0xsimao.com/findings/orange-signer-requiring-signers-ordered): Orange Bridge
- [Providing liquidity to the AMM does not check the return value of actually provided tokens leading to locked funds.](https://0xsimao.com/findings/cork-protocol-providing-actually-provided-locked): Cork Protocol
