Skip to content

[False-Positive]: incorrect-equality #2759

@aviggiano

Description

@aviggiano

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:

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

Version:

0.11.3

Relevant log output:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions