Smart Contract Integration

Documentation for Smart Contract Integration in the EigenLayer-AVS system.

Purpose and Scope#

This page documents the smart contract architecture and integration within the EigenLayer-AVS system. It covers the system's interaction with EigenLayer contracts for AVS operations, the implementation of Account Abstraction (ERC-4337) for smart wallet management, and the contract mechanisms for operator registration and task management. For details on how operators interact with these contracts, see Operator.

Contract Architecture Overview#

The EigenLayer-AVS system integrates with blockchain networks through a multi-layered contract architecture deployed across multiple networks with consistent addresses. These contracts enable decentralized task execution, account abstraction, and EigenLayer restaking capabilities.

Title: EigenLayer-AVS Contract Architecture Overview

Sources:

Smart Contract Components#

The system relies on three main contract subsystems:

1. EigenLayer AVS Contracts#

These contracts enable integration with EigenLayer's restaking protocol:

ContractPurpose
AVS Service ManagerMain entry point for AVS operations
Registry CoordinatorCoordinates operator registration across multiple registries
BLS APK RegistryManages BLS public keys for operators
Index RegistryMaintains indices for efficient operator lookup
Stake RegistryTracks operator stake amounts and delegations
Operator State RetrieverUtility contract for querying operator state

Operators register with these contracts as part of the onboarding process, as shown in the registration code.

Sources:

2. Account Abstraction (ERC-4337) Contracts#

The system implements Account Abstraction through:

ContractPurposeAddress Example
AAConfigSystem configuration contract0x5327443cF04e6E8c3B86BDBbfaE16fcB965b7564
Wallet ImplementationCore smart wallet logic0x552D410C9c4231841413F6061baaCB5c8fBFB0DE
Factory ProxyDeployable proxy that creates new smart wallets0xB99BC2E399e06CddCF5E725c0ea341E8f0322834
Factory ImplementationActual implementation of wallet factory0x5692D03FC5922b806F382E4F1A620479A14c96c2
PaymasterHandles sponsored transactions0xB985af5f96EF2722DC99aEBA573520903B86505e

These contracts maintain consistent addresses across multiple networks including Base Sepolia, Sepolia, Base, Ethereum, Soneium, and Minato.

Sources:

3. Task Management Contracts#

These contracts manage the task execution pipeline:

ContractPurpose
Task ManagerTracks and manages task execution status
AP Config (AAConfig)Manages operator aliases and system configuration

The AP Config contract is particularly important for operator identity management, allowing operators to declare alias addresses.

Sources:

Network Deployment#

The EigenLayer-AVS contracts are deployed with consistent addresses across multiple networks:

NetworkTypeFunction
EthereumMainnetPrimary production environment
BaseMainnetLayer 2 production environment
SoneiumMainnetAdditional production environment
SepoliaTestnetTesting environment for Ethereum
Base SepoliaTestnetTesting environment for Base
MinatoTestnetTesting environment for Soneium

Sources:

Transaction Flow and Fee Management#

The system uses ERC-4337's account abstraction pattern for transaction management:

Title: ERC-4337 Transaction Flow

Sources:

Bundler System#

The system uses a bundler implementation called Voltaire that submits UserOperations to the EntryPoint contract:

NetworkBundler AddressType
Ethereum Mainnet0x6A99324303928aF456aA21f3C88dc58E812D9B40EOA
Base Sepolia0xE164dd09e720640F6695cB6cED0308065ceFECd9EOA

Sources:

Pre-funding Requirements#

Smart wallets require pre-funding with ETH to cover transaction fees:

NetworkRecommended Pre-fund (ETH)
Ethereum0.4
Sepolia0.4
Base0.001
Base Sepolia0.00005

Sources:

Operator Registration Process#

Operators must register with the EigenLayer AVS contracts to participate in the network:

Title: Operator Registration with EigenLayer AVS

The registration process involves:

  1. Generating a salt and expiry timestamp
  2. Providing BLS keypair information
  3. Specifying quorum numbers (typically [0])
  4. Supplying an optional socket string for network communication

Sources:

Alias Management#

Operators can declare alias addresses through the AP Config contract, allowing for operational security by separating staking keys from operational keys:

Title: Operator Alias Declaration Process

The alias management functionality includes:

  1. Creating or importing an ECDSA key pair
  2. Reading the key using a secure passphrase
  3. Declaring the alias address to the AP Config contract
  4. Optional undeclaring of an alias when no longer needed

Sources:

Integration Patterns#

The system integrates with these contracts through several common patterns:

Direct Contract Interaction#

Components directly call contract methods for operations like registration, alias declaration, and task management.

Title: Direct Contract Interaction Pattern

Sources:

Contract State Retrieval#

The system queries contract state to verify registration status and retrieve configuration:

Title: Contract State Retrieval Pattern

Sources:

Conclusion#

The smart contract integration in the EigenLayer-AVS system provides a foundation for decentralized task execution with account abstraction capabilities and EigenLayer security guarantees. The contracts are deployed consistently across multiple networks, enabling both production and testing environments. Operators interact with these contracts for registration and alias management, while the system handles transaction flow according to the ERC-4337 standard.

Sources:

Feature this wiki to auto refresh weekly

Try DeepWiki on your private codebase with Devin