Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: filter functions #275

Closed
wants to merge 9 commits into from
Closed

Conversation

damilolaedwards
Copy link
Contributor

@damilolaedwards damilolaedwards commented Jan 7, 2024

This PR (closes issue #248 ) adds FilterFunctions and FilterBlacklist options to the fuzzer's configuration. When FilterBlacklist is set to true, specified functions in FilterFunctions array are excluded from fuzzing; when false, only these functions are included. The FilterFunctions array should consist of contract names and function signatures for blacklisting/whitelisting. Additional validation logic added to ensure the array is not empty when whitelisting is enabled.

@@ -128,6 +129,12 @@ type TestingConfig struct {
// even if this option is not enabled.
TraceAll bool `json:"traceAll"`

// FilterWhitelist describes an array of function signatures that are to be called during a fuzzing campaign (if FilterBlacklist is set to false).
FilterWhitelist []string `json:"filterFunctions"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
FilterWhitelist []string `json:"filterFunctions"`
FilterWhitelist []string `json:"filterWhitelist"`

@0xalpharush
Copy link
Contributor

Right now, it's essentially like we have a default arg of filterWhitelist: "all" and filterBlackList: "none". Maybe it would make sense to allow blacklisting "all" so that it doesn't require listing all sig's out. We should also probably warn or even error if a sig is in both lists

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.

4 participants