Request form
Contracts
Protocols
Discord
Eigenlayer
Restaking
Staking
Liquid Staking
Protocol
Audited
Info
Docs
Source
ChefGPT

EigenLayer

EigenLayer (formerly 'EigenLayr') is a set of smart contracts deployed on Ethereum that enable restaking of assets to secure new services. At present, this repository contains both the contracts for EigenLayer and a set of general "middleware" contracts, designed to be reusable across different applications built on top of EigenLayer.

Note that the interactions between middleware and EigenLayer are not yet "set in stone", and may change somewhat prior to the platform being fully live on mainnet; in particular, payment architecture is likely to evolve. As such, the "middleware" contracts should not be treated as definitive, but merely as a helpful reference, at least until the architecture is more settled.

Click the links in the Table of Contents below to access more specific documentation. We recommend starting with the EigenLayer Technical Specification to get a better overview before diving into any of the other docs. For contracts addresses deployed on Goerli, click here.

Table of Contents

Design Docs

Flow Docs

Installation and Running Tests / Analyzers

Installation

foundryup

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). The output is located in docs/docgen

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 need 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.

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

EigenLayer is a protocol built on Ethereum that introduces restaking, a new primitive in cryptoeconomic security. This primitive enables the reuse of ETH on the consensus layer

test.sol
Base.sol
StdAssertions.sol
StdChains.sol
StdCheats.sol
StdError.sol
StdInvariant.sol
StdJson.sol
StdMath.sol
StdStorage.sol
StdStyle.sol
StdUtils.sol
Test.sol
Vm.sol
console.sol
console2.sol
IMulticall3.sol
OwnableUpgradeable.sol
Initializable.sol
ReentrancyGuardUpgradeable.sol
AddressUpgradeable.sol
ContextUpgradeable.sol
MathUpgradeable.sol
Ownable.sol
IERC1271.sol
draft-IERC1822.sol
ERC1967Upgrade.sol
Proxy.sol
BeaconProxy.sol
IBeacon.sol
IERC20.sol
draft-IERC20Permit.sol
SafeERC20.sol
Address.sol
Context.sol
Create2.sol
StorageSlot.sol
Strings.sol
ECDSA.sol
Math.sol
Staker.sol
DelegationManager.sol
DelegationManagerStorage.sol
Slasher.sol
StrategyManager.sol
StrategyManagerStorage.sol
IBLSPublicKeyCompendium.sol
IBLSRegistry.sol
IBeaconChainOracle.sol
IDelayedService.sol
IDelayedWithdrawalRouter.sol
IDelegationManager.sol
IETHPOSDeposit.sol
IEigenPod.sol
IEigenPodManager.sol
IPausable.sol
IPauserRegistry.sol
IPaymentManager.sol
IQuorumRegistry.sol
IRegistry.sol
IServiceManager.sol
ISlasher.sol
IStrategy.sol
IStrategyManager.sol
IVoteWeigher.sol
IWhitelister.sol
BN254.sol
BeaconChainProofs.sol
BytesArrayBitmaps.sol
BytesLib.sol
EIP1271SignatureUtils.sol
Endian.sol
Merkle.sol
MiddlewareUtils.sol
StructuredLinkedList.sol
BLSPublicKeyCompendium.sol
BLSRegistry.sol
BLSSignatureChecker.sol
PaymentManager.sol
RegistryBase.sol
VoteWeigherBase.sol
VoteWeigherBaseStorage.sol
ECDSARegistry.sol
HashThreshold.sol
Pausable.sol
PauserRegistry.sol
BeaconChainOracle.sol
DelayedWithdrawalRouter.sol
EigenPod.sol
EigenPodManager.sol
EigenPodPausingConstants.sol
StrategyBase.sol
StrategyBaseTVLLimits.sol
UpgradeableSignatureCheckingUtils.sol
New Discussion

TVL

$239.24M

14 downloads

Chains

Authors

Eigenlayer
Restaking
Staking
Liquid Staking
Protocol
Audited
Info
Source
ChefGPT
Expand
Share

EigenLayer

EigenLayer (formerly 'EigenLayr') is a set of smart contracts deployed on Ethereum that enable restaking of assets to secure new services. At present, this repository contains both the contracts for EigenLayer and a set of general "middleware" contracts, designed to be reusable across different applications built on top of EigenLayer.

Note that the interactions between middleware and EigenLayer are not yet "set in stone", and may change somewhat prior to the platform being fully live on mainnet; in particular, payment architecture is likely to evolve. As such, the "middleware" contracts should not be treated as definitive, but merely as a helpful reference, at least until the architecture is more settled.

Click the links in the Table of Contents below to access more specific documentation. We recommend starting with the EigenLayer Technical Specification to get a better overview before diving into any of the other docs. For contracts addresses deployed on Goerli, click here.

Table of Contents

Design Docs

Flow Docs

Installation and Running Tests / Analyzers

Installation

foundryup

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). The output is located in docs/docgen

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 need 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.

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

EigenLayer is a protocol built on Ethereum that introduces restaking, a new primitive in cryptoeconomic security. This primitive enables the reuse of ETH on the consensus layer
test.sol
Base.sol
StdAssertions.sol
StdChains.sol
StdCheats.sol
StdError.sol
StdInvariant.sol
StdJson.sol
StdMath.sol
StdStorage.sol
StdStyle.sol
StdUtils.sol
Test.sol
Vm.sol
console.sol
console2.sol
IMulticall3.sol
OwnableUpgradeable.sol
Initializable.sol
ReentrancyGuardUpgradeable.sol
AddressUpgradeable.sol
ContextUpgradeable.sol
MathUpgradeable.sol
Ownable.sol
IERC1271.sol
draft-IERC1822.sol
ERC1967Upgrade.sol
Proxy.sol
BeaconProxy.sol
IBeacon.sol
IERC20.sol
draft-IERC20Permit.sol
SafeERC20.sol
Address.sol
Context.sol
Create2.sol
StorageSlot.sol
Strings.sol
ECDSA.sol
Math.sol
Staker.sol
DelegationManager.sol
DelegationManagerStorage.sol
Slasher.sol
StrategyManager.sol
StrategyManagerStorage.sol
IBLSPublicKeyCompendium.sol
IBLSRegistry.sol
IBeaconChainOracle.sol
IDelayedService.sol
IDelayedWithdrawalRouter.sol
IDelegationManager.sol
IETHPOSDeposit.sol
IEigenPod.sol
IEigenPodManager.sol
IPausable.sol
IPauserRegistry.sol
IPaymentManager.sol
IQuorumRegistry.sol
IRegistry.sol
IServiceManager.sol
ISlasher.sol
IStrategy.sol
IStrategyManager.sol
IVoteWeigher.sol
IWhitelister.sol
BN254.sol
BeaconChainProofs.sol
BytesArrayBitmaps.sol
BytesLib.sol
EIP1271SignatureUtils.sol
Endian.sol
Merkle.sol
MiddlewareUtils.sol
StructuredLinkedList.sol
BLSPublicKeyCompendium.sol
BLSRegistry.sol
BLSSignatureChecker.sol
PaymentManager.sol
RegistryBase.sol
VoteWeigherBase.sol
VoteWeigherBaseStorage.sol
ECDSARegistry.sol
HashThreshold.sol
Pausable.sol
PauserRegistry.sol
BeaconChainOracle.sol
DelayedWithdrawalRouter.sol
EigenPod.sol
EigenPodManager.sol
EigenPodPausingConstants.sol
StrategyBase.sol
StrategyBaseTVLLimits.sol
UpgradeableSignatureCheckingUtils.sol

Get Cookin'

copy iconOpen in VSCode
copy iconDownload Source

TVL

$239.24M

14 downloads

Chains

Authors