feat: add SAOR mutator to swap same-typed function arguments#2975
Open
ep0chzer0 wants to merge 2 commits intocrytic:masterfrom
Open
feat: add SAOR mutator to swap same-typed function arguments#2975ep0chzer0 wants to merge 2 commits intocrytic:masterfrom
ep0chzer0 wants to merge 2 commits intocrytic:masterfrom
Conversation
Adds the Swap Arguments Order Replacement (SAOR) mutator that generates mutations by swapping function call arguments when they share the same type. This helps detect test suites that don't verify argument ordering. Closes crytic#2947 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The _mutate() method returns {'patches': {file: [...]}} not {file: [...]}.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
HighLevelCall,InternalCall, andLibraryCalloperations, then identifies parameter pairs with matching types and swaps the corresponding source-level argumentsCloses #2947
Test plan
test_saor_generates_patchesverifies patches are generated for same-typed argstest_get_mutatorscontinues to discover all registered mutatorsslither-mutatewith--mutators-to-run SAORon a contract with same-typed function parameters🤖 Generated with Claude Code