Skip to content

Example code for testing using Echidna explained during the Spearbit presentation

License

Notifications You must be signed in to change notification settings

spearbit/echidna-spearbit-demo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fuzz tests explained during the Spearbit presentation

Before starting

Install Echidna 2.0.2:

If you do not have experience with Echidna, please start reviewing the Echidna README, as well as the official tutorials.

The demo

This repository contains everything necessary to test simple properties of SomeDeFi, a syntetic minimalistic DeFi protocol. Users should complete the TestSomeDefi contract creating functions to test different invariants from function (e.g. mintShares, withdrawShares, etc) using assertions.

A few pointers to start:

  1. Read the implementation code of SomeDeFi (it is very small).
  2. Think of basic properties for every operation
  3. Consider when an operation should or it should not revert
  4. Optimize the resulting properties, perhaps merging some of them.

To start a Echidna fuzzing campaign use:

$ echidna-test --test-mode assertion --contract TestSomeDefi --config SomeDeFi.yaml SomeDeFi.sol

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

About

Example code for testing using Echidna explained during the Spearbit presentation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Solidity 100.0%