hopr_bindings/codegen/
hoprnodestakefactoryevents.rs

1/**
2
3Generated by the following Solidity interface...
4```solidity
5interface HoprNodeStakeFactoryEvents {
6    event NewHoprNodeStakeModule(address indexed moduleImplementation, address instance);
7    event NewHoprNodeStakeSafe(address instance);
8}
9```
10
11...which was generated by the following JSON ABI:
12```json
13[
14  {
15    "type": "event",
16    "name": "NewHoprNodeStakeModule",
17    "inputs": [
18      {
19        "name": "moduleImplementation",
20        "type": "address",
21        "indexed": true,
22        "internalType": "address"
23      },
24      {
25        "name": "instance",
26        "type": "address",
27        "indexed": false,
28        "internalType": "address"
29      }
30    ],
31    "anonymous": false
32  },
33  {
34    "type": "event",
35    "name": "NewHoprNodeStakeSafe",
36    "inputs": [
37      {
38        "name": "instance",
39        "type": "address",
40        "indexed": false,
41        "internalType": "address"
42      }
43    ],
44    "anonymous": false
45  }
46]
47```*/
48#[allow(
49    non_camel_case_types,
50    non_snake_case,
51    clippy::pub_underscore_fields,
52    clippy::style,
53    clippy::empty_structs_with_brackets
54)]
55pub mod HoprNodeStakeFactoryEvents {
56    use super::*;
57    use alloy::sol_types as alloy_sol_types;
58    /// The creation / init bytecode of the contract.
59    ///
60    /// ```text
61    ///0x
62    /// ```
63    #[rustfmt::skip]
64    #[allow(clippy::all)]
65    pub static BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
66        b"",
67    );
68    /// The runtime bytecode of the contract, as deployed on the network.
69    ///
70    /// ```text
71    ///0x
72    /// ```
73    #[rustfmt::skip]
74    #[allow(clippy::all)]
75    pub static DEPLOYED_BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
76        b"",
77    );
78    #[derive(serde::Serialize, serde::Deserialize)]
79    #[derive(Default, Debug, PartialEq, Eq, Hash)]
80    /**Event with signature `NewHoprNodeStakeModule(address,address)` and selector `0x813d391dc490d6c1dae7d3fdd555f337533d1da2c908c6efd36d4cf557a63206`.
81```solidity
82event NewHoprNodeStakeModule(address indexed moduleImplementation, address instance);
83```*/
84    #[allow(
85        non_camel_case_types,
86        non_snake_case,
87        clippy::pub_underscore_fields,
88        clippy::style
89    )]
90    #[derive(Clone)]
91    pub struct NewHoprNodeStakeModule {
92        #[allow(missing_docs)]
93        pub moduleImplementation: alloy::sol_types::private::Address,
94        #[allow(missing_docs)]
95        pub instance: alloy::sol_types::private::Address,
96    }
97    #[allow(
98        non_camel_case_types,
99        non_snake_case,
100        clippy::pub_underscore_fields,
101        clippy::style
102    )]
103    const _: () = {
104        use alloy::sol_types as alloy_sol_types;
105        #[automatically_derived]
106        impl alloy_sol_types::SolEvent for NewHoprNodeStakeModule {
107            type DataTuple<'a> = (alloy::sol_types::sol_data::Address,);
108            type DataToken<'a> = <Self::DataTuple<
109                'a,
110            > as alloy_sol_types::SolType>::Token<'a>;
111            type TopicList = (
112                alloy_sol_types::sol_data::FixedBytes<32>,
113                alloy::sol_types::sol_data::Address,
114            );
115            const SIGNATURE: &'static str = "NewHoprNodeStakeModule(address,address)";
116            const SIGNATURE_HASH: alloy_sol_types::private::B256 = alloy_sol_types::private::B256::new([
117                129u8, 61u8, 57u8, 29u8, 196u8, 144u8, 214u8, 193u8, 218u8, 231u8, 211u8,
118                253u8, 213u8, 85u8, 243u8, 55u8, 83u8, 61u8, 29u8, 162u8, 201u8, 8u8,
119                198u8, 239u8, 211u8, 109u8, 76u8, 245u8, 87u8, 166u8, 50u8, 6u8,
120            ]);
121            const ANONYMOUS: bool = false;
122            #[allow(unused_variables)]
123            #[inline]
124            fn new(
125                topics: <Self::TopicList as alloy_sol_types::SolType>::RustType,
126                data: <Self::DataTuple<'_> as alloy_sol_types::SolType>::RustType,
127            ) -> Self {
128                Self {
129                    moduleImplementation: topics.1,
130                    instance: data.0,
131                }
132            }
133            #[inline]
134            fn check_signature(
135                topics: &<Self::TopicList as alloy_sol_types::SolType>::RustType,
136            ) -> alloy_sol_types::Result<()> {
137                if topics.0 != Self::SIGNATURE_HASH {
138                    return Err(
139                        alloy_sol_types::Error::invalid_event_signature_hash(
140                            Self::SIGNATURE,
141                            topics.0,
142                            Self::SIGNATURE_HASH,
143                        ),
144                    );
145                }
146                Ok(())
147            }
148            #[inline]
149            fn tokenize_body(&self) -> Self::DataToken<'_> {
150                (
151                    <alloy::sol_types::sol_data::Address as alloy_sol_types::SolType>::tokenize(
152                        &self.instance,
153                    ),
154                )
155            }
156            #[inline]
157            fn topics(&self) -> <Self::TopicList as alloy_sol_types::SolType>::RustType {
158                (Self::SIGNATURE_HASH.into(), self.moduleImplementation.clone())
159            }
160            #[inline]
161            fn encode_topics_raw(
162                &self,
163                out: &mut [alloy_sol_types::abi::token::WordToken],
164            ) -> alloy_sol_types::Result<()> {
165                if out.len() < <Self::TopicList as alloy_sol_types::TopicList>::COUNT {
166                    return Err(alloy_sol_types::Error::Overrun);
167                }
168                out[0usize] = alloy_sol_types::abi::token::WordToken(
169                    Self::SIGNATURE_HASH,
170                );
171                out[1usize] = <alloy::sol_types::sol_data::Address as alloy_sol_types::EventTopic>::encode_topic(
172                    &self.moduleImplementation,
173                );
174                Ok(())
175            }
176        }
177        #[automatically_derived]
178        impl alloy_sol_types::private::IntoLogData for NewHoprNodeStakeModule {
179            fn to_log_data(&self) -> alloy_sol_types::private::LogData {
180                From::from(self)
181            }
182            fn into_log_data(self) -> alloy_sol_types::private::LogData {
183                From::from(&self)
184            }
185        }
186        #[automatically_derived]
187        impl From<&NewHoprNodeStakeModule> for alloy_sol_types::private::LogData {
188            #[inline]
189            fn from(this: &NewHoprNodeStakeModule) -> alloy_sol_types::private::LogData {
190                alloy_sol_types::SolEvent::encode_log_data(this)
191            }
192        }
193    };
194    #[derive(serde::Serialize, serde::Deserialize)]
195    #[derive(Default, Debug, PartialEq, Eq, Hash)]
196    /**Event with signature `NewHoprNodeStakeSafe(address)` and selector `0x8231d169f416b666ae7fa43faa24a18899738075a53f32c97617d173b189e386`.
197```solidity
198event NewHoprNodeStakeSafe(address instance);
199```*/
200    #[allow(
201        non_camel_case_types,
202        non_snake_case,
203        clippy::pub_underscore_fields,
204        clippy::style
205    )]
206    #[derive(Clone)]
207    pub struct NewHoprNodeStakeSafe {
208        #[allow(missing_docs)]
209        pub instance: alloy::sol_types::private::Address,
210    }
211    #[allow(
212        non_camel_case_types,
213        non_snake_case,
214        clippy::pub_underscore_fields,
215        clippy::style
216    )]
217    const _: () = {
218        use alloy::sol_types as alloy_sol_types;
219        #[automatically_derived]
220        impl alloy_sol_types::SolEvent for NewHoprNodeStakeSafe {
221            type DataTuple<'a> = (alloy::sol_types::sol_data::Address,);
222            type DataToken<'a> = <Self::DataTuple<
223                'a,
224            > as alloy_sol_types::SolType>::Token<'a>;
225            type TopicList = (alloy_sol_types::sol_data::FixedBytes<32>,);
226            const SIGNATURE: &'static str = "NewHoprNodeStakeSafe(address)";
227            const SIGNATURE_HASH: alloy_sol_types::private::B256 = alloy_sol_types::private::B256::new([
228                130u8, 49u8, 209u8, 105u8, 244u8, 22u8, 182u8, 102u8, 174u8, 127u8,
229                164u8, 63u8, 170u8, 36u8, 161u8, 136u8, 153u8, 115u8, 128u8, 117u8,
230                165u8, 63u8, 50u8, 201u8, 118u8, 23u8, 209u8, 115u8, 177u8, 137u8, 227u8,
231                134u8,
232            ]);
233            const ANONYMOUS: bool = false;
234            #[allow(unused_variables)]
235            #[inline]
236            fn new(
237                topics: <Self::TopicList as alloy_sol_types::SolType>::RustType,
238                data: <Self::DataTuple<'_> as alloy_sol_types::SolType>::RustType,
239            ) -> Self {
240                Self { instance: data.0 }
241            }
242            #[inline]
243            fn check_signature(
244                topics: &<Self::TopicList as alloy_sol_types::SolType>::RustType,
245            ) -> alloy_sol_types::Result<()> {
246                if topics.0 != Self::SIGNATURE_HASH {
247                    return Err(
248                        alloy_sol_types::Error::invalid_event_signature_hash(
249                            Self::SIGNATURE,
250                            topics.0,
251                            Self::SIGNATURE_HASH,
252                        ),
253                    );
254                }
255                Ok(())
256            }
257            #[inline]
258            fn tokenize_body(&self) -> Self::DataToken<'_> {
259                (
260                    <alloy::sol_types::sol_data::Address as alloy_sol_types::SolType>::tokenize(
261                        &self.instance,
262                    ),
263                )
264            }
265            #[inline]
266            fn topics(&self) -> <Self::TopicList as alloy_sol_types::SolType>::RustType {
267                (Self::SIGNATURE_HASH.into(),)
268            }
269            #[inline]
270            fn encode_topics_raw(
271                &self,
272                out: &mut [alloy_sol_types::abi::token::WordToken],
273            ) -> alloy_sol_types::Result<()> {
274                if out.len() < <Self::TopicList as alloy_sol_types::TopicList>::COUNT {
275                    return Err(alloy_sol_types::Error::Overrun);
276                }
277                out[0usize] = alloy_sol_types::abi::token::WordToken(
278                    Self::SIGNATURE_HASH,
279                );
280                Ok(())
281            }
282        }
283        #[automatically_derived]
284        impl alloy_sol_types::private::IntoLogData for NewHoprNodeStakeSafe {
285            fn to_log_data(&self) -> alloy_sol_types::private::LogData {
286                From::from(self)
287            }
288            fn into_log_data(self) -> alloy_sol_types::private::LogData {
289                From::from(&self)
290            }
291        }
292        #[automatically_derived]
293        impl From<&NewHoprNodeStakeSafe> for alloy_sol_types::private::LogData {
294            #[inline]
295            fn from(this: &NewHoprNodeStakeSafe) -> alloy_sol_types::private::LogData {
296                alloy_sol_types::SolEvent::encode_log_data(this)
297            }
298        }
299    };
300    ///Container for all the [`HoprNodeStakeFactoryEvents`](self) events.
301    #[derive(serde::Serialize, serde::Deserialize)]
302    #[derive(Debug, PartialEq, Eq, Hash)]
303    pub enum HoprNodeStakeFactoryEventsEvents {
304        #[allow(missing_docs)]
305        NewHoprNodeStakeModule(NewHoprNodeStakeModule),
306        #[allow(missing_docs)]
307        NewHoprNodeStakeSafe(NewHoprNodeStakeSafe),
308    }
309    #[automatically_derived]
310    impl HoprNodeStakeFactoryEventsEvents {
311        /// All the selectors of this enum.
312        ///
313        /// Note that the selectors might not be in the same order as the variants.
314        /// No guarantees are made about the order of the selectors.
315        ///
316        /// Prefer using `SolInterface` methods instead.
317        pub const SELECTORS: &'static [[u8; 32usize]] = &[
318            [
319                129u8, 61u8, 57u8, 29u8, 196u8, 144u8, 214u8, 193u8, 218u8, 231u8, 211u8,
320                253u8, 213u8, 85u8, 243u8, 55u8, 83u8, 61u8, 29u8, 162u8, 201u8, 8u8,
321                198u8, 239u8, 211u8, 109u8, 76u8, 245u8, 87u8, 166u8, 50u8, 6u8,
322            ],
323            [
324                130u8, 49u8, 209u8, 105u8, 244u8, 22u8, 182u8, 102u8, 174u8, 127u8,
325                164u8, 63u8, 170u8, 36u8, 161u8, 136u8, 153u8, 115u8, 128u8, 117u8,
326                165u8, 63u8, 50u8, 201u8, 118u8, 23u8, 209u8, 115u8, 177u8, 137u8, 227u8,
327                134u8,
328            ],
329        ];
330    }
331    #[automatically_derived]
332    impl alloy_sol_types::SolEventInterface for HoprNodeStakeFactoryEventsEvents {
333        const NAME: &'static str = "HoprNodeStakeFactoryEventsEvents";
334        const COUNT: usize = 2usize;
335        fn decode_raw_log(
336            topics: &[alloy_sol_types::Word],
337            data: &[u8],
338        ) -> alloy_sol_types::Result<Self> {
339            match topics.first().copied() {
340                Some(
341                    <NewHoprNodeStakeModule as alloy_sol_types::SolEvent>::SIGNATURE_HASH,
342                ) => {
343                    <NewHoprNodeStakeModule as alloy_sol_types::SolEvent>::decode_raw_log(
344                            topics,
345                            data,
346                        )
347                        .map(Self::NewHoprNodeStakeModule)
348                }
349                Some(
350                    <NewHoprNodeStakeSafe as alloy_sol_types::SolEvent>::SIGNATURE_HASH,
351                ) => {
352                    <NewHoprNodeStakeSafe as alloy_sol_types::SolEvent>::decode_raw_log(
353                            topics,
354                            data,
355                        )
356                        .map(Self::NewHoprNodeStakeSafe)
357                }
358                _ => {
359                    alloy_sol_types::private::Err(alloy_sol_types::Error::InvalidLog {
360                        name: <Self as alloy_sol_types::SolEventInterface>::NAME,
361                        log: alloy_sol_types::private::Box::new(
362                            alloy_sol_types::private::LogData::new_unchecked(
363                                topics.to_vec(),
364                                data.to_vec().into(),
365                            ),
366                        ),
367                    })
368                }
369            }
370        }
371    }
372    #[automatically_derived]
373    impl alloy_sol_types::private::IntoLogData for HoprNodeStakeFactoryEventsEvents {
374        fn to_log_data(&self) -> alloy_sol_types::private::LogData {
375            match self {
376                Self::NewHoprNodeStakeModule(inner) => {
377                    alloy_sol_types::private::IntoLogData::to_log_data(inner)
378                }
379                Self::NewHoprNodeStakeSafe(inner) => {
380                    alloy_sol_types::private::IntoLogData::to_log_data(inner)
381                }
382            }
383        }
384        fn into_log_data(self) -> alloy_sol_types::private::LogData {
385            match self {
386                Self::NewHoprNodeStakeModule(inner) => {
387                    alloy_sol_types::private::IntoLogData::into_log_data(inner)
388                }
389                Self::NewHoprNodeStakeSafe(inner) => {
390                    alloy_sol_types::private::IntoLogData::into_log_data(inner)
391                }
392            }
393        }
394    }
395    use alloy::contract as alloy_contract;
396    /**Creates a new wrapper around an on-chain [`HoprNodeStakeFactoryEvents`](self) contract instance.
397
398See the [wrapper's documentation](`HoprNodeStakeFactoryEventsInstance`) for more details.*/
399    #[inline]
400    pub const fn new<
401        P: alloy_contract::private::Provider<N>,
402        N: alloy_contract::private::Network,
403    >(
404        address: alloy_sol_types::private::Address,
405        provider: P,
406    ) -> HoprNodeStakeFactoryEventsInstance<P, N> {
407        HoprNodeStakeFactoryEventsInstance::<P, N>::new(address, provider)
408    }
409    /**Deploys this contract using the given `provider` and constructor arguments, if any.
410
411Returns a new instance of the contract, if the deployment was successful.
412
413For more fine-grained control over the deployment process, use [`deploy_builder`] instead.*/
414    #[inline]
415    pub fn deploy<
416        P: alloy_contract::private::Provider<N>,
417        N: alloy_contract::private::Network,
418    >(
419        provider: P,
420    ) -> impl ::core::future::Future<
421        Output = alloy_contract::Result<HoprNodeStakeFactoryEventsInstance<P, N>>,
422    > {
423        HoprNodeStakeFactoryEventsInstance::<P, N>::deploy(provider)
424    }
425    /**Creates a `RawCallBuilder` for deploying this contract using the given `provider`
426and constructor arguments, if any.
427
428This is a simple wrapper around creating a `RawCallBuilder` with the data set to
429the bytecode concatenated with the constructor's ABI-encoded arguments.*/
430    #[inline]
431    pub fn deploy_builder<
432        P: alloy_contract::private::Provider<N>,
433        N: alloy_contract::private::Network,
434    >(provider: P) -> alloy_contract::RawCallBuilder<P, N> {
435        HoprNodeStakeFactoryEventsInstance::<P, N>::deploy_builder(provider)
436    }
437    /**A [`HoprNodeStakeFactoryEvents`](self) instance.
438
439Contains type-safe methods for interacting with an on-chain instance of the
440[`HoprNodeStakeFactoryEvents`](self) contract located at a given `address`, using a given
441provider `P`.
442
443If the contract bytecode is available (see the [`sol!`](alloy_sol_types::sol!)
444documentation on how to provide it), the `deploy` and `deploy_builder` methods can
445be used to deploy a new instance of the contract.
446
447See the [module-level documentation](self) for all the available methods.*/
448    #[derive(Clone)]
449    pub struct HoprNodeStakeFactoryEventsInstance<
450        P,
451        N = alloy_contract::private::Ethereum,
452    > {
453        address: alloy_sol_types::private::Address,
454        provider: P,
455        _network: ::core::marker::PhantomData<N>,
456    }
457    #[automatically_derived]
458    impl<P, N> ::core::fmt::Debug for HoprNodeStakeFactoryEventsInstance<P, N> {
459        #[inline]
460        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
461            f.debug_tuple("HoprNodeStakeFactoryEventsInstance")
462                .field(&self.address)
463                .finish()
464        }
465    }
466    /// Instantiation and getters/setters.
467    #[automatically_derived]
468    impl<
469        P: alloy_contract::private::Provider<N>,
470        N: alloy_contract::private::Network,
471    > HoprNodeStakeFactoryEventsInstance<P, N> {
472        /**Creates a new wrapper around an on-chain [`HoprNodeStakeFactoryEvents`](self) contract instance.
473
474See the [wrapper's documentation](`HoprNodeStakeFactoryEventsInstance`) for more details.*/
475        #[inline]
476        pub const fn new(
477            address: alloy_sol_types::private::Address,
478            provider: P,
479        ) -> Self {
480            Self {
481                address,
482                provider,
483                _network: ::core::marker::PhantomData,
484            }
485        }
486        /**Deploys this contract using the given `provider` and constructor arguments, if any.
487
488Returns a new instance of the contract, if the deployment was successful.
489
490For more fine-grained control over the deployment process, use [`deploy_builder`] instead.*/
491        #[inline]
492        pub async fn deploy(
493            provider: P,
494        ) -> alloy_contract::Result<HoprNodeStakeFactoryEventsInstance<P, N>> {
495            let call_builder = Self::deploy_builder(provider);
496            let contract_address = call_builder.deploy().await?;
497            Ok(Self::new(contract_address, call_builder.provider))
498        }
499        /**Creates a `RawCallBuilder` for deploying this contract using the given `provider`
500and constructor arguments, if any.
501
502This is a simple wrapper around creating a `RawCallBuilder` with the data set to
503the bytecode concatenated with the constructor's ABI-encoded arguments.*/
504        #[inline]
505        pub fn deploy_builder(provider: P) -> alloy_contract::RawCallBuilder<P, N> {
506            alloy_contract::RawCallBuilder::new_raw_deploy(
507                provider,
508                ::core::clone::Clone::clone(&BYTECODE),
509            )
510        }
511        /// Returns a reference to the address.
512        #[inline]
513        pub const fn address(&self) -> &alloy_sol_types::private::Address {
514            &self.address
515        }
516        /// Sets the address.
517        #[inline]
518        pub fn set_address(&mut self, address: alloy_sol_types::private::Address) {
519            self.address = address;
520        }
521        /// Sets the address and returns `self`.
522        pub fn at(mut self, address: alloy_sol_types::private::Address) -> Self {
523            self.set_address(address);
524            self
525        }
526        /// Returns a reference to the provider.
527        #[inline]
528        pub const fn provider(&self) -> &P {
529            &self.provider
530        }
531    }
532    impl<P: ::core::clone::Clone, N> HoprNodeStakeFactoryEventsInstance<&P, N> {
533        /// Clones the provider and returns a new instance with the cloned provider.
534        #[inline]
535        pub fn with_cloned_provider(self) -> HoprNodeStakeFactoryEventsInstance<P, N> {
536            HoprNodeStakeFactoryEventsInstance {
537                address: self.address,
538                provider: ::core::clone::Clone::clone(&self.provider),
539                _network: ::core::marker::PhantomData,
540            }
541        }
542    }
543    /// Function calls.
544    #[automatically_derived]
545    impl<
546        P: alloy_contract::private::Provider<N>,
547        N: alloy_contract::private::Network,
548    > HoprNodeStakeFactoryEventsInstance<P, N> {
549        /// Creates a new call builder using this contract instance's provider and address.
550        ///
551        /// Note that the call can be any function call, not just those defined in this
552        /// contract. Prefer using the other methods for building type-safe contract calls.
553        pub fn call_builder<C: alloy_sol_types::SolCall>(
554            &self,
555            call: &C,
556        ) -> alloy_contract::SolCallBuilder<&P, C, N> {
557            alloy_contract::SolCallBuilder::new_sol(&self.provider, &self.address, call)
558        }
559    }
560    /// Event filters.
561    #[automatically_derived]
562    impl<
563        P: alloy_contract::private::Provider<N>,
564        N: alloy_contract::private::Network,
565    > HoprNodeStakeFactoryEventsInstance<P, N> {
566        /// Creates a new event filter using this contract instance's provider and address.
567        ///
568        /// Note that the type can be any event, not just those defined in this contract.
569        /// Prefer using the other methods for building type-safe event filters.
570        pub fn event_filter<E: alloy_sol_types::SolEvent>(
571            &self,
572        ) -> alloy_contract::Event<&P, E, N> {
573            alloy_contract::Event::new_sol(&self.provider, &self.address)
574        }
575        ///Creates a new event filter for the [`NewHoprNodeStakeModule`] event.
576        pub fn NewHoprNodeStakeModule_filter(
577            &self,
578        ) -> alloy_contract::Event<&P, NewHoprNodeStakeModule, N> {
579            self.event_filter::<NewHoprNodeStakeModule>()
580        }
581        ///Creates a new event filter for the [`NewHoprNodeStakeSafe`] event.
582        pub fn NewHoprNodeStakeSafe_filter(
583            &self,
584        ) -> alloy_contract::Event<&P, NewHoprNodeStakeSafe, N> {
585            self.event_filter::<NewHoprNodeStakeSafe>()
586        }
587    }
588}