hopr_bindings/codegen/
hoprticketpriceoracleevents.rs

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