Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Basic repo for AVSs to test their integrations with eigenlayer and learn about our contract APIs

License

Notifications You must be signed in to change notification settings

Layr-Labs/eigenlayer-avs-playgrounds

Repository files navigation

OUTDATED: Please check out our incredible-squaring-avs repo for the most up-to-date avs demo with offchain code integration.

Eigenlayer AVS playgrounds

The purpose of this AVS playground is:

  • learn how, as an AVS developer, can get your AVS contracts to interact with the interfaces that are provided by EigenLayer,
  • learn how you can do e2e testing for your AVS contracts,
  • learn about registry contracts and understand how you can incorporate/use into your AVS contracts.

Before you delve further in AVS playground, it is essential that you are thinking deeply about the logic for your AVS contracts, namely, task submission and storage logic, slashing logic, registry contracts or you are implementing them. At either stage, you will find the AVS playground very useful.

Another important point about AVS playground is that operators are not running any off-chain node software. For AVS playground, we just deployed registry contracts.

Installation

git clone --recursive git@github.com:Layr-Labs/eigenlayer-avs-playgrounds.git

Make sure to clone with the --recursive flag to get the submodules (eigenlayer contracts and forge-test dependencies).

Dependencies

You will need to install foundry. Also make sure to run foundryup to be on the latest version.

Eigenlayer contracts

We have deployed a parallel set of contracts on goerli, with all functionality unpaused, for middleware teams to test with. The contract addresses can be found here. The easiest way to start integrating with these contracts is to fork goerli on a local anvil chain. You can install anvil using this guide:

anvil --fork-url https://goerli.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161

If the above URL is not working, choose another one from https://chainlist.org/?testnets=true&search=goerli.

Deploy the playgroundAVS contracts

In a separate terminal, run

export RPC_URL=http://localhost:8545
export PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
make deploy-avs

This deploys the playgroundAVS service manager contract (which you will need to modify to contain your own AVS' slashing logic) as well as a suite of registry contracts (which can most likely be used as-is for most AVSs).

Makefile starting point

At any point run make to get info on the different possible commands.

Operator and staker interactions

To register operators with EigenLayer, we use the following command:

make register-operators-with-eigenlayer

To register operators with dummy registry contracts, we use the following command:

make register-operators-with-avs

For the staker to delegate to the operator, we use the following command:

make staker-delegate-to-operators:

At any point, to know the status of your operators and stakers, run the STATUS_PRINTERS functions

make print-operators-status

and

make print-stakers-status

The playground also supports stakers to queue withdrawal request for eithdrawing from EigenLayer and then complete their withdrawals. For a lot more detail and explanation of each command in detail, look at the runbook.

Playbooks

After having deployed all contracts, you can interact with by running the different playbook scripts found in script/playbooks. These follow the structure outlined in the AVS-guide. Also have a look at the AVS Smart Contracts Template Architecture doc to understand the registry contracts and how they interact with the service manager and eigenlayer contracts.

About

Basic repo for AVSs to test their integrations with eigenlayer and learn about our contract APIs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •