Meta-tool to test a contract with various configs, using Echidna processes ("parade" is the proper name for a group of echidna)
Project description
This is an experimental script that uses configuration variance and a common corpus to try to throughly test a smart contract (or multiple contracts) with the Echidna smart-contract fuzzer (https://github.com/crytic/echidna).
It runs Echidna instances in parallel, and uses two basic ideas derived from my research:
swarm testing (https://agroce.github.io/issta12.pdf)
test length matters (https://agroce.github.io/ase08.pdf)
In particular, after an initial run to generate low-hanging-fruit easy pickings in terms of coverage, future runs will consist of a number of parallel runs (determined by an –ncores argument or however many cores Python thinks you have) where each run randomly omits some functions (if you have a list already, it’s respected and added to), and the sequence length and search strategy are also varied.
Usage is almost like Echidna; in fact if you just use the same arguments as to Echidna, it’ll probably work. E.g.,
` > echidna-parade contract.sol --config config.yaml --contract TEST `
will likely do something reasonable. By default “generations” of testing are 5 minutes in length, and the testing runs for an hour.
Try out the example in the ‘examples’ directory. Compare:
` > echidna-test justlen.sol --config config.yaml --contract TEST `
vs. what you can get with some knowledge of which functions not to omit from tests, and the same 120 seconds of testing with fast swarm generations:
` echidna-parade justlen.sol --config config.yaml --contract TEST --timeout 120 --gen_time 30 --ncores 8 --always "TEST.turn_on_length_checking()" "TEST.push_1()" "TEST.plus5()" "TEST.test_long_64()" "TEST.test_long_128()" `
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for echidna_parade-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e02e97e6291be35299e45b32b846b18f870780d6dc784d17f1a122d71c28c55 |
|
MD5 | 16e6d8bb7cd8ca1c063889aea5f6c8bb |
|
BLAKE2b-256 | d6838f3ac3034a1e55accdd76f438d25f762ebc94c7c249b3e5a2deadd5ccfb0 |
Hashes for echidna_parade-0.1.2-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6caebedca51520fdcf8d90d5395fa2fe5cf2fd49dcd9b699863aba3c7096df81 |
|
MD5 | 36cb03fc3d95b85054ac94eb4ab32ff0 |
|
BLAKE2b-256 | 508ddc17a80244c2bc8c91dbbd9a667b4e1afcef3064b16f3fdd72b454d8b151 |