eigensdk.chainio

ELReader

The ELReader class provides read-only access to EigenLayer contracts, offering comprehensive functionality for querying operator information, allocation management, delegation status, rewards, and permissions.

class eigensdk.chainio.clients.elcontracts.reader.ELReader(allocation_manager, avs_directory, delegation_manager, permission_controller, reward_coordinator, strategy_manager, logger, eth_http_client, strategy_abi, erc20_abi)

Bases: object

Parameters:
  • allocation_manager (Contract)

  • avs_directory (Contract)

  • delegation_manager (Contract)

  • permission_controller (Contract)

  • reward_coordinator (Contract)

  • strategy_manager (Contract)

  • logger (Logger)

  • eth_http_client (Web3)

  • strategy_abi (list[dict[str, Any]])

  • erc20_abi (list[dict[str, Any]])

calculate_delegation_approval_digest_hash(staker, operator, delegation_approver, approver_salt, expiry)

Returns the digest hash to be signed by the operator’s delegation approver to be used when delegating to an operator.

Return type:

bytes

Parameters:
  • staker (Address | str | None)

  • operator (Address | str | None)

  • delegation_approver (Address | str | None)

  • approver_salt (bytes)

  • expiry (int)

calculate_operator_avs_registration_digest_hash(operator, avs, salt, expiry)

Returns the digest hash to be signed by an operator to register with an AVS.

Return type:

bytes

Parameters:
  • operator (Address | str | None)

  • avs (Address | str | None)

  • salt (bytes)

  • expiry (int)

can_call(account_address, appointee_address, target, selector)

Returns true if appointeeAddress has permission to call the function with the given selector on the target contract, on behalf of accountAddress, and false otherwise.

Return type:

bool

Parameters:
  • account_address (Address | str | None)

  • appointee_address (Address | str | None)

  • target (Address | str | None)

  • selector (bytes)

check_claim(claim)

Returns true if the claim would currently pass the check in ChainWriter.ProcessClaims or return an error if invalid.

Return type:

bool

Parameters:

claim (dict[str, Any])

curr_rewards_calculation_end_timestamp()

Returns the timestamp until which rewards submissions have been calculated.

Return type:

int

get_activation_delay()

Get delay in timestamp (seconds) before a posted root can be claimed against.

Return type:

int

get_allocatable_magnitude(operator_addr, strategy_addr)

Returns the amount of magnitude on a strategy not currently allocated to any operator set, by an operator.

Return type:

int

Parameters:
  • operator_addr (Address | ChecksumAddress | str | None)

  • strategy_addr (Address | ChecksumAddress | str | None)

get_allocated_stake(operator_set, operator_addresses, strategy_addresses)

Returns the current allocated stake, despite the operator’s slashable status for the operatorSet.

Note: this method does not take into account M2 quorums.

Return type:

list[list[int]]

Parameters:
  • operator_set (dict[str, Any])

  • operator_addresses (list[Address | ChecksumAddress])

  • strategy_addresses (list[Address | ChecksumAddress])

get_allocation_configuration_delay()

Returns the delay before allocation delay modifications take effect.

Return type:

int

get_allocation_delay(operator_addr)

Returns the time in blocks between an operator allocating slashable magnitude and the magnitude becoming slashable.

Return type:

int

Parameters:

operator_addr (Address | str | None)

get_allocation_info(operator_addr, strategy_addr)

Returns the allocation info of a given operator and strategy.

Return type:

list[dict[str, Any]]

Parameters:
  • operator_addr (Address | ChecksumAddress | str | None)

  • strategy_addr (Address | ChecksumAddress | str | None)

get_avs_registrar(avs_address)

Returns the AVSRegistrar of the avs received as parameter.

Return type:

NewType(Address, bytes)

Parameters:

avs_address (Address | str | None)

get_calculation_interval_seconds()

Gets the interval in seconds at which the calculation for rewards distribution is done.

Return type:

int

get_claimer_for(earner)

Returns the claimer for the given earner.

Return type:

NewType(Address, bytes)

Parameters:

earner (Address | str | None)

get_cumulative_claimed(earner, token)

Returns the number of token tokens the earner has claimed.

Return type:

int

Parameters:
  • earner (Address | str | None)

  • token (Address | str | None)

get_cumulative_withdrawals_queued(staker)

Returns the total number of withdrawals that have been queued for a given staker.

Return type:

int

Parameters:

staker (Address | str | None)

get_curr_rewards_calculation_end_timestamp()

Get timestamp for last submitted DistributionRoot.

Return type:

int

get_current_claimable_distribution_root()

Returns the latest root that can be claimed against.

Return type:

dict[str, Any]

get_deallocation_delay()

Returns the delay within which deallocations are slashable.

Return type:

int

get_default_operator_split_bips()

Get the default split for all operators across all avss in bips.

Return type:

int

get_delegated_operator(staker_address, block_number=None)

Returns the operator that a staker has delegated to.

Return type:

NewType(Address, bytes)

Parameters:
  • staker_address (Address | str | None)

  • block_number (int | None)

get_delegation_approver_salt_is_spent(delegation_approver, approver_salt)

Returns whether delegationApprover has already used the given salt.

Return type:

bool

Parameters:
  • delegation_approver (Address | str | None)

  • approver_salt (bytes)

get_distribution_roots_length()

Returns the number of distribution roots published.

Return type:

int

get_encumbered_magnitude(operator_address, strategy_address)

Returns the amount of magnitude an operator has allocated to operator sets for a given strategy.

Return type:

int

Parameters:
  • operator_address (Address | str | None)

  • strategy_address (Address | str | None)

get_genesis_rewards_timestamp()

Get absolute min timestamp (seconds) that a rewards submission can start at.

Return type:

int

get_is_avs_rewards_submission_hash(avs, hash)

Returns whether a hash is a valid rewards submission hash for a given avs.

Return type:

bool

Parameters:
  • avs (Address | str | None)

  • hash (bytes)

get_is_operator_directed_avs_rewards_submission_hash(avs, hash)

Returns whether a hash is a valid operator set performance rewards submission hash for a given avs.

Return type:

bool

Parameters:
  • avs (Address | str | None)

  • hash (bytes)

get_is_operator_directed_operator_set_rewards_submission_hash(avs, hash)

Returns whether a hash is a valid operator set performance rewards submission hash for a given avs.

Return type:

bool

Parameters:
  • avs (Address | str | None)

  • hash (bytes)

get_is_rewards_for_all_submitter(submitter)

Returns whether a submitter is a valid rewards for all submitter.

Return type:

bool

Parameters:

submitter (Address | str | None)

get_is_rewards_submission_for_all_earners_hash(avs, hash)

Returns whether a hash is a valid rewards submission for all earners hash for a given avs.

Return type:

bool

Parameters:
  • avs (Address | str | None)

  • hash (bytes)

get_is_rewards_submission_for_all_hash(avs, hash)

Returns whether a hash is a valid rewards submission for all hash for a given avs.

Return type:

bool

Parameters:
  • avs (Address | str | None)

  • hash (bytes)

get_max_future_length()

Get the max amount of time (seconds) that a rewards submission can start in the future.

Return type:

int

get_max_magnitudes(operator_addr, strategy_addrs)

Returns the maximum magnitude an operator can allocate for the given strategies.

Return type:

list[int]

Parameters:
  • operator_addr (Address | ChecksumAddress | str | None)

  • strategy_addrs (list[Address] | list[ChecksumAddress] | list[str])

get_max_retroactive_length()

Get the max amount of time (seconds) that a rewards submission can start in the past.

Return type:

int

get_max_rewards_duration()

Gets the maximum amount of time (seconds) that a rewards submission can span over.

Return type:

int

get_num_operator_sets_for_operator(operator_address)

Returns the number of operator sets that an operator is part of.

This doesn’t include M2 quorums.

Return type:

int

Parameters:

operator_address (Address | str | None)

get_num_operators_for_operator_set(operator_set)

Returns the number of operators in a specific operator set.

Not supported for M2 AVSs.

Return type:

int

Parameters:

operator_set (dict)

get_operator_avs_split(operator, avs)

Returns the split configured by the operator for the avs.

Return type:

int

Parameters:
  • operator (Address | str | None)

  • avs (Address | str | None)

get_operator_details(operator)

Returns detailed information on an operator.

Return type:

dict[str, Any]

Parameters:

operator (dict[str, Any])

get_operator_pi_split(operator)

Returns the split configured by the operator for Programmatic Incentives.

Return type:

int

Parameters:

operator (Address | str | None)

get_operator_set_split(operator, operator_set)

Returns the split for an operator in an operator set.

Return type:

int

Parameters:
  • operator (Address | str | None)

  • operator_set (dict)

get_operator_sets_for_operator(operator_addr)

Returns the list of operator sets the operator has current or pending allocations/deallocations in.

This doesn’t include M2 quorums.

Return type:

list[dict[str, Any]]

Parameters:

operator_addr (Address | str | None)

get_operator_shares(operator_address, strategy_addresses)

Returns the shares an operator has delegated to them on a strategy.

Return type:

list[int]

Parameters:
  • operator_address (Address | ChecksumAddress | str | None)

  • strategy_addresses (list[Address] | list[ChecksumAddress])

get_operator_shares_in_strategy(operator_addr, strategy_addr)

Returns the shares an operator has in a given strategy.

Return type:

int

Parameters:
  • operator_addr (Address | str | None)

  • strategy_addr (Address | str | None)

get_operators_for_operator_set(operator_set)

Returns the list of operators in a specific operator set.

Not supported for M2 AVSs.

Return type:

list

Parameters:

operator_set (dict)

get_operators_shares(operator_addresses, strategy_addresses)

Returns the shares that a set of operators have delegated to them in a set of strategies.

Return type:

list[list[int]]

Parameters:
  • operator_addresses (list[Address | ChecksumAddress])

  • strategy_addresses (list[Address | ChecksumAddress])

get_pending_withdrawal_status(withdrawal_root)

Returns whether a withdrawal is pending for a given withdrawalRoot.

Return type:

bool

Parameters:

withdrawal_root (bytes)

get_registered_sets(operator_addr)

Returns a list of all operator sets the operator is registered for.

Return type:

list[dict[str, Any]]

Parameters:

operator_addr (Address | str | None)

get_rewards_updater()

Get the address of the entity that can update the contract with new merkle roots.

Return type:

Union[NewType(Address, bytes), str, None]

get_root_index_from_hash(root_hash)

Returns the index of the latest root that can be claimed against.

Return type:

int

Parameters:

root_hash (bytes)

get_slashable_shares(operator_address, operator_set, strategies)

Returns a list of the number of shares slashable by the operator set for each of the given strategies.

Return type:

dict[str, int] | None

Parameters:
  • operator_address (Address | ChecksumAddress | str | None)

  • operator_set (dict[str, Any])

  • strategies (list[Address | ChecksumAddress])

get_slashable_shares_for_operator_sets(operator_sets)

Returns the strategies the operatorSets take into account, their operators, and the minimum amount of shares that are slashable by the operatorSets.

Not supported for M2 AVSs.

Return type:

list[dict[str, Any]] | None

Parameters:

operator_sets (list[dict[str, Any]])

get_slashable_shares_for_operator_sets_before(operator_sets, future_block)

Returns the strategies the operatorSets take into account, their operators, and the minimum amount of shares slashable by the operatorSets before a given timestamp.

Timestamp must be in the future. Used to estimate future slashable stake. Not supported for M2 AVSs.

Return type:

list[dict[str, Any]] | None

Parameters:
  • operator_sets (list[dict[str, Any]])

  • future_block (int)

get_staker_shares(staker_address)

Returns the amount of shares that a staker has in all of the strategies they have shares in.

Return type:

tuple[list[NewType(Address, bytes)], list[int]]

Parameters:

staker_address (Address | str | None)

get_strategies_for_operator_set(operator_set)

Returns the list of strategies that an operator set takes into account.

Not supported for M2 AVSs.

Return type:

list[NewType(Address, bytes)]

Parameters:

operator_set (dict)

get_strategy_and_underlying_erc20_token(strategy_addr)

Returns the bindings of a given strategy and the bindings and address of its underlying token.

Return type:

tuple[Contract, Contract, str | None]

Parameters:

strategy_addr (Address | ChecksumAddress)

get_strategy_and_underlying_token(strategy_addr)

Returns the bindings of a given strategy and the address of its underlying token.

Return type:

tuple[Contract, str | None]

Parameters:

strategy_addr (Address | ChecksumAddress)

get_submission_nonce(avs)

Returns the submission nonce for an avs.

Return type:

int

Parameters:

avs (Address | str | None)

is_admin(account_address, admin_address)

Returns true if adminAddress is an admin of accountAddress.

Return type:

bool

Parameters:
  • account_address (Address | str | None)

  • admin_address (Address | str | None)

is_operator_registered(operator_address)

Returns true if the operator is registered to the EigenLayer protocol, false otherwise.

Return type:

bool

Parameters:

operator_address (Address | str | None)

is_operator_registered_with_avs(operator_address, avs_address)

Returns true if an operator is registered with a specific M2 quorum, querying AVSDirectory.

Note: this method does not take into account operator sets.

Return type:

bool

Parameters:
  • operator_address (Address | str | None)

  • avs_address (Address | str | None)

is_operator_registered_with_operator_set(operator_addr, operator_set)

Returns true if an operator is registered with a specific operator set.

Note: this method does not take into account M2 quorums.

Return type:

bool

Parameters:
  • operator_addr (Address | str | None)

  • operator_set (dict)

is_operator_slashable(operator_address, operator_set)

Returns true if the received operator is slashable by the received operator set.

Note: this method does not take into account M2 quorums.

Return type:

bool

Parameters:
  • operator_address (Address | str | None)

  • operator_set (dict[str, Any])

is_pending_admin(account_address, pending_admin_address)

Returns true if pendingAdminAddress is a pending admin for accountAddress, false otherwise.

Return type:

bool

Parameters:
  • account_address (Address | str | None)

  • pending_admin_address (Address | str | None)

list_admins(account_address)

Returns the admins of an account.

Return type:

list[NewType(Address, bytes)]

Parameters:

account_address (Address | str | None)

list_appointee_permissions(account_address, appointee_address)

Returns the list of permissions of an appointee for a given account.

Return type:

tuple[list[NewType(Address, bytes)], list[bytes]]

Parameters:
  • account_address (Address | str | None)

  • appointee_address (Address | str | None)

list_appointees(account_address, target, selector)

Returns the list of appointees for a given account, target and function selector.

Note that this doesn’t include any of the appointed admins.

Return type:

list[NewType(Address, bytes)]

Parameters:
  • account_address (Address | str | None)

  • target (Address | str | None)

  • selector (bytes)

list_pending_admins(account_address)

Returns the pending admins of an account.

Return type:

list[NewType(Address, bytes)]

Parameters:

account_address (Address | str | None)

ELWriter

The ELWriter class provides write operations for EigenLayer contracts, enabling operator registration, strategy management, rewards processing, allocation modifications, and permission management.

class eigensdk.chainio.clients.elcontracts.writer.ELWriter(allocation_manager, avs_directory, delegation_manager, permission_controller, reward_coordinator, registry_coordinator, strategy_manager, el_chain_reader, eth_http_client, logger, pk_wallet, strategy_abi, erc20_abi)

Bases: object

Parameters:
  • allocation_manager (Contract)

  • avs_directory (Contract)

  • delegation_manager (Contract)

  • permission_controller (Contract)

  • reward_coordinator (Contract)

  • registry_coordinator (Contract)

  • strategy_manager (Contract)

  • el_chain_reader (Any)

  • eth_http_client (Web3)

  • logger (Logger)

  • pk_wallet (LocalAccount)

  • strategy_abi (List[Dict[str, Any]])

  • erc20_abi (List[Dict[str, Any]])

accept_admin(request)

Accepts pending admin role for the account.

Caller must be the pending admin.

Return type:

TxReceipt

Parameters:

request (dict)

add_pending_admin(request)

Sets a pending admin.

Admins can add others. If none exist, account can self-assign.

Return type:

TxReceipt

Parameters:

request (dict)

clear_deallocation_queue(operator_address, strategies, nums_to_clear)

Clears an operator’s deallocation queue for specific strategies.

Ensures queues are in sync with effect timestamps.

Return type:

TxReceipt

Parameters:
  • operator_address (str)

  • strategies (list)

  • nums_to_clear (list)

deposit_erc20_into_strategy(strategy_addr, amount)

Deposits amount of the strategyAddr underlying token into the strategy given by strategyAddr.

Return type:

TxReceipt

Parameters:
  • strategy_addr (str)

  • amount (int)

deregister_from_operator_sets(operator, request)

Deregisters an operator from AVS operator sets.

Remaining slashable stake remains until delay elapses.

Return type:

TxReceipt

Parameters:
  • operator (str)

  • request (dict)

get_operator_id(operator_address)

Returns the operator ID for the given operator address.

Return type:

bytes

Parameters:

operator_address (ChecksumAddress)

modify_allocations(operator_address, avs_service_manager, operator_set_id, strategies, new_magnitudes)

Modifies proportions of slashable stake allocated to an operator set from a list of strategies.

Return type:

TxReceipt

Parameters:
  • operator_address (str)

  • avs_service_manager (str)

  • operator_set_id (int)

  • strategies (list)

  • new_magnitudes (list)

process_claim(claim, recipient_address)

Processes the given claim for rewards.

Transfers rewards to recipientAddress.

Return type:

TxReceipt

Parameters:
  • claim (dict)

  • recipient_address (str)

register_as_operator(operator)

Registers the caller as an operator in EigenLayer through the DelegationManager contract.

Return type:

TxReceipt

Parameters:

operator (Operator)

register_for_operator_sets(registry_coordinator_addr, request)

Registers an operator for operator sets.

If churnApprovalEcdsaPrivateKey is provided, it replaces in full quorums.

Return type:

TxReceipt

Parameters:
  • registry_coordinator_addr (str)

  • request (dict)

remove_admin(request)

Removes the admin from an account.

Caller must be an existing admin.

Return type:

TxReceipt

Parameters:

request (dict)

remove_pending_admin(request)

Removes a pending admin from an account.

Only current admin can perform this.

Return type:

TxReceipt

Parameters:

request (dict)

remove_permission(request)

Removes permission of an appointee for a specific function on a contract, for an account.

Return type:

TxReceipt

Parameters:

request (dict)

send_transaction(func)

Send a transaction using the configured transactor.

Parameters:

func (ContractFunction)

set_allocation_delay(operator_address, delay)

Sets the allocation delay for an operator.

Defines blocks before allocated stake becomes slashable.

Return type:

TxReceipt

Parameters:
  • operator_address (str)

  • delay (int)

set_avs_registrar(avs_address, registrar_address)

Sets the avsRegistrar for the received AVS, typically a RegistryCoordinator.

Return type:

TxReceipt

Parameters:
  • avs_address (str)

  • registrar_address (str)

set_claimer_for(claimer)

Sets claimer as the claimer for the earner (caller).

Enables claimer to call processClaim.

Return type:

TxReceipt

Parameters:

claimer (str)

set_operator_avs_split(operator, avs, split)

Sets the split for a specific operator for a specific AVS.

Must be between 0 and 10000 bips. Activated after delay.

Return type:

TxReceipt

Parameters:
  • operator (str)

  • avs (str)

  • split (int)

set_operator_pi_split(operator, split)

Sets the split for a specific operator for Programmatic Incentives.

Must be between 0 and 10000 bips. Activated after delay.

Return type:

TxReceipt

Parameters:
  • operator (str)

  • split (int)

set_permission(request)

Sets an appointee for an account.

Only admins can assign appointees to functions.

Return type:

TxReceipt

Parameters:

request (dict)

update_metadata_uri(operator_address, uri)

Updates the metadata URI for the given operator.

Return type:

TxReceipt

Parameters:
  • operator_address (str)

  • uri (str)

update_operator_details(operator)

Updates an operator’s stored delegationApprover with the given operator.DelegationApproverAddress by calling modifyOperatorDetails.

Return type:

TxReceipt

Parameters:

operator (Operator)

AvsRegistryReader

The AvsRegistryReader class provides comprehensive read-only access to AVS (Autonomous Validation Service) registry contracts, offering functionality for quorum management, operator information retrieval, stake tracking, and public key management.

class eigensdk.chainio.clients.avsregistry.reader.AvsRegistryReader(registry_coordinator, registry_coordinator_addr, bls_apk_registry, bls_apk_registry_addr, operator_state_retriever, service_manager, stake_registry, logger, eth_http_client)

Bases: object

Parameters:
  • registry_coordinator (Contract)

  • registry_coordinator_addr (Address)

  • bls_apk_registry (Contract)

  • bls_apk_registry_addr (Address)

  • operator_state_retriever (Contract)

  • service_manager (Contract)

  • stake_registry (Contract)

  • logger (Logger)

  • eth_http_client (Web3)

can_satisfy_only_coordinator_owner_modifier(address)
Return type:

bool

Parameters:

address (str)

get_apk_update(quorum_number, index)

Stores and retrieves the history of aggregate public key updates for a quorum at a given index.

Return type:

BLSApkRegistryTypesApkUpdate

Parameters:
  • quorum_number (int)

  • index (int)

get_check_signatures_indices(reference_block_number, quorum_numbers, non_signer_operator_ids)

Returns a struct containing the indices of the quorum members that signed, and those that didn’t.

Return type:

OperatorStateRetrieverCheckSignaturesIndices

Parameters:
  • reference_block_number (int)

  • quorum_numbers (list[int])

  • non_signer_operator_ids (list[bytes])

get_current_apk(quorum_number)

Gets the current aggregate BLS public key for a given quorum.

Return type:

G1Point

Parameters:

quorum_number (int)

get_current_total_stake(quorum_number)

Returns the stake weight from the latest entry in the quorum’s stake history.

Return type:

int

Parameters:

quorum_number (int)

get_latest_stake_update(operator_id, quorum_number)

Returns the most recent stake weight for the operatorId in a given quorum.

Return type:

StakeRegistryTypesStakeUpdate

Parameters:
  • operator_id (bytes)

  • quorum_number (int)

get_minimum_stake_for_quorum(quorum_number)
Return type:

int

Parameters:

quorum_number (int)

get_operator_address_from_operator_id(operator_pubkey_hash)

Returns the operator address given their operator ID (pubkeyhash).

Return type:

str

Parameters:

operator_pubkey_hash (bytes)

get_operator_addrs_in_quorums_at_current_block(quorum_numbers)

Returns, for each quorum in quorumNumbers, a list of the addresses of the operators registered for that quorum at the current block.

Return type:

list[list[str]]

Parameters:

quorum_numbers (list[int])

get_operator_from_id(operator_id)

Given an operator ID, returns its address.

Return type:

str

Parameters:

operator_id (bytes)

get_operator_id(operator_address)

Given an operator address, returns its ID.

Return type:

bytes

Parameters:

operator_address (Address)

get_operator_id_from_operator_address(operator_address)

Returns the operator’s ID (pubkeyhash) given their address.

Return type:

bytes

Parameters:

operator_address (str)

get_operator_restaked_strategies(operator)
Return type:

list[str]

Parameters:

operator (str)

get_operator_stake_in_quorums_of_operator_at_current_block(operator_id)

Avoids race conditions by ensuring consistent blockNumber usage.

Queries operator’s stake data in relevant quorums using provided or default blockNumber in opts.

Return type:

dict[int, int]

Parameters:

operator_id (bytes)

get_operators_stake_in_quorums_at_block(quorum_numbers, block_number)

Returns, for each quorum in quorumNumbers, a vector of the operators registered for that quorum at a specific block number.

The contract stores historical state, so block_number should be the block number of the state to query.

Return type:

list[list[OperatorStateRetrieverOperator]]

Parameters:
  • quorum_numbers (list[int])

  • block_number (int)

get_operators_stake_in_quorums_at_current_block(quorum_numbers)

Returns, for each quorum in quorumNumbers, a vector of the operators registered for that quorum at the current block, containing each operator’s operatorId and stake.

Return type:

list[list[OperatorStateRetrieverOperator]]

Parameters:

quorum_numbers (list[int])

get_operators_stake_in_quorums_of_operator_at_block(operator_id, block_number)

Returns a tuple: - An array with the quorum IDs in which the given operator is registered at the given block - An array that contains, for each quorum, an array with the address, id, and stake of each operator

Return type:

tuple[list[int], list[list[OperatorStateRetrieverOperator]]]

Parameters:
  • operator_id (bytes)

  • block_number (int)

get_operators_stake_in_quorums_of_operator_at_current_block(operator_id)

Returns quorum registration and stake data of a given operator at the current block.

opts will be updated to include the latest blockNumber.

Return type:

tuple[list[int], list[list[OperatorStateRetrieverOperator]]]

Parameters:

operator_id (bytes)

get_pubkey_from_operator_address(operator_address)

Returns the operator’s BLS public key in G1 given their address.

Return type:

G1Point

Parameters:

operator_address (str)

get_quorum_count()

Returns the total quorum count read from the RegistryCoordinator.

Return type:

int

get_registry_coordinator_owner()
Return type:

str

get_restakeable_strategies()
Return type:

list[str]

get_slashable_stake_look_ahead_per_quorum(quorum_number)
Return type:

int

Parameters:

quorum_number (int)

get_stake_at_block_number(operator_id, quorum_number, block_number)

Returns the stake of the operator for the provided quorumNumber at the given blockNumber.

Return type:

int

Parameters:
  • operator_id (bytes)

  • quorum_number (int)

  • block_number (int)

get_stake_history(operator_id, quorum_number)

Returns the entire operatorStakeHistory[operatorId][quorumNumber] array, which contains the operator’s stake update history.

Return type:

list[StakeRegistryTypesStakeUpdate]

Parameters:
  • operator_id (bytes)

  • quorum_number (int)

get_stake_history_length(operator_id, quorum_number)

Returns the length of an operator’s stake history for the given quorum.

Return type:

int

Parameters:
  • operator_id (bytes)

  • quorum_number (int)

get_stake_type_per_quorum(quorum_number)
Return type:

int

Parameters:

quorum_number (int)

get_stake_update_at_index(operator_id, quorum_number, index)

Returns the index-th entry in the operatorStakeHistory for the specified operator and quorum.

Return type:

StakeRegistryTypesStakeUpdate

Parameters:
  • operator_id (bytes)

  • quorum_number (int)

  • index (int)

get_stake_update_index_at_block_number(operator_id, quorum_number, block_number)

Returns the indices of the operator stakes for the provided quorumNumber at the given blockNumber.

Return type:

int

Parameters:
  • operator_id (bytes)

  • quorum_number (int)

  • block_number (int)

get_strategy_params_at_index(quorum_number, index)
Return type:

StakeRegistryTypesStrategyParams

Parameters:
  • quorum_number (int)

  • index (int)

get_strategy_per_quorum_at_index(quorum_number, index)
Return type:

str

Parameters:
  • quorum_number (int)

  • index (int)

get_total_stake_at_block_number_from_index(quorum_number, block_number, index)

Returns the total stake weight for the specified quorum at the index-th entry in the stake history array if it was the stake at the specified blockNumber.

Return type:

int

Parameters:
  • quorum_number (int)

  • block_number (int)

  • index (int)

get_total_stake_history_length(quorum_number)

Returns the length of the total stake history for the given quorum.

Return type:

int

Parameters:

quorum_number (int)

get_total_stake_indices_at_block_number(quorum_numbers, block_number)
Return type:

list[int]

Parameters:
  • quorum_numbers (list[int])

  • block_number (int)

get_total_stake_update_at_index(quorum_number, index)
Return type:

StakeRegistryTypesStakeUpdate

Parameters:
  • quorum_number (int)

  • index (int)

is_operator_registered(operator_address)

Returns true if the operator is registered for the quorum, false otherwise.

Return type:

bool

Parameters:

operator_address (str)

is_operator_set_quorum(quorum_number)
Return type:

bool

Parameters:

quorum_number (int)

is_registry_coordinator_owner(address)
Return type:

bool

Parameters:

address (str)

query_existing_registered_operator_pubkeys(start_block=0, stop_block=None, block_range=10000)

Queries operators’ addresses and corresponding public keys for a block range.

Return type:

tuple[list[NewType(Address, bytes)], list[OperatorPubkeys]]

Parameters:
  • start_block (int)

  • stop_block (int | None)

  • block_range (int)

query_existing_registered_operator_sockets(start_block=0, stop_block=None, block_range=10000)

Queries operator sockets for a block range.

Returns a mapping from operator IDs to sockets.

Return type:

tuple[dict[bytes, str], int]

Parameters:
  • start_block (int)

  • stop_block (int | None)

  • block_range (int)

query_registration_detail(operator_address)

Returns an array of booleans representing whether an operator is registered for each quorum.

Return type:

list[bool]

Parameters:

operator_address (Address)

strategy_params_by_index(quorum_number, index)

Returns the strategy and weight multiplier for the index-th strategy in the specified quorum.

Return type:

StakeRegistryTypesStrategyParams

Parameters:
  • quorum_number (int)

  • index (int)

strategy_params_length(quorum_number)

Returns the length of the dynamic array stored in strategyParams[quorumNumber] in the StakeRegistry contract.

Return type:

int

Parameters:

quorum_number (int)

weight_of_operator_for_quorum(quorum_number, operator_addr)

Computes the total weight of an operator in the given quorum.

Return type:

int

Parameters:
  • quorum_number (int)

  • operator_addr (str)

AVS Registry Writer

The AvsRegistryWriter class provides write operations for AVS registry contracts, enabling comprehensive management of operators, quorums, strategies, and rewards within the AVS ecosystem.

class eigensdk.chainio.clients.avsregistry.writer.AvsRegistryWriter(registry_coordinator, operator_state_retriever, service_manager, service_manager_addr, stake_registry, bls_apk_registry, el_reader, logger, eth_http_client, pk_wallet)

Bases: object

Parameters:
  • registry_coordinator (Contract)

  • operator_state_retriever (Contract)

  • service_manager (Contract)

  • service_manager_addr (Address)

  • stake_registry (Contract)

  • bls_apk_registry (Contract)

  • el_reader (ELReader)

  • logger (Logger)

  • eth_http_client (Web3)

  • pk_wallet (LocalAccount)

add_strategies(quorum_number, strategy_params)

Adds new strategies and multipliers to the specified quorum.

Return type:

TxReceipt

Parameters:
  • quorum_number (int)

  • strategy_params (list[dict])

create_avs_rewards_submission(rewards_submission)

Creates a new AVS rewards submission for registered operators’ stakers.

Includes various validations and possible failure conditions.

Return type:

TxReceipt

Parameters:

rewards_submission (list[dict])

create_operator_directed_avs_rewards_submission(operator_directed_rewards_submissions)

Creates operator-directed AVS rewards submission.

Multiple validations apply (e.g., address order, signature permissions).

Return type:

TxReceipt

Parameters:

operator_directed_rewards_submissions (list[dict])

create_slashable_stake_quorum(operator_set_params, minimum_stake_required, strategy_params, look_ahead_period)

Creates a quorum tracking slashable stake.

Includes minimum stake and look ahead period. Only works on M2 AVSs.

Return type:

TxReceipt

Parameters:
  • operator_set_params (tuple[int, int, int])

  • minimum_stake_required (int)

  • strategy_params (list[tuple[str, int]])

  • look_ahead_period (int)

create_total_delegated_stake_quorum(operator_set_params, minimum_stake_required, strategy_params)

Creates a new quorum tracking total delegated stake.

Requires quorum params and minimum stake.

Return type:

TxReceipt

Parameters:
  • operator_set_params (tuple[int, int, int])

  • minimum_stake_required (int)

  • strategy_params (list[tuple[str, int]])

eject_operator(operator_address, quorum_numbers)

Ejects an operator from the specified quorums.

Does nothing if the operator is not registered.

Return type:

TxReceipt

Parameters:
  • operator_address (str)

  • quorum_numbers (list[int])

modify_strategy_params(quorum_number, strategy_indices, multipliers)

Modifies multipliers for existing strategies in a specific quorum.

Return type:

TxReceipt

Parameters:
  • quorum_number (int)

  • strategy_indices (list[int])

  • multipliers (list[int])

remove_strategies(quorum_number, indices_to_remove)

Removes strategies and their weights from the specified quorum.

Return type:

TxReceipt

Parameters:
  • quorum_number (int)

  • indices_to_remove (list[int])

send_transaction(func)

Send a transaction using the configured transactor.

Parameters:

func (ContractFunction)

set_avs(avs_address)

Sets the AVS address (identifier).

Should only be set once.

Return type:

TxReceipt

Parameters:

avs_address (str)

set_churn_approver(churn_approver_address)

Sets the churnApprover address, whose signature is required in churn registration.

Return type:

TxReceipt

Parameters:

churn_approver_address (str)

set_ejection_cooldown(ejection_cooldown)

Sets the ejection cooldown: the waiting time before an ejected operator can rejoin.

Return type:

TxReceipt

Parameters:

ejection_cooldown (int)

set_ejector(ejector_address)

Sets the ejector address.

This is the only address allowed to eject operators.

Return type:

TxReceipt

Parameters:

ejector_address (str)

set_minimum_stake_for_quorum(quorum_number, minimum_stake)

Sets the minimum stake required for a specific quorum.

Return type:

TxReceipt

Parameters:
  • quorum_number (int)

  • minimum_stake (int)

set_operator_set_params(quorum_number, operator_set_params)

Sets max operator count and churn parameters for a specific quorum.

Return type:

TxReceipt

Parameters:
  • quorum_number (int)

  • operator_set_params (dict)

set_rewards_initiator(rewards_initiator_addr)

Sets the rewards initiator address.

This is the only address allowed to initiate rewards.

Return type:

TxReceipt

Parameters:

rewards_initiator_addr (str)

set_slashable_stake_lookahead(quorum_number, look_ahead_period)

Sets the look ahead time for checking operator shares for a specific quorum.

Return type:

TxReceipt

Parameters:
  • quorum_number (int)

  • look_ahead_period (int)

update_avs_metadata_uri(metadata_uri)

Updates the metadata URI for the AVS.

Return type:

TxReceipt

Parameters:

metadata_uri (str)

update_socket(socket)

Updates the socket of the sender (if it is a registered operator).

Return type:

TxReceipt

Parameters:

socket (str)

update_stakes_of_entire_operator_set_for_quorums(operators_per_quorum, quorum_numbers)

Used by avs teams running https://github.com/Layr-Labs/avs-sync to update the stake of their entire operator set. Due to high gas costs, typically needs to be called per quorum.

Return type:

TxReceipt

Parameters:
  • operators_per_quorum (list[list[str]])

  • quorum_numbers (list[int])

update_stakes_of_operator_subset_for_all_quorums(operators)

Updates the stakes of the given operators for all the quorums.

Return type:

TxReceipt

Parameters:

operators (list[str])