Skip to content

[codex] fix incorrect-modifier revert detection#3048

Draft
timeless-hayoka wants to merge 1 commit into
crytic:masterfrom
timeless-hayoka:codex/incorrect-modifier-revert-fix
Draft

[codex] fix incorrect-modifier revert detection#3048
timeless-hayoka wants to merge 1 commit into
crytic:masterfrom
timeless-hayoka:codex/incorrect-modifier-revert-fix

Conversation

@timeless-hayoka

Copy link
Copy Markdown

What changed

  • Fixed incorrect-modifier so it recognizes revert("...") modifiers by matching the real revert(string) signature.
  • Extended the revert detection to cover custom-error reverts, which Slither models as revert <custom error signature>.
  • Added a regression fixture for Solidity 0.8.4 covering both string reverts and custom-error reverts.

Why

incorrect-modifier was flagging modifiers that already revert on the false path, because the detector matched revert(string instead of the actual revert(string) signature. Custom-error reverts were also missed.

Validation

  • uv run pytest tests/e2e/detectors/test_detectors.py -k modifier_reverts --insta update
  • uv run pytest tests/e2e/detectors/test_detectors.py -k ModifierDefaultDetection

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Gemini seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

2 participants