eigen_utils/
lib.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
#![doc(
    html_logo_url = "https://github.com/Layr-Labs/eigensdk-rs/assets/91280922/bd13caec-3c00-4afc-839a-b83d2890beb5",
    issue_tracker_base_url = "https://github.com/Layr-Labs/eigensdk-rs/issues/"
)]
#![cfg(not(doctest))]
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
#![allow(unused_imports, clippy::all, rustdoc::all)]
//! This module contains the sol! generated bindings for solidity contracts.
//! This is autogenerated code.
//! Do not manually edit these files.
//! These files may be overwritten by the codegen system at any time.
pub mod address;
pub mod addressupgradeable;
pub mod avsdirectory;
pub mod beaconchainproofs;
pub mod bitmaputils;
pub mod blsapkregistry;
pub mod blsapkregistrystorage;
pub mod blssignaturechecker;
pub mod bn254;
pub mod checkpointsupgradeable;
pub mod configsreadwriter;
pub mod context;
pub mod contextupgradeable;
pub mod contractsregistry;
pub mod delegationmanager;
pub mod deploymockavs;
pub mod deploymockavsregistries;
pub mod deploytokensstrategiescreatequorums;
pub mod ecdsa;
pub mod ecdsaservicemanagerbase;
pub mod ecdsastakeregistry;
pub mod ecdsastakeregistryequalweight;
pub mod ecdsastakeregistryeventsanderrors;
pub mod ecdsastakeregistrypermissioned;
pub mod ecdsastakeregistrystorage;
pub mod ecdsaupgradeable;
pub mod eigenlayercontractsparser;
pub mod eip1271signatureutils;
pub mod eip712;
pub mod ejectionmanager;
pub mod emptycontract;
pub mod endian;
pub mod erc1967proxy;
pub mod erc1967upgrade;
pub mod erc20;
pub mod iavsdirectory;
pub mod ibeacon;
pub mod ibeaconchainoracle;
pub mod iblsapkregistry;
pub mod iblssignaturechecker;
pub mod idelegationmanager;
pub mod ieigenpod;
pub mod ieigenpodmanager;
pub mod iejectionmanager;
pub mod ierc1271;
pub mod ierc1271upgradeable;
pub mod ierc165;
pub mod ierc1822proxiable;
pub mod ierc20;
pub mod ierc20metadata;
pub mod ierc20permit;
pub mod ierc721;
pub mod ierc721enumerable;
pub mod ierc721metadata;
pub mod ierc721tokenreceiver;
pub mod iethposdeposit;
pub mod iindexregistry;
pub mod indexregistry;
pub mod indexregistrystorage;
pub mod initializable;
pub mod ipausable;
pub mod ipauserregistry;
pub mod iregistry;
pub mod iregistrycoordinator;
pub mod irewardscoordinator;
pub mod iservicemanager;
pub mod iservicemanagerui;
pub mod isignatureutils;
pub mod islasher;
pub mod isocketupdater;
pub mod istakeregistry;
pub mod istrategy;
pub mod istrategymanager;
pub mod mathupgradeable;
pub mod merkle;
pub mod mockavscontractsparser;
pub mod mockavsservicemanager;
pub mod mockerc20;
pub mod mockerc721;
pub mod operatorstateretriever;
pub mod ownable;
pub mod ownableupgradeable;
pub mod pausable;
pub mod pauserregistry;
pub mod proxy;
pub mod proxyadmin;
pub mod registeroperators;
pub mod registrycoordinator;
pub mod registrycoordinatorstorage;
pub mod safecastupgradeable;
pub mod safeerc20;
pub mod servicemanagerbase;
pub mod servicemanagerbasestorage;
pub mod servicemanagerrouter;
pub mod signaturecheckerupgradeable;
pub mod stakeregistry;
pub mod stakeregistrystorage;
pub mod storageslot;
pub mod strategybase;
pub mod strategybasetvllimits;
pub mod strategymanager;
pub mod strings;
pub mod stringsupgradeable;
pub mod tokenandstrategycontractsparser;
pub mod transparentupgradeableproxy;
pub mod updateoperators;

use alloy::network::{Ethereum, EthereumWallet};
use alloy::providers::{
    fillers::{
        BlobGasFiller, ChainIdFiller, FillProvider, GasFiller, JoinFill, NonceFiller, WalletFiller,
    },
    Identity, ProviderBuilder, RootProvider, WsConnect,
};
use alloy::pubsub::PubSubFrontend;
use alloy::signers::local::PrivateKeySigner;
use alloy::transports::http::{Client, Http};
use alloy::transports::RpcError;
use alloy::transports::TransportErrorKind;
use reqwest::Url;
use std::str::FromStr;

#[allow(clippy::type_complexity)]
pub fn get_signer(
    key: &str,
    rpc_url: &str,
) -> alloy::providers::fillers::FillProvider<
    JoinFill<
        JoinFill<
            Identity,
            JoinFill<GasFiller, JoinFill<BlobGasFiller, JoinFill<NonceFiller, ChainIdFiller>>>,
        >,
        WalletFiller<EthereumWallet>,
    >,
    RootProvider<Http<Client>>,
    Http<Client>,
    Ethereum,
> {
    let signer = PrivateKeySigner::from_str(key).expect("wrong key ");
    let wallet = EthereumWallet::from(signer);
    let url = Url::parse(rpc_url).expect("Wrong rpc url");
    ProviderBuilder::new()
        .with_recommended_fillers()
        .wallet(wallet.clone())
        .on_http(url)
}

#[allow(clippy::type_complexity)]
pub fn get_provider(
    rpc_url: &str,
) -> FillProvider<
    JoinFill<
        Identity,
        JoinFill<GasFiller, JoinFill<BlobGasFiller, JoinFill<NonceFiller, ChainIdFiller>>>,
    >,
    RootProvider<Http<Client>>,
    Http<Client>,
    Ethereum,
> {
    let url = Url::parse(rpc_url).expect("Wrong rpc url");
    ProviderBuilder::new()
        .with_recommended_fillers()
        .on_http(url)
}

#[allow(clippy::type_complexity)]
pub async fn get_ws_provider(
    rpc_url: &str,
) -> Result<RootProvider<PubSubFrontend>, RpcError<TransportErrorKind>> {
    let ws = WsConnect::new(rpc_url);
    ProviderBuilder::new().on_ws(ws).await
}

/// Emitted when a new pubkey is registered
pub const NEW_PUBKEY_REGISTRATION_EVENT: &str =
    "NewPubkeyRegistration(address,(uint256,uint256),(uint256[2],uint256[2]))";

pub const OPERATOR_SOCKET_UPDATE: &str = "OperatorSocketUpdate(bytes32,string)";