/Echidna--Fuzzer

Echidna Fuzzer test to ABDK64.64 Library

Primary LanguageSolidity

Echidna-Fuzzer Ekran Resmi 2022-05-24 21 06 31

Fuzz tests for the ABDK Math 64.64 library using Echidna

This was my submission to the Secureum CAREX Echidna workshop. Find 2 issues and successful, accepted

Before starting

Install Echidna 2.0.1:

The contest

This repository contains everything necessary to test expected properties of the Math 64.64 library. Users should complete the Test creating functions to test different invariants from different mathematical operations (e.g. add, sub, etc) and adding assertions. The developer marked two functions as private instead of internal (sqrtu and divuu) which we are NOT going to directly test.

A few pointers to start:

  1. Read the documentation
  2. Think of basic arithmetic properties for every operation
  3. Consider when operation should or it should not revert
  4. Some properties could require to use certain tolerance

To start a Echidna fuzzing campaign use:

$ echidna-test Echidna-CAREX.sol --contract Test --test-mode assertion --corpus-dir corpus --seq-len 1 --test-limit 1000000 --config config.yaml --format text

The last argument, --test-limit should be tweaked according to the time you want to spend in the fuzzing campaign. Additionally, from time to time, you should remove the corpus using rm -Rf corpus.

The recommended Solidity version for the fuzzing campaign is 0.8.1, however, more recent releases can be used as well.

Documentation

Before starting, please review the Echidna README, as well as the official tutorials. Additionally, there is specific documentation on the libraries:

Math 64.64

Library of mathematical functions operating with signed 64.64-bit fixed point numbers.

[ documentation | source ]

Copyright

Copyright (c) 2019, ABDK Consulting

All rights reserved.