#2759·slither

[False-Positive]: incorrect-equality

Author: aviggianoCreated Aug 1, 2025Updated Jul 20, 2026
Labelsfalse-positive

Describe the false alarm that Slither raise and how you know it's inaccurate:

I find it very common that the incorrect-equality detector is not accurate for "magic numbers" such as 0, type(uint256).max, etc.

Having to add // slither-disable-next-line incorrect-equality to lines that simply compare against the null value does not make sense. I believe these values should be excluded from the detector.

Frequency

Very Frequently

Code example to reproduce the issue:

solidity
// slither-disable-next-line incorrect-equality
if (performanceFeePercentBefore == 0 && performanceFeePercent_ > 0 && highWaterMark == 0) {
  _setHighWaterMark(_pps());
}

Version:

0.11.3

Relevant log output:

bash