Skip to content

Layr-Labs/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

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

Contributor Setup

To set up this repo for the first time, run:

make deps

This will:

  • Install the pre-commit hook
  • Install foundry and its tools
  • Install abigen

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

Generate Go bindings

make bindings

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 0x731A...3FEa Proxy: TUP@4.7.1
AVSDirectory 0x135dda560e946695d6f155dacafc6f1f25c1f5af 0xdabd...a5b7 Proxy: TUP@4.7.1
Slasher 0xD92145c07f8Ed1D392c1B88017934E301CC1c3Cd 0xf323...6614 Proxy: TUP@4.7.1
RewardsCoordinator 0x7750d328b314EfFa365A0402CcfD489B80B0adda 0x5bf7...8785 Proxy: TUP@4.7.1
Strategies

Anyone can deploy and whitelist strategies for standard ERC20s by using the StrategyFactory deployed to the address below (see docs). Strategies deployed from the StrategyFactory are deployed using the beacon proxy pattern:

Name Proxy Implementation Notes
StrategyFactory 0x5e4c39ad7a3e881585e383db9827eb4811f6f647 0x3e07...5c74 Proxy: TUP@4.7.1
StrategyBase 0x0ed6703C298d28aE0878d1b28e88cA87F9662fE9 0xe9fa...7827 - Beacon: BeaconProxy
- Strategies: UpgradeableBeacon

The following strategies were originally deployed and whitelisted outside of the StrategyFactory:

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
Strategies - Special

The following strategies differ significantly from the other strategies deployed/used above:

Name Proxy Implementation Notes
EigenStrategy (EIGEN) 0xaCB55C530Acdb2849e6d4f36992Cd8c9D50ED8F7 0x27e7...0428 Proxy: TUP@4.9.0
Beacon Chain ETH 0xbeaC0eeEeeeeEEeEeEEEEeeEEeEeeeEeeEEBEaC0 - - Used for Beacon Chain ETH shares
- Not a real contract!
EigenPods
Name Proxy Implementation Notes
EigenPod (beacon) 0x5a2a4F2F3C18f09179B6703e63D9eDD165909073 0x6D22...6430 - Beacon: BeaconProxy
- Pods: UpgradeableBeacon
DelayedWithdrawalRouter 0x7Fe7E9CC0F274d2435AD5d56D5fa73E47F6A23D8 0x4bb6...4226 Proxy: TUP@4.7.1
EIGEN/bEIGEN
Name Proxy Implementation Notes
Eigen 0xec53bf9167f50cdeb3ae105f56099aaab9061f83 0x17f5...26A0 Proxy: TUP@4.9.0
Backing Eigen 0x83E9115d334D248Ce39a6f36144aEaB5b3456e75 0xF2b2...9b17 Proxy: TUP@4.9.0
SignedDistributor - 0x035b...ad02 -
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

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 0x91A6...CCc5 Proxy: TUP@4.7.1
AVSDirectory 0x055733000064333CaDDbC92763c58BF0192fFeBf 0xEF5B...3e3a Proxy: TUP@4.7.1
Slasher 0xcAe751b75833ef09627549868A04E32679386e7C 0x9971...345A Proxy: TUP@4.7.1
RewardsCoordinator 0xAcc1fb458a1317E886dB376Fc8141540537E68fE 0x1A17...752E Proxy: TUP@4.7.1
Strategies

Anyone can deploy and whitelist strategies for standard ERC20s by using the StrategyFactory deployed to the address below (see docs). Strategies deployed from the StrategyFactory are deployed using the beacon proxy pattern:

Name Proxy Implementation Notes
StrategyFactory 0x9c01252B580efD11a05C00Aa42Dd3ac1Ec52DF6d 0x5e69...51cb Proxy: TUP@4.7.1
StrategyBase 0xd3c6C6BA4E40dB9288c6a2077e5635344F8aFA4F 0xb637...4A1e - Beacon: BeaconProxy
- Strategies: UpgradeableBeacon

The following strategies were originally deployed and whitelisted outside of the StrategyFactory:

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
StrategyBase (reALT) 0xAD76D205564f955A9c18103C4422D1Cd94016899 0xFb83...3305 Proxy: TUP@4.7.1
StrategyBase (EO) 0x78dBcbEF8fF94eC7F631c23d38d197744a323868 0xFb83...3305 Proxy: TUP@4.7.1
Strategies - Special

The following strategies differ significantly from the other strategies deployed/used above:

Name Proxy Implementation Notes
EigenStrategy (EIGEN) 0x43252609bff8a13dFe5e057097f2f45A24387a84 0x9465...2697 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 0x10ad...319c - Beacon: BeaconProxy
- Pods: UpgradeableBeacon
DelayedWithdrawalRouter 0x642c646053eaf2254f088e9019ACD73d9AE0FA32 0xcE8b...3407 Proxy: TUP@4.7.1
EIGEN/bEIGEN
Name Proxy Implementation Notes
Eigen 0x3B78576F7D6837500bA3De27A60c7f594934027E 0x01cb...3050 Proxy: TUP@4.7.1
Backing Eigen 0x275cCf9Be51f4a6C94aBa6114cdf2a4c45B9cb27 0x05ad...E05c Proxy: TUP@4.7.1
Multisigs
Name Proxy Implementation Notes
PauserRegistry - 0x85Ef...2F06
Compound: Timelock - 0xcF19...0A7D
OZ: Proxy Admin - 0xDB02...A6cf