[False-Positive]: incorrect-equality
- Dominant language
- Python
- Stars
- 6.4k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
### 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:
```shell
```
Contributor guide
Research direction
Start by locating Slither's incorrect-equality detector and reproduce the provided Solidity example. Trace how comparisons against 0 and type(uint256).max are classified, then verify that these intended null-value comparisons are no longer reported while other incorrect equality cases remain detectable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, solidity
- Domain
- devtools, security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100