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
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
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.
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 |
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.
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 |
Name | Proxy | Implementation | Notes |
---|---|---|---|
PauserRegistry |
- | 0x85Ef...2F06 |
|
Compound: Timelock |
- | 0xcF19...0A7D |
|
OZ: Proxy Admin |
- | 0xDB02...A6cf |