eigenlayer_contract_deployer/bindings/core/
empty_contract.rs

1#![allow(clippy::all, clippy::pedantic, clippy::nursery, warnings, unknown_lints, rustdoc::all, elided_lifetimes_in_paths)]
2use EmptyContract::*;
3
4/**
5
6Generated by the following Solidity interface...
7```solidity
8interface EmptyContract {
9    function foo() external pure returns (uint256);
10}
11```
12
13...which was generated by the following JSON ABI:
14```json
15[
16  {
17    "type": "function",
18    "name": "foo",
19    "inputs": [],
20    "outputs": [
21      {
22        "name": "",
23        "type": "uint256",
24        "internalType": "uint256"
25      }
26    ],
27    "stateMutability": "pure"
28  }
29]
30```*/
31#[allow(
32    non_camel_case_types,
33    non_snake_case,
34    clippy::pub_underscore_fields,
35    clippy::style,
36    clippy::empty_structs_with_brackets
37)]
38pub mod EmptyContract {
39    use super::*;
40    use alloy::sol_types as alloy_sol_types;
41    /// The creation / init bytecode of the contract.
42    ///
43    /// ```text
44    ///0x6080604052348015600e575f5ffd5b50607380601a5f395ff3fe6080604052348015600e575f5ffd5b50600436106026575f3560e01c8063c298557814602a575b5f5ffd5b5f60405190815260200160405180910390f3fea2646970667358221220065cc1fc21b4eb7bc92f84674533008d257e86502809b253c89c5cdcea463baf64736f6c634300081b0033
45    /// ```
46    #[rustfmt::skip]
47    #[allow(clippy::all)]
48    pub static BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
49        b"`\x80`@R4\x80\x15`\x0EW__\xFD[P`s\x80`\x1A_9_\xF3\xFE`\x80`@R4\x80\x15`\x0EW__\xFD[P`\x046\x10`&W_5`\xE0\x1C\x80c\xC2\x98Ux\x14`*W[__\xFD[_`@Q\x90\x81R` \x01`@Q\x80\x91\x03\x90\xF3\xFE\xA2dipfsX\"\x12 \x06\\\xC1\xFC!\xB4\xEB{\xC9/\x84gE3\0\x8D%~\x86P(\t\xB2S\xC8\x9C\\\xDC\xEAF;\xAFdsolcC\0\x08\x1B\x003",
50    );
51    /// The runtime bytecode of the contract, as deployed on the network.
52    ///
53    /// ```text
54    ///0x6080604052348015600e575f5ffd5b50600436106026575f3560e01c8063c298557814602a575b5f5ffd5b5f60405190815260200160405180910390f3fea2646970667358221220065cc1fc21b4eb7bc92f84674533008d257e86502809b253c89c5cdcea463baf64736f6c634300081b0033
55    /// ```
56    #[rustfmt::skip]
57    #[allow(clippy::all)]
58    pub static DEPLOYED_BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
59        b"`\x80`@R4\x80\x15`\x0EW__\xFD[P`\x046\x10`&W_5`\xE0\x1C\x80c\xC2\x98Ux\x14`*W[__\xFD[_`@Q\x90\x81R` \x01`@Q\x80\x91\x03\x90\xF3\xFE\xA2dipfsX\"\x12 \x06\\\xC1\xFC!\xB4\xEB{\xC9/\x84gE3\0\x8D%~\x86P(\t\xB2S\xC8\x9C\\\xDC\xEAF;\xAFdsolcC\0\x08\x1B\x003",
60    );
61    #[derive(serde::Serialize, serde::Deserialize)]
62    #[derive(Default, Debug, PartialEq, Eq, Hash)]
63    /**Function with signature `foo()` and selector `0xc2985578`.
64```solidity
65function foo() external pure returns (uint256);
66```*/
67    #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
68    #[derive(Clone)]
69    pub struct fooCall;
70    #[derive(serde::Serialize, serde::Deserialize)]
71    #[derive(Default, Debug, PartialEq, Eq, Hash)]
72    ///Container type for the return parameters of the [`foo()`](fooCall) function.
73    #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
74    #[derive(Clone)]
75    pub struct fooReturn {
76        #[allow(missing_docs)]
77        pub _0: alloy::sol_types::private::primitives::aliases::U256,
78    }
79    #[allow(
80        non_camel_case_types,
81        non_snake_case,
82        clippy::pub_underscore_fields,
83        clippy::style
84    )]
85    const _: () = {
86        use alloy::sol_types as alloy_sol_types;
87        {
88            #[doc(hidden)]
89            type UnderlyingSolTuple<'a> = ();
90            #[doc(hidden)]
91            type UnderlyingRustTuple<'a> = ();
92            #[cfg(test)]
93            #[allow(dead_code, unreachable_patterns)]
94            fn _type_assertion(
95                _t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>,
96            ) {
97                match _t {
98                    alloy_sol_types::private::AssertTypeEq::<
99                        <UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
100                    >(_) => {}
101                }
102            }
103            #[automatically_derived]
104            #[doc(hidden)]
105            impl ::core::convert::From<fooCall> for UnderlyingRustTuple<'_> {
106                fn from(value: fooCall) -> Self {
107                    ()
108                }
109            }
110            #[automatically_derived]
111            #[doc(hidden)]
112            impl ::core::convert::From<UnderlyingRustTuple<'_>> for fooCall {
113                fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
114                    Self
115                }
116            }
117        }
118        {
119            #[doc(hidden)]
120            type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::Uint<256>,);
121            #[doc(hidden)]
122            type UnderlyingRustTuple<'a> = (
123                alloy::sol_types::private::primitives::aliases::U256,
124            );
125            #[cfg(test)]
126            #[allow(dead_code, unreachable_patterns)]
127            fn _type_assertion(
128                _t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>,
129            ) {
130                match _t {
131                    alloy_sol_types::private::AssertTypeEq::<
132                        <UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
133                    >(_) => {}
134                }
135            }
136            #[automatically_derived]
137            #[doc(hidden)]
138            impl ::core::convert::From<fooReturn> for UnderlyingRustTuple<'_> {
139                fn from(value: fooReturn) -> Self {
140                    (value._0,)
141                }
142            }
143            #[automatically_derived]
144            #[doc(hidden)]
145            impl ::core::convert::From<UnderlyingRustTuple<'_>> for fooReturn {
146                fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
147                    Self { _0: tuple.0 }
148                }
149            }
150        }
151        #[automatically_derived]
152        impl alloy_sol_types::SolCall for fooCall {
153            type Parameters<'a> = ();
154            type Token<'a> = <Self::Parameters<
155                'a,
156            > as alloy_sol_types::SolType>::Token<'a>;
157            type Return = alloy::sol_types::private::primitives::aliases::U256;
158            type ReturnTuple<'a> = (alloy::sol_types::sol_data::Uint<256>,);
159            type ReturnToken<'a> = <Self::ReturnTuple<
160                'a,
161            > as alloy_sol_types::SolType>::Token<'a>;
162            const SIGNATURE: &'static str = "foo()";
163            const SELECTOR: [u8; 4] = [194u8, 152u8, 85u8, 120u8];
164            #[inline]
165            fn new<'a>(
166                tuple: <Self::Parameters<'a> as alloy_sol_types::SolType>::RustType,
167            ) -> Self {
168                tuple.into()
169            }
170            #[inline]
171            fn tokenize(&self) -> Self::Token<'_> {
172                ()
173            }
174            #[inline]
175            fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> {
176                (
177                    <alloy::sol_types::sol_data::Uint<
178                        256,
179                    > as alloy_sol_types::SolType>::tokenize(ret),
180                )
181            }
182            #[inline]
183            fn abi_decode_returns(data: &[u8]) -> alloy_sol_types::Result<Self::Return> {
184                <Self::ReturnTuple<
185                    '_,
186                > as alloy_sol_types::SolType>::abi_decode_sequence(data)
187                    .map(|r| {
188                        let r: fooReturn = r.into();
189                        r._0
190                    })
191            }
192            #[inline]
193            fn abi_decode_returns_validate(
194                data: &[u8],
195            ) -> alloy_sol_types::Result<Self::Return> {
196                <Self::ReturnTuple<
197                    '_,
198                > as alloy_sol_types::SolType>::abi_decode_sequence_validate(data)
199                    .map(|r| {
200                        let r: fooReturn = r.into();
201                        r._0
202                    })
203            }
204        }
205    };
206    ///Container for all the [`EmptyContract`](self) function calls.
207    #[derive(serde::Serialize, serde::Deserialize)]
208    #[derive()]
209    pub enum EmptyContractCalls {
210        #[allow(missing_docs)]
211        foo(fooCall),
212    }
213    #[automatically_derived]
214    impl EmptyContractCalls {
215        /// All the selectors of this enum.
216        ///
217        /// Note that the selectors might not be in the same order as the variants.
218        /// No guarantees are made about the order of the selectors.
219        ///
220        /// Prefer using `SolInterface` methods instead.
221        pub const SELECTORS: &'static [[u8; 4usize]] = &[[194u8, 152u8, 85u8, 120u8]];
222    }
223    #[automatically_derived]
224    impl alloy_sol_types::SolInterface for EmptyContractCalls {
225        const NAME: &'static str = "EmptyContractCalls";
226        const MIN_DATA_LENGTH: usize = 0usize;
227        const COUNT: usize = 1usize;
228        #[inline]
229        fn selector(&self) -> [u8; 4] {
230            match self {
231                Self::foo(_) => <fooCall as alloy_sol_types::SolCall>::SELECTOR,
232            }
233        }
234        #[inline]
235        fn selector_at(i: usize) -> ::core::option::Option<[u8; 4]> {
236            Self::SELECTORS.get(i).copied()
237        }
238        #[inline]
239        fn valid_selector(selector: [u8; 4]) -> bool {
240            Self::SELECTORS.binary_search(&selector).is_ok()
241        }
242        #[inline]
243        #[allow(non_snake_case)]
244        fn abi_decode_raw(
245            selector: [u8; 4],
246            data: &[u8],
247        ) -> alloy_sol_types::Result<Self> {
248            static DECODE_SHIMS: &[fn(
249                &[u8],
250            ) -> alloy_sol_types::Result<EmptyContractCalls>] = &[
251                {
252                    fn foo(data: &[u8]) -> alloy_sol_types::Result<EmptyContractCalls> {
253                        <fooCall as alloy_sol_types::SolCall>::abi_decode_raw(data)
254                            .map(EmptyContractCalls::foo)
255                    }
256                    foo
257                },
258            ];
259            let Ok(idx) = Self::SELECTORS.binary_search(&selector) else {
260                return Err(
261                    alloy_sol_types::Error::unknown_selector(
262                        <Self as alloy_sol_types::SolInterface>::NAME,
263                        selector,
264                    ),
265                );
266            };
267            DECODE_SHIMS[idx](data)
268        }
269        #[inline]
270        #[allow(non_snake_case)]
271        fn abi_decode_raw_validate(
272            selector: [u8; 4],
273            data: &[u8],
274        ) -> alloy_sol_types::Result<Self> {
275            static DECODE_VALIDATE_SHIMS: &[fn(
276                &[u8],
277            ) -> alloy_sol_types::Result<EmptyContractCalls>] = &[
278                {
279                    fn foo(data: &[u8]) -> alloy_sol_types::Result<EmptyContractCalls> {
280                        <fooCall as alloy_sol_types::SolCall>::abi_decode_raw_validate(
281                                data,
282                            )
283                            .map(EmptyContractCalls::foo)
284                    }
285                    foo
286                },
287            ];
288            let Ok(idx) = Self::SELECTORS.binary_search(&selector) else {
289                return Err(
290                    alloy_sol_types::Error::unknown_selector(
291                        <Self as alloy_sol_types::SolInterface>::NAME,
292                        selector,
293                    ),
294                );
295            };
296            DECODE_VALIDATE_SHIMS[idx](data)
297        }
298        #[inline]
299        fn abi_encoded_size(&self) -> usize {
300            match self {
301                Self::foo(inner) => {
302                    <fooCall as alloy_sol_types::SolCall>::abi_encoded_size(inner)
303                }
304            }
305        }
306        #[inline]
307        fn abi_encode_raw(&self, out: &mut alloy_sol_types::private::Vec<u8>) {
308            match self {
309                Self::foo(inner) => {
310                    <fooCall as alloy_sol_types::SolCall>::abi_encode_raw(inner, out)
311                }
312            }
313        }
314    }
315    use alloy::contract as alloy_contract;
316    /**Creates a new wrapper around an on-chain [`EmptyContract`](self) contract instance.
317
318See the [wrapper's documentation](`EmptyContractInstance`) for more details.*/
319    #[inline]
320    pub const fn new<
321        P: alloy_contract::private::Provider<N>,
322        N: alloy_contract::private::Network,
323    >(
324        address: alloy_sol_types::private::Address,
325        provider: P,
326    ) -> EmptyContractInstance<P, N> {
327        EmptyContractInstance::<P, N>::new(address, provider)
328    }
329    /**Deploys this contract using the given `provider` and constructor arguments, if any.
330
331Returns a new instance of the contract, if the deployment was successful.
332
333For more fine-grained control over the deployment process, use [`deploy_builder`] instead.*/
334    #[inline]
335    pub fn deploy<
336        P: alloy_contract::private::Provider<N>,
337        N: alloy_contract::private::Network,
338    >(
339        provider: P,
340    ) -> impl ::core::future::Future<
341        Output = alloy_contract::Result<EmptyContractInstance<P, N>>,
342    > {
343        EmptyContractInstance::<P, N>::deploy(provider)
344    }
345    /**Creates a `RawCallBuilder` for deploying this contract using the given `provider`
346and constructor arguments, if any.
347
348This is a simple wrapper around creating a `RawCallBuilder` with the data set to
349the bytecode concatenated with the constructor's ABI-encoded arguments.*/
350    #[inline]
351    pub fn deploy_builder<
352        P: alloy_contract::private::Provider<N>,
353        N: alloy_contract::private::Network,
354    >(provider: P) -> alloy_contract::RawCallBuilder<P, N> {
355        EmptyContractInstance::<P, N>::deploy_builder(provider)
356    }
357    /**A [`EmptyContract`](self) instance.
358
359Contains type-safe methods for interacting with an on-chain instance of the
360[`EmptyContract`](self) contract located at a given `address`, using a given
361provider `P`.
362
363If the contract bytecode is available (see the [`sol!`](alloy_sol_types::sol!)
364documentation on how to provide it), the `deploy` and `deploy_builder` methods can
365be used to deploy a new instance of the contract.
366
367See the [module-level documentation](self) for all the available methods.*/
368    #[derive(Clone)]
369    pub struct EmptyContractInstance<P, N = alloy_contract::private::Ethereum> {
370        address: alloy_sol_types::private::Address,
371        provider: P,
372        _network: ::core::marker::PhantomData<N>,
373    }
374    #[automatically_derived]
375    impl<P, N> ::core::fmt::Debug for EmptyContractInstance<P, N> {
376        #[inline]
377        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
378            f.debug_tuple("EmptyContractInstance").field(&self.address).finish()
379        }
380    }
381    /// Instantiation and getters/setters.
382    #[automatically_derived]
383    impl<
384        P: alloy_contract::private::Provider<N>,
385        N: alloy_contract::private::Network,
386    > EmptyContractInstance<P, N> {
387        /**Creates a new wrapper around an on-chain [`EmptyContract`](self) contract instance.
388
389See the [wrapper's documentation](`EmptyContractInstance`) for more details.*/
390        #[inline]
391        pub const fn new(
392            address: alloy_sol_types::private::Address,
393            provider: P,
394        ) -> Self {
395            Self {
396                address,
397                provider,
398                _network: ::core::marker::PhantomData,
399            }
400        }
401        /**Deploys this contract using the given `provider` and constructor arguments, if any.
402
403Returns a new instance of the contract, if the deployment was successful.
404
405For more fine-grained control over the deployment process, use [`deploy_builder`] instead.*/
406        #[inline]
407        pub async fn deploy(
408            provider: P,
409        ) -> alloy_contract::Result<EmptyContractInstance<P, N>> {
410            let call_builder = Self::deploy_builder(provider);
411            let contract_address = call_builder.deploy().await?;
412            Ok(Self::new(contract_address, call_builder.provider))
413        }
414        /**Creates a `RawCallBuilder` for deploying this contract using the given `provider`
415and constructor arguments, if any.
416
417This is a simple wrapper around creating a `RawCallBuilder` with the data set to
418the bytecode concatenated with the constructor's ABI-encoded arguments.*/
419        #[inline]
420        pub fn deploy_builder(provider: P) -> alloy_contract::RawCallBuilder<P, N> {
421            alloy_contract::RawCallBuilder::new_raw_deploy(
422                provider,
423                ::core::clone::Clone::clone(&BYTECODE),
424            )
425        }
426        /// Returns a reference to the address.
427        #[inline]
428        pub const fn address(&self) -> &alloy_sol_types::private::Address {
429            &self.address
430        }
431        /// Sets the address.
432        #[inline]
433        pub fn set_address(&mut self, address: alloy_sol_types::private::Address) {
434            self.address = address;
435        }
436        /// Sets the address and returns `self`.
437        pub fn at(mut self, address: alloy_sol_types::private::Address) -> Self {
438            self.set_address(address);
439            self
440        }
441        /// Returns a reference to the provider.
442        #[inline]
443        pub const fn provider(&self) -> &P {
444            &self.provider
445        }
446    }
447    impl<P: ::core::clone::Clone, N> EmptyContractInstance<&P, N> {
448        /// Clones the provider and returns a new instance with the cloned provider.
449        #[inline]
450        pub fn with_cloned_provider(self) -> EmptyContractInstance<P, N> {
451            EmptyContractInstance {
452                address: self.address,
453                provider: ::core::clone::Clone::clone(&self.provider),
454                _network: ::core::marker::PhantomData,
455            }
456        }
457    }
458    /// Function calls.
459    #[automatically_derived]
460    impl<
461        P: alloy_contract::private::Provider<N>,
462        N: alloy_contract::private::Network,
463    > EmptyContractInstance<P, N> {
464        /// Creates a new call builder using this contract instance's provider and address.
465        ///
466        /// Note that the call can be any function call, not just those defined in this
467        /// contract. Prefer using the other methods for building type-safe contract calls.
468        pub fn call_builder<C: alloy_sol_types::SolCall>(
469            &self,
470            call: &C,
471        ) -> alloy_contract::SolCallBuilder<&P, C, N> {
472            alloy_contract::SolCallBuilder::new_sol(&self.provider, &self.address, call)
473        }
474        ///Creates a new call builder for the [`foo`] function.
475        pub fn foo(&self) -> alloy_contract::SolCallBuilder<&P, fooCall, N> {
476            self.call_builder(&fooCall)
477        }
478    }
479    /// Event filters.
480    #[automatically_derived]
481    impl<
482        P: alloy_contract::private::Provider<N>,
483        N: alloy_contract::private::Network,
484    > EmptyContractInstance<P, N> {
485        /// Creates a new event filter using this contract instance's provider and address.
486        ///
487        /// Note that the type can be any event, not just those defined in this contract.
488        /// Prefer using the other methods for building type-safe event filters.
489        pub fn event_filter<E: alloy_sol_types::SolEvent>(
490            &self,
491        ) -> alloy_contract::Event<&P, E, N> {
492            alloy_contract::Event::new_sol(&self.provider, &self.address)
493        }
494    }
495}