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.
The main branches we use are:
dev (default)
: The most up-to-date branch, containing the work-in-progress code for upcoming releasestestnet-holesky
: Our current testnet deploymentmainnet
: Our current mainnet deloyment
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:
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.
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
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
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]
- Install solhint, then run:
solhint 'src/contracts/**/*.sol'
- Install slither, then run:
slither .
- Install surya and graphviz:
npm i -g surya
apt install graphviz
- Then, run:
surya inheritance ./src/contracts/**/*.sol | dot -Tpng > InheritanceGraph.png
surya mdreport surya_report.md ./src/contracts/**/*.sol
make bindings
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.
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: [email protected] |
StrategyBase |
0x0ed6703C298d28aE0878d1b28e88cA87F9662fE9 |
0xe9fa...7827 |
- Beacon: BeaconProxy - Strategies: UpgradeableBeacon |
The following strategies were originally deployed and whitelisted outside of the StrategyFactory
:
The following strategies differ significantly from the other strategies deployed/used above:
Name | Proxy | Implementation | Notes |
---|---|---|---|
EigenStrategy (EIGEN) |
0xaCB55C530Acdb2849e6d4f36992Cd8c9D50ED8F7 |
0x27e7...0428 |
Proxy: [email protected] |
Beacon Chain ETH |
0xbeaC0eeEeeeeEEeEeEEEEeeEEeEeeeEeeEEBEaC0 |
- | - Used for Beacon Chain ETH shares - Not a real contract! |
Name | Proxy | Implementation | Notes |
---|---|---|---|
EigenPod (beacon) |
0x5a2a4F2F3C18f09179B6703e63D9eDD165909073 |
0x6D22...6430 |
- Beacon: BeaconProxy - Pods: UpgradeableBeacon |
DelayedWithdrawalRouter |
0x7Fe7E9CC0F274d2435AD5d56D5fa73E47F6A23D8 |
0x4bb6...4226 |
Proxy: [email protected] |
Name | Proxy | Implementation | Notes |
---|---|---|---|
Eigen |
0xec53bf9167f50cdeb3ae105f56099aaab9061f83 |
0x17f5...26A0 |
Proxy: [email protected] |
Backing Eigen |
0x83E9115d334D248Ce39a6f36144aEaB5b3456e75 |
0xF2b2...9b17 |
Proxy: [email protected] |
SignedDistributor |
- | 0x035b...ad02 |
- |
You can view the deployed contract addresses below, or check out the code itself on the testnet-holesky
branch.
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: [email protected] |
StrategyBase |
0xd3c6C6BA4E40dB9288c6a2077e5635344F8aFA4F |
0xb637...4A1e |
- Beacon: BeaconProxy - Strategies: UpgradeableBeacon |
The following strategies were originally deployed and whitelisted outside of the StrategyFactory
:
The following strategies differ significantly from the other strategies deployed/used above:
Name | Proxy | Implementation | Notes |
---|---|---|---|
EigenStrategy (EIGEN) |
0x43252609bff8a13dFe5e057097f2f45A24387a84 |
0x9465...2697 |
Proxy: [email protected] |
Beacon Chain ETH |
0xbeaC0eeEeeeeEEeEeEEEEeeEEeEeeeEeeEEBEaC0 |
- | - Used for Beacon Chain ETH shares - Not a real contract! |
Name | Proxy | Implementation | Notes |
---|---|---|---|
EigenPod (beacon) |
0x7261C2bd75a7ACE1762f6d7FAe8F63215581832D |
0x10ad...319c |
- Beacon: BeaconProxy - Pods: UpgradeableBeacon |
DelayedWithdrawalRouter |
0x642c646053eaf2254f088e9019ACD73d9AE0FA32 |
0xcE8b...3407 |
Proxy: [email protected] |
Name | Proxy | Implementation | Notes |
---|---|---|---|
Eigen |
0x3B78576F7D6837500bA3De27A60c7f594934027E |
0x01cb...3050 |
Proxy: [email protected] |
Backing Eigen |
0x275cCf9Be51f4a6C94aBa6114cdf2a4c45B9cb27 |
0x05ad...E05c |
Proxy: [email protected] |
Name | Proxy | Implementation | Notes |
---|---|---|---|
PauserRegistry |
- | 0x85Ef...2F06 |
|
Compound: Timelock |
- | 0xcF19...0A7D |
|
OZ: Proxy Admin |
- | 0xDB02...A6cf |