/eigenlayer-contracts

Primary LanguageSolidityOtherNOASSERTION

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

Branching

The main branches we use are:

  • dev (default): The most up-to-date branch, containing the work-in-progress code for upcoming releases
  • testnet-holesky: Our current testnet deployment
  • mainnet: Our current mainnet deloyment

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 M2 release. You can view the deployed contract addresses below, or check out the code itself on the mainnet branch.

Core
Name Proxy Implementation Notes
DelegationManager 0x39053D51B77DC0d36036Fc1fCc8Cb819df8Ef37A 0x1784...9dda Proxy: TUP@4.7.1
StrategyManager 0x858646372CC42E1A627fcE94aa7A7033e7CF075A 0x70f4...619b Proxy: TUP@4.7.1
EigenPodManager 0x91E677b07F7AF907ec9a428aafA9fc14a0d3A338 0xe429...5762 Proxy: TUP@4.7.1
AVSDirectory 0x135dda560e946695d6f155dacafc6f1f25c1f5af 0xdabd...a5b7 Proxy: TUP@4.7.1
Slasher 0xD92145c07f8Ed1D392c1B88017934E301CC1c3Cd 0xf323...6614 Proxy: TUP@4.7.1
Strategies
Name Proxy Implementation Notes
StrategyBase (cbETH) 0x54945180dB7943c0ed0FEE7EdaB2Bd24620256bc 0xdfdA...46d3 Proxy: TUP@4.7.1
StrategyBase (stETH) 0x93c4b944D05dfe6df7645A86cd2206016c51564D 0xdfdA...46d3 Proxy: TUP@4.7.1
StrategyBase (rETH) 0x1BeE69b7dFFfA4E2d53C2a2Df135C388AD25dCD2 0xdfdA...46d3 Proxy: TUP@4.7.1
StrategyBase (ETHx) 0x9d7eD45EE2E8FC5482fa2428f15C971e6369011d 0xdfdA...46d3 Proxy: TUP@4.7.1
StrategyBase (ankrETH) 0x13760F50a9d7377e4F20CB8CF9e4c26586c658ff 0xdfdA...46d3 Proxy: TUP@4.7.1
StrategyBase (OETH) 0xa4C637e0F704745D182e4D38cAb7E7485321d059 0xdfdA...46d3 Proxy: TUP@4.7.1
StrategyBase (osETH) 0x57ba429517c3473B6d34CA9aCd56c0e735b94c02 0xdfdA...46d3 Proxy: TUP@4.7.1
StrategyBase (swETH) 0x0Fe4F44beE93503346A3Ac9EE5A26b130a5796d6 0xdfdA...46d3 Proxy: TUP@4.7.1
StrategyBase (wBETH) 0x7CA911E83dabf90C90dD3De5411a10F1A6112184 0xdfdA...46d3 Proxy: TUP@4.7.1
StrategyBase (sfrxETH) 0x8CA7A5d6f3acd3A7A8bC468a8CD0FB14B6BD28b6 0xdfdA...46d3 Proxy: TUP@4.7.1
StrategyBase (lsETH) 0xAe60d8180437b5C34bB956822ac2710972584473 0xdfdA...46d3 Proxy: TUP@4.7.1
StrategyBase (mETH) 0x298aFB19A105D59E74658C4C334Ff360BadE6dd2 0xdfdA...46d3 Proxy: TUP@4.7.1
Beacon Chain ETH 0xbeaC0eeEeeeeEEeEeEEEEeeEEeEeeeEeeEEBEaC0 - - Used for Beacon Chain ETH shares
- Not a real contract!
EigenPods
Name Proxy Implementation Notes
EigenPod (beacon) 0x5a2a4F2F3C18f09179B6703e63D9eDD165909073 0x8ba4...a255 - Beacon: BeaconProxy
- Pods: UpgradeableBeacon
DelayedWithdrawalRouter 0x7Fe7E9CC0F274d2435AD5d56D5fa73E47F6A23D8 0x4bb6...4226 Proxy: TUP@4.7.1
EigenLayerBeaconOracle - 0x3439...5442 Provided by Succinct
Multisigs
Name Proxy Implementation Notes
PauserRegistry - 0x0c43...7060
Pauser Multisig 0x5050389572f2d220ad927CcbeA0D406831012390 0xd9db...9552 Proxy: Gnosis@1.3.0
Community Multisig 0xFEA47018D632A77bA579846c840d5706705Dc598 0xd9db...9552 Proxy: Gnosis@1.3.0
Executor Multisig 0x369e6F597e22EaB55fFb173C6d9cD234BD699111 0xd9db...9552 Proxy: Gnosis@1.3.0
Operations Multisig 0xBE1685C81aA44FF9FB319dD389addd9374383e90 0xd9db...9552 Proxy: Gnosis@1.3.0
Compound: Timelock - 0xA6Db...0EAF
OZ: Proxy Admin - 0x8b95...2444

Current Testnet Deployment

The current testnet deployment is on holesky, and is from our M2 beta release. You can view the deployed contract addresses below, or check out the code itself on the testnet-holesky branch.

Core
Name Proxy Implementation Notes
DelegationManager 0xA44151489861Fe9e3055d95adC98FbD462B948e7 0x83f8...0D76 Proxy: TUP@4.7.1
StrategyManager 0xdfB5f6CE42aAA7830E94ECFCcAd411beF4d4D5b6 0x59f7...3a18 Proxy: TUP@4.7.1
EigenPodManager 0x30770d7E3e71112d7A6b7259542D1f680a70e315 0x5265...4a7B Proxy: TUP@4.7.1
AVSDirectory 0x055733000064333CaDDbC92763c58BF0192fFeBf 0xEF5B...3e3a Proxy: TUP@4.7.1
Slasher 0xcAe751b75833ef09627549868A04E32679386e7C 0x9971...345A Proxy: TUP@4.7.1
Strategies
Name Proxy Implementation Notes
StrategyBase (stETH) 0x7D704507b76571a51d9caE8AdDAbBFd0ba0e63d3 0xFb83...3305 Proxy: TUP@4.7.1
StrategyBase (rETH) 0x3A8fBdf9e77DFc25d09741f51d3E181b25d0c4E0 0xFb83...3305 Proxy: TUP@4.7.1
StrategyBase (WETH) 0x80528D6e9A2BAbFc766965E0E26d5aB08D9CFaF9 0xFb83...3305 Proxy: TUP@4.7.1
StrategyBase (lsETH) 0x05037A81BD7B4C9E0F7B430f1F2A22c31a2FD943 0xFb83...3305 Proxy: TUP@4.7.1
StrategyBase (sfrxETH) 0x9281ff96637710Cd9A5CAcce9c6FAD8C9F54631c 0xFb83...3305 Proxy: TUP@4.7.1
StrategyBase (ETHx) 0x31B6F59e1627cEfC9fA174aD03859fC337666af7 0xFb83...3305 Proxy: TUP@4.7.1
StrategyBase (osETH) 0x46281E3B7fDcACdBa44CADf069a94a588Fd4C6Ef 0xFb83...3305 Proxy: TUP@4.7.1
StrategyBase (cbETH) 0x70EB4D3c164a6B4A5f908D4FBb5a9cAfFb66bAB6 0xFb83...3305 Proxy: TUP@4.7.1
StrategyBase (mETH) 0xaccc5A86732BE85b5012e8614AF237801636F8e5 0xFb83...3305 Proxy: TUP@4.7.1
StrategyBase (ankrETH) 0x7673a47463F80c6a3553Db9E54c8cDcd5313d0ac 0xFb83...3305 Proxy: TUP@4.7.1
Beacon Chain ETH 0xbeaC0eeEeeeeEEeEeEEEEeeEEeEeeeEeeEEBEaC0 - - Used for Beacon Chain ETH shares
- Not a real contract!
EigenPods
Name Proxy Implementation Notes
EigenPod (beacon) 0x7261C2bd75a7ACE1762f6d7FAe8F63215581832D 0xe98f...641c - Beacon: BeaconProxy
- Pods: UpgradeableBeacon
DelayedWithdrawalRouter 0x642c646053eaf2254f088e9019ACD73d9AE0FA32 0xcE8b...3407 Proxy: TUP@4.7.1
EigenLayerBeaconOracle - 0x4C11...8f25 Provided by Succinct
Multisigs
Name Proxy Implementation Notes
PauserRegistry - 0x85Ef...2F06
Compound: Timelock - 0xcF19...0A7D
OZ: Proxy Admin - 0xDB02...A6cf