Skip to content

Recon-Fuzz/eigenlayer-fuzzing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EigenLayer Fuzzing

Purpose

This repository acts as a base entrypoint to the EigenLayer system, allowing full end-to-end testing for protocols integrating with EigenLayer by providing an interface to EigenLayer via the EigenLayerSystem contract.

By deploying the entire EigenLayer system you can skip the need to create mocks of EigenLayer contracts and directly integrate into a suite using Echidna/Medusa/Foundry for fuzzing/unit testing.

See the accompanying blog post here for more information on how to use and design decisions.

To use

The deployEigenLayerLocal function in EigenLayerSystem deploys a local version of EigenLayer with two token strategies (stETH and wbETH) and makes it inheritable into your testing suite.

In a Foundry project add this repository as a submodule with:

forge install Recon-Fuzz/eigenlayer-fuzzing

Inherit the EigenLayerSystem contract into the Setup or test contract of the fuzzing/testing suite.

Ex (fuzzing suite):

contract RenzoSetup is EigenLayerSystem {}

Call the deployEigenLayerLocal function somewhere in your system setup. You will now have all EigenLayer contracts accessible as internal state variables which can be called to set values for your integrating system, but won't be targeted by Echidna/Medusa.

Working Example

See this Renzo-Fuzzing repo for a working example of how to integrate this repo into a fuzzing suite.

Externalities

The following economic externalities have been added to the EigenLayerSystem contract to facilitate testing these sorts of events in integrating protocols.