pod_contracts/
ideadline.rs

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