Skip to content

Conversation

@stevennevins
Copy link

Add CLI flag to slither-mutate that filters mutations to specific functions by their selector. Supports both hex selectors (0xa9059cbb) and full signatures (transfer(address,uint256)).

Features:

  • Parse comma-separated selectors with parenthesis-aware splitting
  • Include modifiers used by target functions
  • Abort with error if no functions match selector
  • Combine with --contract-names for precise targeting

…ector

Add CLI flag to slither-mutate that filters mutations to specific
functions by their selector. Supports both hex selectors (0xa9059cbb)
and full signatures (transfer(address,uint256)).

Features:
- Parse comma-separated selectors with parenthesis-aware splitting
- Include modifiers used by target functions
- Abort with error if no functions match selector
- Combine with --contract-names for precise targeting
@CLAassistant
Copy link

CLAassistant commented Dec 3, 2025

CLA assistant check
All committers have signed the CLA.

Add tests covering all code paths in AbstractMutator.should_mutate_function():
- No filter (target_selectors=None) returns True for all
- Matching selector returns True, non-matching returns False
- Modifier inclusion when used by target function

Also adds onlyOwner modifier and restrictedIncrement() to test fixture.
@stevennevins stevennevins force-pushed the feature/mutator-target-function branch from 4cc7dd3 to 29067fc Compare December 3, 2025 15:52
Document the new flag for filtering mutations by function selector.
@stevennevins stevennevins marked this pull request as ready for review December 3, 2025 16:01
@stevennevins
Copy link
Author

@bsamuels453 for viz

Copy link
Contributor

@bohendo bohendo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it, good work. Implementation is clean and I appreciate you providing an associated test suite.

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.

3 participants