crytic / crytic/slither

Enhancement: Add ACN Mutator (`assert(...)` Condition Negation)

Open
#2,999 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
6.4k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

## Why

We already have operator-level mutators (`ROR`, `LOR`, etc.), and `require(...)` condition negation is being tracked separately in #2998.

This issue tracks the `assert(...)` counterpart so the scopes stay small and reviewable.

Negating the full `assert` condition is useful for checking whether invariant-style assertions are meaningfully exercised by tests.

## What

Add mutator `ACN` that negates the first `assert` condition argument:

- `assert(x > 0 && x < 10)` -> `assert(!(x > 0 && x < 10))`
- `assert(msg.sender == owner)` -> `assert(!(msg.sender == owner))`

## Scope

This issue only covers `assert(...)` condition negation.

`require(...)` condition negation is covered in #2998

## Notes

This is intentionally split from #2998, so `require(...)` and `assert(...)` condition negation can be reviewed in separate PRs.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.