Skip to content

0xdanielvigo/Foundry-Fuzzing-Examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ERC4626 Fuzz Testing Repository

This repository contains a comprehensive suite of tests for the ERC4626 tokenized vault standard. The tests include both stateless and stateful fuzzing approaches to ensure the correctness and robustness of the implementation. The repository is built using Foundry, a blazing-fast Ethereum development framework.

Key Components

1. ERC4626Mock

The ERC4626Mock contract is a mock implementation of the ERC4626 tokenized vault standard. It overrides key functions such as deposit, mint, withdraw, and redeem to include additional checks and logic for testing purposes.

2. Testing Framework

The tests are written using Foundry's forge tool and leverage the forge-std library for cheat codes and utilities.

Stateless Tests

Stateless tests (e.g., StatelessCounter.t.sol) focus on individual function calls and their correctness in isolation.

Stateful Tests

Stateful tests simulate sequences of interactions with the contract to verify its behavior over time:

3. Continuous Integration

The repository includes a GitHub Actions workflow (.github/workflows/test.yml) to automatically run tests on every push or pull request.

How to Use

Prerequisites

  • Install Foundry:
    curl -L https://foundry.paradigm.xyz | bash
    foundryup
    
  • Install dependencies
    forge install
  • Run all tests
    make test 
  • Run Counter tests
     make test-counter
  • Run ERC4626Mock tests
     make test-erc4626

About

Examples of different fuzzing methods using Foundry.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors