eigen_utils/contextupgradeable.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 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392
/**
Generated by the following Solidity interface...
```solidity
interface ContextUpgradeable {
event Initialized(uint8 version);
}
```
...which was generated by the following JSON ABI:
```json
[
{
"type": "event",
"name": "Initialized",
"inputs": [
{
"name": "version",
"type": "uint8",
"indexed": false,
"internalType": "uint8"
}
],
"anonymous": false
}
]
```*/
#[allow(non_camel_case_types, non_snake_case, clippy::style)]
pub mod ContextUpgradeable {
use super::*;
use alloy::sol_types as alloy_sol_types;
/// The creation / init bytecode of the contract.
///
/// ```text
///0x
/// ```
#[rustfmt::skip]
#[allow(clippy::all)]
pub static BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
b"",
);
/// The runtime bytecode of the contract, as deployed on the network.
///
/// ```text
///0x
/// ```
#[rustfmt::skip]
#[allow(clippy::all)]
pub static DEPLOYED_BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
b"",
);
/**Event with signature `Initialized(uint8)` and selector `0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498`.
```solidity
event Initialized(uint8 version);
```*/
#[allow(non_camel_case_types, non_snake_case, clippy::style)]
#[derive(Clone)]
pub struct Initialized {
#[allow(missing_docs)]
pub version: u8,
}
#[allow(non_camel_case_types, non_snake_case, clippy::style)]
const _: () = {
use alloy::sol_types as alloy_sol_types;
#[automatically_derived]
impl alloy_sol_types::SolEvent for Initialized {
type DataTuple<'a> = (alloy::sol_types::sol_data::Uint<8>,);
type DataToken<'a> = <Self::DataTuple<'a> as alloy_sol_types::SolType>::Token<'a>;
type TopicList = (alloy_sol_types::sol_data::FixedBytes<32>,);
const SIGNATURE: &'static str = "Initialized(uint8)";
const SIGNATURE_HASH: alloy_sol_types::private::B256 =
alloy_sol_types::private::B256::new([
127u8, 38u8, 184u8, 63u8, 249u8, 110u8, 31u8, 43u8, 106u8, 104u8, 47u8, 19u8,
56u8, 82u8, 246u8, 121u8, 138u8, 9u8, 196u8, 101u8, 218u8, 149u8, 146u8, 20u8,
96u8, 206u8, 251u8, 56u8, 71u8, 64u8, 36u8, 152u8,
]);
const ANONYMOUS: bool = false;
#[allow(unused_variables)]
#[inline]
fn new(
topics: <Self::TopicList as alloy_sol_types::SolType>::RustType,
data: <Self::DataTuple<'_> as alloy_sol_types::SolType>::RustType,
) -> Self {
Self { version: data.0 }
}
#[inline]
fn check_signature(
topics: &<Self::TopicList as alloy_sol_types::SolType>::RustType,
) -> alloy_sol_types::Result<()> {
if topics.0 != Self::SIGNATURE_HASH {
return Err(alloy_sol_types::Error::invalid_event_signature_hash(
Self::SIGNATURE,
topics.0,
Self::SIGNATURE_HASH,
));
}
Ok(())
}
#[inline]
fn tokenize_body(&self) -> Self::DataToken<'_> {
(
<alloy::sol_types::sol_data::Uint<8> as alloy_sol_types::SolType>::tokenize(
&self.version,
),
)
}
#[inline]
fn topics(&self) -> <Self::TopicList as alloy_sol_types::SolType>::RustType {
(Self::SIGNATURE_HASH.into(),)
}
#[inline]
fn encode_topics_raw(
&self,
out: &mut [alloy_sol_types::abi::token::WordToken],
) -> alloy_sol_types::Result<()> {
if out.len() < <Self::TopicList as alloy_sol_types::TopicList>::COUNT {
return Err(alloy_sol_types::Error::Overrun);
}
out[0usize] = alloy_sol_types::abi::token::WordToken(Self::SIGNATURE_HASH);
Ok(())
}
}
#[automatically_derived]
impl alloy_sol_types::private::IntoLogData for Initialized {
fn to_log_data(&self) -> alloy_sol_types::private::LogData {
From::from(self)
}
fn into_log_data(self) -> alloy_sol_types::private::LogData {
From::from(&self)
}
}
#[automatically_derived]
impl From<&Initialized> for alloy_sol_types::private::LogData {
#[inline]
fn from(this: &Initialized) -> alloy_sol_types::private::LogData {
alloy_sol_types::SolEvent::encode_log_data(this)
}
}
};
///Container for all the [`ContextUpgradeable`](self) events.
pub enum ContextUpgradeableEvents {
Initialized(Initialized),
}
#[automatically_derived]
impl ContextUpgradeableEvents {
/// All the selectors of this enum.
///
/// Note that the selectors might not be in the same order as the variants.
/// No guarantees are made about the order of the selectors.
///
/// Prefer using `SolInterface` methods instead.
pub const SELECTORS: &'static [[u8; 32usize]] = &[[
127u8, 38u8, 184u8, 63u8, 249u8, 110u8, 31u8, 43u8, 106u8, 104u8, 47u8, 19u8, 56u8,
82u8, 246u8, 121u8, 138u8, 9u8, 196u8, 101u8, 218u8, 149u8, 146u8, 20u8, 96u8, 206u8,
251u8, 56u8, 71u8, 64u8, 36u8, 152u8,
]];
}
#[automatically_derived]
impl alloy_sol_types::SolEventInterface for ContextUpgradeableEvents {
const NAME: &'static str = "ContextUpgradeableEvents";
const COUNT: usize = 1usize;
fn decode_raw_log(
topics: &[alloy_sol_types::Word],
data: &[u8],
validate: bool,
) -> alloy_sol_types::Result<Self> {
match topics.first().copied() {
Some(<Initialized as alloy_sol_types::SolEvent>::SIGNATURE_HASH) => {
<Initialized as alloy_sol_types::SolEvent>::decode_raw_log(
topics, data, validate,
)
.map(Self::Initialized)
}
_ => alloy_sol_types::private::Err(alloy_sol_types::Error::InvalidLog {
name: <Self as alloy_sol_types::SolEventInterface>::NAME,
log: alloy_sol_types::private::Box::new(
alloy_sol_types::private::LogData::new_unchecked(
topics.to_vec(),
data.to_vec().into(),
),
),
}),
}
}
}
#[automatically_derived]
impl alloy_sol_types::private::IntoLogData for ContextUpgradeableEvents {
fn to_log_data(&self) -> alloy_sol_types::private::LogData {
match self {
Self::Initialized(inner) => {
alloy_sol_types::private::IntoLogData::to_log_data(inner)
}
}
}
fn into_log_data(self) -> alloy_sol_types::private::LogData {
match self {
Self::Initialized(inner) => {
alloy_sol_types::private::IntoLogData::into_log_data(inner)
}
}
}
}
use alloy::contract as alloy_contract;
/**Creates a new wrapper around an on-chain [`ContextUpgradeable`](self) contract instance.
See the [wrapper's documentation](`ContextUpgradeableInstance`) for more details.*/
#[inline]
pub const fn new<
T: alloy_contract::private::Transport + ::core::clone::Clone,
P: alloy_contract::private::Provider<T, N>,
N: alloy_contract::private::Network,
>(
address: alloy_sol_types::private::Address,
provider: P,
) -> ContextUpgradeableInstance<T, P, N> {
ContextUpgradeableInstance::<T, P, N>::new(address, provider)
}
/**Deploys this contract using the given `provider` and constructor arguments, if any.
Returns a new instance of the contract, if the deployment was successful.
For more fine-grained control over the deployment process, use [`deploy_builder`] instead.*/
#[inline]
pub fn deploy<
T: alloy_contract::private::Transport + ::core::clone::Clone,
P: alloy_contract::private::Provider<T, N>,
N: alloy_contract::private::Network,
>(
provider: P,
) -> impl ::core::future::Future<Output = alloy_contract::Result<ContextUpgradeableInstance<T, P, N>>>
{
ContextUpgradeableInstance::<T, P, N>::deploy(provider)
}
/**Creates a `RawCallBuilder` for deploying this contract using the given `provider`
and constructor arguments, if any.
This is a simple wrapper around creating a `RawCallBuilder` with the data set to
the bytecode concatenated with the constructor's ABI-encoded arguments.*/
#[inline]
pub fn deploy_builder<
T: alloy_contract::private::Transport + ::core::clone::Clone,
P: alloy_contract::private::Provider<T, N>,
N: alloy_contract::private::Network,
>(
provider: P,
) -> alloy_contract::RawCallBuilder<T, P, N> {
ContextUpgradeableInstance::<T, P, N>::deploy_builder(provider)
}
/**A [`ContextUpgradeable`](self) instance.
Contains type-safe methods for interacting with an on-chain instance of the
[`ContextUpgradeable`](self) contract located at a given `address`, using a given
provider `P`.
If the contract bytecode is available (see the [`sol!`](alloy_sol_types::sol!)
documentation on how to provide it), the `deploy` and `deploy_builder` methods can
be used to deploy a new instance of the contract.
See the [module-level documentation](self) for all the available methods.*/
#[derive(Clone)]
pub struct ContextUpgradeableInstance<T, P, N = alloy_contract::private::Ethereum> {
address: alloy_sol_types::private::Address,
provider: P,
_network_transport: ::core::marker::PhantomData<(N, T)>,
}
#[automatically_derived]
impl<T, P, N> ::core::fmt::Debug for ContextUpgradeableInstance<T, P, N> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_tuple("ContextUpgradeableInstance")
.field(&self.address)
.finish()
}
}
/// Instantiation and getters/setters.
#[automatically_derived]
impl<
T: alloy_contract::private::Transport + ::core::clone::Clone,
P: alloy_contract::private::Provider<T, N>,
N: alloy_contract::private::Network,
> ContextUpgradeableInstance<T, P, N>
{
/**Creates a new wrapper around an on-chain [`ContextUpgradeable`](self) contract instance.
See the [wrapper's documentation](`ContextUpgradeableInstance`) for more details.*/
#[inline]
pub const fn new(address: alloy_sol_types::private::Address, provider: P) -> Self {
Self {
address,
provider,
_network_transport: ::core::marker::PhantomData,
}
}
/**Deploys this contract using the given `provider` and constructor arguments, if any.
Returns a new instance of the contract, if the deployment was successful.
For more fine-grained control over the deployment process, use [`deploy_builder`] instead.*/
#[inline]
pub async fn deploy(
provider: P,
) -> alloy_contract::Result<ContextUpgradeableInstance<T, P, N>> {
let call_builder = Self::deploy_builder(provider);
let contract_address = call_builder.deploy().await?;
Ok(Self::new(contract_address, call_builder.provider))
}
/**Creates a `RawCallBuilder` for deploying this contract using the given `provider`
and constructor arguments, if any.
This is a simple wrapper around creating a `RawCallBuilder` with the data set to
the bytecode concatenated with the constructor's ABI-encoded arguments.*/
#[inline]
pub fn deploy_builder(provider: P) -> alloy_contract::RawCallBuilder<T, P, N> {
alloy_contract::RawCallBuilder::new_raw_deploy(
provider,
::core::clone::Clone::clone(&BYTECODE),
)
}
/// Returns a reference to the address.
#[inline]
pub const fn address(&self) -> &alloy_sol_types::private::Address {
&self.address
}
/// Sets the address.
#[inline]
pub fn set_address(&mut self, address: alloy_sol_types::private::Address) {
self.address = address;
}
/// Sets the address and returns `self`.
pub fn at(mut self, address: alloy_sol_types::private::Address) -> Self {
self.set_address(address);
self
}
/// Returns a reference to the provider.
#[inline]
pub const fn provider(&self) -> &P {
&self.provider
}
}
impl<T, P: ::core::clone::Clone, N> ContextUpgradeableInstance<T, &P, N> {
/// Clones the provider and returns a new instance with the cloned provider.
#[inline]
pub fn with_cloned_provider(self) -> ContextUpgradeableInstance<T, P, N> {
ContextUpgradeableInstance {
address: self.address,
provider: ::core::clone::Clone::clone(&self.provider),
_network_transport: ::core::marker::PhantomData,
}
}
}
/// Function calls.
#[automatically_derived]
impl<
T: alloy_contract::private::Transport + ::core::clone::Clone,
P: alloy_contract::private::Provider<T, N>,
N: alloy_contract::private::Network,
> ContextUpgradeableInstance<T, P, N>
{
/// Creates a new call builder using this contract instance's provider and address.
///
/// Note that the call can be any function call, not just those defined in this
/// contract. Prefer using the other methods for building type-safe contract calls.
pub fn call_builder<C: alloy_sol_types::SolCall>(
&self,
call: &C,
) -> alloy_contract::SolCallBuilder<T, &P, C, N> {
alloy_contract::SolCallBuilder::new_sol(&self.provider, &self.address, call)
}
}
/// Event filters.
#[automatically_derived]
impl<
T: alloy_contract::private::Transport + ::core::clone::Clone,
P: alloy_contract::private::Provider<T, N>,
N: alloy_contract::private::Network,
> ContextUpgradeableInstance<T, P, N>
{
/// Creates a new event filter using this contract instance's provider and address.
///
/// Note that the type can be any event, not just those defined in this contract.
/// Prefer using the other methods for building type-safe event filters.
pub fn event_filter<E: alloy_sol_types::SolEvent>(
&self,
) -> alloy_contract::Event<T, &P, E, N> {
alloy_contract::Event::new_sol(&self.provider, &self.address)
}
///Creates a new event filter for the [`Initialized`] event.
pub fn Initialized_filter(&self) -> alloy_contract::Event<T, &P, Initialized, N> {
self.event_filter::<Initialized>()
}
}
}