Skip to content

yieldnest/eigenlayer-contracts

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EigenLayer

EigenLayer is a set of smart contracts deployed on Ethereum that enable restaking of assets to secure new services. This repo contains the EigenLayer core contracts, whose currently-supported assets include beacon chain ETH and several liquid staking tokens (LSTs). Users use these contracts to deposit and withdraw these assets, as well as delegate them to operators providing services to AVSs.

Getting Started

Documentation

Basics

To get a basic understanding of EigenLayer, check out You Could've Invented EigenLayer. Note that some of the document's content describes features that do not exist yet (like the Slasher). To understand more about how restakers and operators interact with EigenLayer, check out these guides:

Deep Dive

The most up-to-date and technical documentation can be found in /docs. If you're a shadowy super coder, this is a great place to get an overview of the contracts before diving into the code.

To get an idea of how users interact with these contracts, check out our integration tests: /src/test/integration.

Building and Running Tests

This repository uses Foundry. See the Foundry docs for more info on installation and usage. If you already have foundry, you can build this project and run tests with these commands:

foundryup

forge build
forge test

Running Fork Tests

We have a few fork tests against ETH mainnet. Passing these requires the environment variable RPC_MAINNET to be set. See .env.example for an example. Once you've set up your environment, forge test should show these fork tests passing.

Additionally, to run all tests in a forked environment, install yq. Then, set up your environment using this script to read from config.yml:

source source-env.sh [goerli|local]

Then run the tests:

forge test --fork-url [RPC_URL]

Running Static Analysis

  1. Install solhint, then run:

solhint 'src/contracts/**/*.sol'

  1. Install slither, then run:

slither .

Generate Inheritance and Control-Flow Graphs

  1. Install surya and graphviz:
npm i -g surya

apt install graphviz
  1. Then, run:
surya inheritance ./src/contracts/**/*.sol | dot -Tpng > InheritanceGraph.png

surya mdreport surya_report.md ./src/contracts/**/*.sol

Deployments

Current Mainnet Deployment

The current mainnet deployment is our M1 release, and is from a much older version of this repo. You can view the deployed contract addresses in Current Mainnet Deployment below, or check out the init-mainnet-deployment branch in "Releases".

Name Solidity Proxy Implementation Notes
StrategyManager StrategyManager 0x8586...075A 0x5d25...42Fb Proxy: OpenZeppelin TUP@4.7.1
Strategy: cbETH StrategyBaseTVLLimits 0x5494...56bc 0xdfdA...46d3 Proxy: OpenZeppelin TUP@4.7.1
Strategy: stETH StrategyBaseTVLLimits 0x93c4...564D 0xdfdA...46d3 Proxy: OpenZeppelin TUP@4.7.1
Strategy: rETH StrategyBaseTVLLimits 0x1BeE...dCD2 0xdfdA...46d3 Proxy: OpenZeppelin TUP@4.7.1
EigenPodManager EigenPodManager 0x91E6...A338 0xEB86...e111 Proxy: OpenZeppelin TUP@4.7.1
EigenPod (beacon) EigenPod 0x5a2a...9073 0x5c86...9dA7 - Beacon: OpenZeppelin BeaconProxy@4.7.1
- Deployed pods use UpgradableBeacon@4.7.1
DelayedWithdrawalRouter DelayedWithdrawalRouter 0x7Fe7...23D8 0x44Bc...E2AF Proxy: OpenZeppelin TUP@4.7.1
DelegationManager DelegationManager 0x3905...f37A 0xf97E...75e4 Proxy: OpenZeppelin TUP@4.7.1
Slasher Slasher 0xD921...c3Cd 0xef31...d6d8 Proxy: OpenZeppelin TUP@4.7.1
PauserRegistry PauserRegistry - 0x0c43...7060
Pauser Multisig GnosisSafe@1.3.0 0x5050…2390 0xd9db...9552 Proxy: GnosisSafeProxy@1.3.0
Community Multisig GnosisSafe@1.3.0 0xFEA4...c598 0xd9db...9552 Proxy: GnosisSafeProxy@1.3.0
Executor Multisig GnosisSafe@1.3.0 0x369e...9111 0xd9db...9552 Proxy: GnosisSafeProxy@1.3.0
Operations Multisig GnosisSafe@1.3.0 0xBE16...3e90 0xd9db...9552 Proxy: GnosisSafeProxy@1.3.0
Timelock Compound: Timelock.sol - 0xA6Db...0EAF
Proxy Admin OpenZeppelin ProxyAdmin@4.7.1 - 0x8b95...2444

Current Testnet Deployment

The current testnet deployment is from our M2 beta release, which is a slightly older version of this repo. You can view the deployed contract addresses in Current Testnet Deployment, or check out the goerli-m2-deployment branch in "Releases".

Name Solidity Proxy Implementation Notes
StrategyManager StrategyManager 0x779d...E907 0x8676...0055 Proxy: OpenZeppelin TUP@4.7.1
Strategy: stETH StrategyBaseTVLLimits 0xB613...14da 0x81E9...8ebA Proxy: OpenZeppelin TUP@4.7.1
Strategy: rETH StrategyBaseTVLLimits 0x8799...70b5 0x81E9...8ebA Proxy: OpenZeppelin TUP@4.7.1
EigenPodManager EigenPodManager 0xa286...df41 0xdD09...901b Proxy: OpenZeppelin TUP@4.7.1
EigenLayerBeaconOracle succinctlabs/EigenLayerBeaconOracle.sol 0x40B1...9f2c 0x0a6e...db01 OpenZeppelin UUPS
EigenPod (beacon) EigenPod 0x3093...C9a5 0x86bf...6CcA - Beacon: OpenZeppelin BeaconProxy@4.7.1
- Deployed pods use UpgradableBeacon@4.7.1
DelayedWithdrawalRouter DelayedWithdrawalRouter 0x8958...388f 0x6070...27fe Proxy: OpenZeppelin TUP@4.7.1
DelegationManager DelegationManager 0x1b7b...b0a8 0x9b79...A99d Proxy: OpenZeppelin TUP@4.7.1
Slasher Slasher 0xD11d...0C22 0x3865...8Be6 Proxy: OpenZeppelin TUP@4.7.1
PauserRegistry PauserRegistry - 0x2588...0010
Timelock Compound: Timelock.sol - 0xa7e7...796e
Proxy Admin OpenZeppelin ProxyAdmin@4.7.1 - 0x28ce...02e2

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Solidity 93.9%
  • Ruby 4.6%
  • Other 1.5%