This fuzzer was made to learn empirically the gas expenses of your contracts. It is highly configurable through a rules.json
file, and doesn't require you to modify your source code to obtain useful information about its execution.
Testing was done in a clean virtual environment, so I recommend doing so to run this fuzzer.
You must have a working python3 installation, and pip installed.
Inside your virtual environment, run:
pip install -U -r requirements.txt
You can execute the fuzzer like so:
python3 gas_fuzz [OPTIONS] files [files...]
The default behaviour is to run 10 transactions each block, commiting 10 blocks in total, and record the behaviour of the gas costs of each function call.
All options and their arguments can be described by executing
python3 gas_fuzz --help
The options you'll probably use the most are:
n [number]
: Optional. Defines the number of blocks to mine during the fuzzing.tx [number]
: Optional. Defines the number of transactions to include per block.r [file]
: Optional. Specifies the rule file to use for fuzzing.
You can define how the fuzzer should generate its arguments by using a JSON file. A prototype of the expected JSON files can be found in prototype.json
Distributed under the MIT License. See LICENSE
for more information.
Daniel Soto - @dannoo_s - danielsoto.3004@gmail.com
Project Link: https://github.com/danno-s/gas-fuzzer