Skip to content

Commit

Permalink
update documentation for slither integration
Browse files Browse the repository at this point in the history
  • Loading branch information
anishnaik committed Jan 8, 2025
1 parent eb2b422 commit 7d77563
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion compilation/types/slither.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
type SlitherConfig struct {
// UseSlither determines whether to use slither. If CachePath is non-empty, then the cached results will be attempted
// to be used. Otherwise, slither will be run.
UseSlither bool `json:"runSlither"`
UseSlither bool `json:"useSlither"`
// CachePath determines the path where the slither cache file will be located
CachePath string `json:"cachePath"`
}
Expand Down
2 changes: 2 additions & 0 deletions docs/src/project_configuration/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ configuration is a `.json` file that is broken down into five core components.
- [Testing Configuration](./testing_config.md): The testing configuration dictates how and what `medusa` should fuzz test.
- [Chain Configuration](./chain_config.md): The chain configuration dictates how `medusa`'s underlying blockchain should be configured.
- [Compilation Configuration](./compilation_config.md): The compilation configuration dictates how to compile the fuzzing target.
- [Slither Configuration](./slither_config.md): The Slither configuration dictates whether Slither should be used in
`medusa` and whether the results from Slither should be cached.
- [Logging Configuration](./logging_config.md): The logging configuration dictates when and where to log events.

To generate a project configuration file, run [`medusa init`](../cli/init.md).
Expand Down
26 changes: 26 additions & 0 deletions docs/src/project_configuration/slither_config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Slither Configuration

The [Slither](https://github.com/crytic/slither) configuration defines the parameters for using Slither in `medusa`.
Currently, we use Slither to extract interesting constants from the target system. These constants are then used in the
fuzzing process to try to increase coverage.

- > 🚩 We _highly_ recommend using Slither and caching the results. Basically, don't change this configuration unless
> absolutely necessary. The constants identified by Slither are shown to greatly improve system coverage and caching
> the results will improve the speed of medusa.
### `useSlither`

- **Type**: Boolean
- **Description**: If `true`, Slither will be run on the target system and useful constants will be extracted for fuzzing.
If `cachePath` is a non-empty string (which it is by default), then `medusa` will first check the cache before running
Slither.
- **Default**: `true`

### `cachePath`

- **Type**: String
- **Description**: If `cachePath` is non-empty, Slither's results will be cached on disk. When `medusa` is re-run, these
cached results will be used. We do this for performance reasons since re-running Slither each time `medusa` is restarted
is computationally intensive for complex projects. We recommend disabling caching (by making `cachePath` an empty string)
if the target codebase changes. If the code remains constant during the fuzzing campaign, we recommend to use the cache.
- **Default**: `slither_results.json`

0 comments on commit 7d77563

Please sign in to comment.