Home

Awesome

<a name="introduction"/></a>

EigenLayer

<p align="center"><b><font size="+1"> šŸš§ The Slasher contract is under active development and its interface expected to change. We recommend writing slashing logic without integrating with the Slasher at this point in time. šŸš§ </font></b><p>

EigenLayer is a set of smart contracts deployed on Ethereum that enable restaking of assets to secure new services.

We recommend starting with the technical documentation to get an overview of the contracts before diving into the code.

For deployment addresses on both mainnet and Goerli, see Deployments below.

Table of Contents

<a name="installation"/></a>

Installation and Running Tests / Analyzers

Installation

foundryup

forge install

This repository uses Foundry as a smart contract development toolchain.

See the Foundry Docs for more info on installation and usage.

Natspec Documentation

You will notice that we also have hardhat installed in this repo. This is only used to generate natspec docgen. This is our workaround until foundry finishes implementing the forge doc command.

To generate the docs, run npx hardhat docgen (you may need to run npm install first).

Run Tests

Prior to running tests, you should set up your environment. At present this repository contains fork tests against ETH mainnet; your environment will use an RPC_MAINNET key to run these tests. See the .env.example file for an example -- two simple options are to copy the LlamaNodes RPC url to your env or use your own infura API key in the provided format. If you don't set the RPC_MAINNET key then the test cases will default to LlamaNodes RPC url when fork testing.

The main command to run tests is:

forge test -vv

Run Tests on a Fork

Environment config is contained in config.yml. Before running the following commands, install yq. Then set up the environment with this script:

source source-env.sh [CHAIN]

For example, on goerli: source source-env.sh goerli. Currently options for [CHAIN] are goerli, local. Then to run the actual tests:

forge test --fork-url [RPC_URL]

Run Static Analysis

solhint 'src/contracts/**/*.sol'

slither .

Generate Inheritance and Control-Flow Graphs

First install surya

then run

surya inheritance ./src/contracts/**/*.sol | dot -Tpng > InheritanceGraph.png

and/or

surya graph ./src/contracts/middleware/*.sol | dot -Tpng > MiddlewareControlFlowGraph.png

and/or

surya mdreport surya_report.md ./src/contracts/**/*.sol

Deployments

M1 (Current Mainnet Deployment)

NameSolidityProxyImplementationNotes
StrategyManagerStrategyManager0x8586...075A0x5d25...42FbProxy: OpenZeppelin TUP@4.7.1
Strategy: cbETHStrategyBaseTVLLimits0x5494...56bc0xdfdA...46d3Proxy: OpenZeppelin TUP@4.7.1
Strategy: stETHStrategyBaseTVLLimits0x93c4...564D0xdfdA...46d3Proxy: OpenZeppelin TUP@4.7.1
Strategy: rETHStrategyBaseTVLLimits0x1BeE...dCD20xdfdA...46d3Proxy: OpenZeppelin TUP@4.7.1
Strategy: ETHxStrategyBaseTVLLimits0x9d7e...011d0xdfdA...46d3Proxy: OpenZeppelin TUP@4.7.1
Strategy: ankrETHStrategyBaseTVLLimits0x1376...58ff0xdfdA...46d3Proxy: OpenZeppelin TUP@4.7.1
Strategy: OETHStrategyBaseTVLLimits0xa4C6...d0590xdfdA...46d3Proxy: OpenZeppelin TUP@4.7.1
Strategy: osETHStrategyBaseTVLLimits0x57ba...4c020xdfdA...46d3Proxy: OpenZeppelin TUP@4.7.1
Strategy: swETHStrategyBaseTVLLimits0x0Fe4...96d60xdfdA...46d3Proxy: OpenZeppelin TUP@4.7.1
Strategy: wBETHStrategyBaseTVLLimits0x7CA9...21840xdfdA...46d3Proxy: OpenZeppelin TUP@4.7.1
EigenPodManagerEigenPodManager0x91E6...A3380xEB86...e111Proxy: OpenZeppelin TUP@4.7.1
EigenPod (beacon)EigenPod0x5a2a...90730x5c86...9dA7- Beacon: OpenZeppelin BeaconProxy@4.7.1 <br />- Deployed pods use UpgradableBeacon@4.7.1
DelayedWithdrawalRouterDelayedWithdrawalRouter0x7Fe7...23D80x44Bc...E2AFProxy: OpenZeppelin TUP@4.7.1
DelegationManagerDelegationManager0x3905...f37A0xf97E...75e4Proxy: OpenZeppelin TUP@4.7.1
SlasherSlasher0xD921...c3Cd0xef31...d6d8Proxy: OpenZeppelin TUP@4.7.1
PauserRegistryPauserRegistry-0x0c43...7060
Pauser MultisigGnosisSafe@1.3.00x5050ā€¦23900xd9db...9552Proxy: GnosisSafeProxy@1.3.0
Community MultisigGnosisSafe@1.3.00xFEA4...c5980xd9db...9552Proxy: GnosisSafeProxy@1.3.0
Executor MultisigGnosisSafe@1.3.00x369e...91110xd9db...9552Proxy: GnosisSafeProxy@1.3.0
Operations MultisigGnosisSafe@1.3.00xBE16...3e900xd9db...9552Proxy: GnosisSafeProxy@1.3.0
TimelockCompound: Timelock.sol-0xA6Db...0EAF
Proxy AdminOpenZeppelin ProxyAdmin@4.7.1-0x8b95...2444

M1 (Current Goerli Testnet Deployment)

NameSolidityProxyImplementationNotes
StrategyManagerStrategyManager0x779...8E9070x8676...0055Proxy: OpenZeppelin TUP@4.7.1
Strategy: stETHStrategyBaseTVLLimits0xB6...d14da0x81E9...F8ebAProxy: OpenZeppelin TUP@4.7.1
Strategy: rETHStrategyBaseTVLLimits0x8799...70b50x81E9...F8ebAProxy: OpenZeppelin TUP@4.7.1
EigenPodManagerEigenPodManager0xa286b...df410xdD09...901bProxy: OpenZeppelin TUP@4.7.1
EigenPod (beacon)EigenPod0x3093...C9a50x86bf...6CcA- Beacon: OpenZeppelin BeaconProxy@4.7.1 <br />- Deployed pods use UpgradableBeacon@4.7.1
DelayedWithdrawalRouterDelayedWithdrawalRouter0x895...388f0x607...7feProxy: OpenZeppelin TUP@4.7.1
DelegationManagerDelegationManager0x1b7...Eb0a80x9b79...A99dProxy: OpenZeppelin TUP@4.7.1
SlasherSlasher0xD1...0C220x3865...8Be6Proxy: OpenZeppelin TUP@4.7.1
PauserRegistryPauserRegistry-0x81E9...F8ebA
TimelockCompound: Timelock.sol-0xa7e7...796e
Proxy AdminOpenZeppelin ProxyAdmin@4.7.1-0x28ce...02e2