1.0.4 • Published 7 months ago

eigenlayer-contracts v1.0.4

Weekly downloads
-
License
ISC
Repository
github
Last release
7 months ago

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
NameProxyImplementationNotes
DelegationManager0x39053D51B77DC0d36036Fc1fCc8Cb819df8Ef37A0x1784...9ddaProxy: TUP@4.7.1
StrategyManager0x858646372CC42E1A627fcE94aa7A7033e7CF075A0x70f4...619bProxy: TUP@4.7.1
EigenPodManager0x91E677b07F7AF907ec9a428aafA9fc14a0d3A3380x731A...3FEaProxy: TUP@4.7.1
AVSDirectory0x135dda560e946695d6f155dacafc6f1f25c1f5af0xdabd...a5b7Proxy: TUP@4.7.1
Slasher0xD92145c07f8Ed1D392c1B88017934E301CC1c3Cd0xf323...6614Proxy: TUP@4.7.1
RewardsCoordinator0x7750d328b314EfFa365A0402CcfD489B80B0adda0x5bf7...8785Proxy: 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:

NameProxyImplementationNotes
StrategyFactory0x5e4c39ad7a3e881585e383db9827eb4811f6f6470x3e07...5c74Proxy: TUP@4.7.1
StrategyBase0x0ed6703C298d28aE0878d1b28e88cA87F9662fE90xe9fa...7827- Beacon: BeaconProxy - Strategies: UpgradeableBeacon

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

NameProxyImplementationNotes
StrategyBase (cbETH)0x54945180dB7943c0ed0FEE7EdaB2Bd24620256bc0xdfdA...46d3Proxy: TUP@4.7.1
StrategyBase (stETH)0x93c4b944D05dfe6df7645A86cd2206016c51564D0xdfdA...46d3Proxy: TUP@4.7.1
StrategyBase (rETH)0x1BeE69b7dFFfA4E2d53C2a2Df135C388AD25dCD20xdfdA...46d3Proxy: TUP@4.7.1
StrategyBase (ETHx)0x9d7eD45EE2E8FC5482fa2428f15C971e6369011d0xdfdA...46d3Proxy: TUP@4.7.1
StrategyBase (ankrETH)0x13760F50a9d7377e4F20CB8CF9e4c26586c658ff0xdfdA...46d3Proxy: TUP@4.7.1
StrategyBase (OETH)0xa4C637e0F704745D182e4D38cAb7E7485321d0590xdfdA...46d3Proxy: TUP@4.7.1
StrategyBase (osETH)0x57ba429517c3473B6d34CA9aCd56c0e735b94c020xdfdA...46d3Proxy: TUP@4.7.1
StrategyBase (swETH)0x0Fe4F44beE93503346A3Ac9EE5A26b130a5796d60xdfdA...46d3Proxy: TUP@4.7.1
StrategyBase (wBETH)0x7CA911E83dabf90C90dD3De5411a10F1A61121840xdfdA...46d3Proxy: TUP@4.7.1
StrategyBase (sfrxETH)0x8CA7A5d6f3acd3A7A8bC468a8CD0FB14B6BD28b60xdfdA...46d3Proxy: TUP@4.7.1
StrategyBase (lsETH)0xAe60d8180437b5C34bB956822ac27109725844730xdfdA...46d3Proxy: TUP@4.7.1
StrategyBase (mETH)0x298aFB19A105D59E74658C4C334Ff360BadE6dd20xdfdA...46d3Proxy: TUP@4.7.1
Strategies - Special

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

NameProxyImplementationNotes
EigenStrategy (EIGEN)0xaCB55C530Acdb2849e6d4f36992Cd8c9D50ED8F70x27e7...0428Proxy: TUP@4.9.0
Beacon Chain ETH0xbeaC0eeEeeeeEEeEeEEEEeeEEeEeeeEeeEEBEaC0-- Used for Beacon Chain ETH shares - Not a real contract!
EigenPods
NameProxyImplementationNotes
EigenPod (beacon)0x5a2a4F2F3C18f09179B6703e63D9eDD1659090730x6D22...6430- Beacon: BeaconProxy - Pods: UpgradeableBeacon
DelayedWithdrawalRouter0x7Fe7E9CC0F274d2435AD5d56D5fa73E47F6A23D80x4bb6...4226Proxy: TUP@4.7.1
EIGEN/bEIGEN
NameProxyImplementationNotes
Eigen0xec53bf9167f50cdeb3ae105f56099aaab9061f830x17f5...26A0Proxy: TUP@4.9.0
Backing Eigen0x83E9115d334D248Ce39a6f36144aEaB5b3456e750xF2b2...9b17Proxy: TUP@4.9.0
SignedDistributor-0x035b...ad02-
Multisigs
NameProxyImplementationNotes
PauserRegistry-0x0c43...7060
Pauser Multisig0x5050389572f2d220ad927CcbeA0D4068310123900xd9db...9552Proxy: Gnosis@1.3.0
Community Multisig0xFEA47018D632A77bA579846c840d5706705Dc5980xd9db...9552Proxy: Gnosis@1.3.0
Executor Multisig0x369e6F597e22EaB55fFb173C6d9cD234BD6991110xd9db...9552Proxy: Gnosis@1.3.0
Operations Multisig0xBE1685C81aA44FF9FB319dD389addd9374383e900xd9db...9552Proxy: 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
NameProxyImplementationNotes
DelegationManager0xA44151489861Fe9e3055d95adC98FbD462B948e70x83f8...0D76Proxy: TUP@4.7.1
StrategyManager0xdfB5f6CE42aAA7830E94ECFCcAd411beF4d4D5b60x59f7...3a18Proxy: TUP@4.7.1
EigenPodManager0x30770d7E3e71112d7A6b7259542D1f680a70e3150x91A6...CCc5Proxy: TUP@4.7.1
AVSDirectory0x055733000064333CaDDbC92763c58BF0192fFeBf0xEF5B...3e3aProxy: TUP@4.7.1
Slasher0xcAe751b75833ef09627549868A04E32679386e7C0x9971...345AProxy: TUP@4.7.1
RewardsCoordinator0xAcc1fb458a1317E886dB376Fc8141540537E68fE0x1A17...752EProxy: 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:

NameProxyImplementationNotes
StrategyFactory0x9c01252B580efD11a05C00Aa42Dd3ac1Ec52DF6d0x5e69...51cbProxy: TUP@4.7.1
StrategyBase0xd3c6C6BA4E40dB9288c6a2077e5635344F8aFA4F0xb637...4A1e- Beacon: BeaconProxy - Strategies: UpgradeableBeacon

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

NameProxyImplementationNotes
StrategyBase (stETH)0x7D704507b76571a51d9caE8AdDAbBFd0ba0e63d30xFb83...3305Proxy: TUP@4.7.1
StrategyBase (rETH)0x3A8fBdf9e77DFc25d09741f51d3E181b25d0c4E00xFb83...3305Proxy: TUP@4.7.1
StrategyBase (WETH)0x80528D6e9A2BAbFc766965E0E26d5aB08D9CFaF90xFb83...3305Proxy: TUP@4.7.1
StrategyBase (lsETH)0x05037A81BD7B4C9E0F7B430f1F2A22c31a2FD9430xFb83...3305Proxy: TUP@4.7.1
StrategyBase (sfrxETH)0x9281ff96637710Cd9A5CAcce9c6FAD8C9F54631c0xFb83...3305Proxy: TUP@4.7.1
StrategyBase (ETHx)0x31B6F59e1627cEfC9fA174aD03859fC337666af70xFb83...3305Proxy: TUP@4.7.1
StrategyBase (osETH)0x46281E3B7fDcACdBa44CADf069a94a588Fd4C6Ef0xFb83...3305Proxy: TUP@4.7.1
StrategyBase (cbETH)0x70EB4D3c164a6B4A5f908D4FBb5a9cAfFb66bAB60xFb83...3305Proxy: TUP@4.7.1
StrategyBase (mETH)0xaccc5A86732BE85b5012e8614AF237801636F8e50xFb83...3305Proxy: TUP@4.7.1
StrategyBase (ankrETH)0x7673a47463F80c6a3553Db9E54c8cDcd5313d0ac0xFb83...3305Proxy: TUP@4.7.1
StrategyBase (reALT)0xAD76D205564f955A9c18103C4422D1Cd940168990xFb83...3305Proxy: TUP@4.7.1
StrategyBase (EO)0x78dBcbEF8fF94eC7F631c23d38d197744a3238680xFb83...3305Proxy: TUP@4.7.1
Strategies - Special

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

NameProxyImplementationNotes
EigenStrategy (EIGEN)0x43252609bff8a13dFe5e057097f2f45A24387a840x9465...2697Proxy: TUP@4.7.1
Beacon Chain ETH0xbeaC0eeEeeeeEEeEeEEEEeeEEeEeeeEeeEEBEaC0-- Used for Beacon Chain ETH shares - Not a real contract!
EigenPods
NameProxyImplementationNotes
EigenPod (beacon)0x7261C2bd75a7ACE1762f6d7FAe8F63215581832D0x10ad...319c- Beacon: BeaconProxy - Pods: UpgradeableBeacon
DelayedWithdrawalRouter0x642c646053eaf2254f088e9019ACD73d9AE0FA320xcE8b...3407Proxy: TUP@4.7.1
EIGEN/bEIGEN
NameProxyImplementationNotes
Eigen0x3B78576F7D6837500bA3De27A60c7f594934027E0x01cb...3050Proxy: TUP@4.7.1
Backing Eigen0x275cCf9Be51f4a6C94aBa6114cdf2a4c45B9cb270x05ad...E05cProxy: TUP@4.7.1
Multisigs
NameProxyImplementationNotes
PauserRegistry-0x85Ef...2F06
Compound: Timelock-0xcF19...0A7D
OZ: Proxy Admin-0xDB02...A6cf