foundry-rs / foundry-rs/foundry

feat(fuzz): create initial seed corpus from `forge test` traces

Open
#10,875 1 comment 1 reaction 0 assignees View on GitHub
C-forge Cmd-forge-test T-feature
Dominant language
Rust
Stars
10.6k
Forks
2.6k
Avg merge
18h 20m
Merged PRs (30d)
510

Description

### Component

Forge

### Describe the feature you would like

Tests contain valuable info on the sequence of interactions expected by a contract as well as input data selected by hopefully informed devs, so it would probably improve coverage guided fuzzing to insert this info into the corpus dir for mutation as opposed to starting from random

```
test_MyContract() {
MyContract.A(1,2,3)
MyContract.B("foo")
MyContract.C()
}
```
[ target: , calldata: abi.encode(MyContract.A(1,2,3)), target: , calldata: abi.encode(MyContract.B("foo")) ....

Related: the reverse can be done for reproducers to generate failing tests for debugging

### Additional context

_No response_

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.