Skip to content
Request an audit

‹ All findings

Index underflow is not protected against, although it has no impact as the pool with index type(uint256).max should not be registered

Low/InfoNftperp Matching Engine·Three Sigma · NFT perpetuals · 29th January, 20243S-NFTPerp-N04

Description

The following places do an unchecked increment/decrement, but the index could underflow and become type(uint256).max. This has no consequences with the code as is, but it's better to revert for underflows. https://github.com/nftperp/NFTPerp-V2-Contracts/blob/8ea05fc0ecf299ca8374b571486846652c8725f8/src/AMMRouter.sol#L667 https://github.com/nftperp/NFTPerp-V2-Contracts/blob/8ea05fc0ecf299ca8374b571486846652c8725f8/src/AMMRouter.sol#L1087-L1092 https://github.com/nftperp/NFTPerp-V2-Contracts/blob/8ea05fc0ecf299ca8374b571486846652c8725f8/src/ClearingHouseBase.sol#L477

Status

Acknowledged