Skip to content

fix: suppress side-effect-free strict equality reports#3045

Open
ChargingFoxSec wants to merge 1 commit into
crytic:masterfrom
ChargingFoxSec:fix/incorrect-equality-callee-mutability-3041
Open

fix: suppress side-effect-free strict equality reports#3045
ChargingFoxSec wants to merge 1 commit into
crytic:masterfrom
ChargingFoxSec:fix/incorrect-equality-callee-mutability-3041

Conversation

@ChargingFoxSec

Copy link
Copy Markdown

Summary

Fixes #3041.

This suppresses incorrect-equality findings in side-effect-free view/pure functions, while preserving reports for view/pure helpers that are reachable from state-changing functions.

Root cause

IncorrectStrictEquality.tainted_equality_nodes currently skips top-level functions, but does not account for function mutability. As a result, strict equality checks in external/public view query functions can be reported even when they do not gate a state transition.

Changes

  • Skip view/pure functions when no non-view/pure caller can reach them.
  • Keep reporting internal view helpers when they are reachable from a state-changing function.
  • Add an e2e detector regression test and snapshot for the view/pure case.

Testing

  • uv run pytest tests/e2e/detectors/test_detectors.py -k IncorrectStrictEquality
  • uv run ruff check slither/detectors/statements/incorrect_strict_equality.py tests/e2e/detectors/test_detectors.py
  • uv run ruff format --check slither/detectors/statements/incorrect_strict_equality.py tests/e2e/detectors/test_detectors.py

@ChargingFoxSec ChargingFoxSec requested a review from smonicas as a code owner June 6, 2026 07:34
@CLAassistant

CLAassistant commented Jun 6, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@ChargingFoxSec ChargingFoxSec force-pushed the fix/incorrect-equality-callee-mutability-3041 branch from c75f296 to c002b11 Compare June 6, 2026 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

incorrect-equality: gate on callee mutability to suppress view/pure helper FPs

2 participants