crytic / medusa

Parallelized, coverage-guided, mutational Solidity smart contract fuzzing, powered by go-ethereum
https://www.trailofbits.com/
GNU Affero General Public License v3.0
273 stars 33 forks source link

Use defaults when partial config is provided instead of requiring all options to be specified explicitly #361

Closed ggrieco-tob closed 12 hours ago

ggrieco-tob commented 1 month ago

The removal of the "compilation" section from the medusa config, for instance, the following file:

{
        "fuzzing": {
                "corpusDirectory": "tests/medusa-corpus",
                "deployerAddress": "0x10000",
                "senderAddresses": [
                        "0x10000",
                        "0x20000",
                        "0x30000"
                ],
                "assertionTesting": {
                        "enabled": true
                },
                "propertyTesting": {
                        "enabled": false
                },
                "optimizationTesting": {
                         "enabled": false
                }
        }
}

results in failing to compile any project:

⇾ Reading the configuration file at: min.json
warn Currently, optimization mode's call sequence shrinking is inefficient; this may lead to minor performance issues
⇾ Initializing corpus
⇾ Setting up base chain
error Failed to initialize the test chain
‣ CryticERC20InternalHarness was specified in the target contracts but was not found in the compilation artifacts

The reason for this issue is to have the minimal amount of lines required for showing the use which values they really need, beside the complete default values. This is blocking the merge of https://github.com/crytic/properties/pull/36