openzeppelin_rs/contracts/
IERC6372.rs

1pub use ierc6372::*;
2/// This module was auto-generated with ethers-rs Abigen.
3/// More information at: <https://github.com/gakonst/ethers-rs>
4#[allow(
5    clippy::enum_variant_names,
6    clippy::too_many_arguments,
7    clippy::upper_case_acronyms,
8    clippy::type_complexity,
9    dead_code,
10    non_camel_case_types,
11)]
12pub mod ierc6372 {
13    #[rustfmt::skip]
14    const __ABI: &str = "[{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"CLOCK_MODE\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\",\"components\":[]}]},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"clock\",\"outputs\":[{\"internalType\":\"uint48\",\"name\":\"\",\"type\":\"uint48\",\"components\":[]}]}]";
15    ///The parsed JSON ABI of the contract.
16    pub static IERC6372_ABI: ::ethers_contract::Lazy<::ethers_core::abi::Abi> = ::ethers_contract::Lazy::new(||
17    ::ethers_core::utils::__serde_json::from_str(__ABI).expect("ABI is always valid"));
18    pub struct IERC6372<M>(::ethers_contract::Contract<M>);
19    impl<M> ::core::clone::Clone for IERC6372<M> {
20        fn clone(&self) -> Self {
21            Self(::core::clone::Clone::clone(&self.0))
22        }
23    }
24    impl<M> ::core::ops::Deref for IERC6372<M> {
25        type Target = ::ethers_contract::Contract<M>;
26        fn deref(&self) -> &Self::Target {
27            &self.0
28        }
29    }
30    impl<M> ::core::ops::DerefMut for IERC6372<M> {
31        fn deref_mut(&mut self) -> &mut Self::Target {
32            &mut self.0
33        }
34    }
35    impl<M> ::core::fmt::Debug for IERC6372<M> {
36        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
37            f.debug_tuple(stringify!(IERC6372)).field(&self.address()).finish()
38        }
39    }
40    impl<M: ::ethers_providers::Middleware> IERC6372<M> {
41        /// Creates a new contract instance with the specified `ethers` client at
42        /// `address`. The contract derefs to a `ethers::Contract` object.
43        pub fn new<T: Into<::ethers_core::types::Address>>(
44            address: T,
45            client: ::std::sync::Arc<M>,
46        ) -> Self {
47            Self(
48                ::ethers_contract::Contract::new(
49                    address.into(),
50                    IERC6372_ABI.clone(),
51                    client,
52                ),
53            )
54        }
55        ///Calls the contract's `CLOCK_MODE` (0x4bf5d7e9) function
56        pub fn clock_mode(
57            &self,
58        ) -> ::ethers_contract::builders::ContractCall<M, ::std::string::String> {
59            self.0
60                .method_hash([75, 245, 215, 233], ())
61                .expect("method not found (this should never happen)")
62        }
63        ///Calls the contract's `clock` (0x91ddadf4) function
64        pub fn clock(&self) -> ::ethers_contract::builders::ContractCall<M, u64> {
65            self.0
66                .method_hash([145, 221, 173, 244], ())
67                .expect("method not found (this should never happen)")
68        }
69    }
70    impl<M: ::ethers_providers::Middleware> From<::ethers_contract::Contract<M>>
71    for IERC6372<M> {
72        fn from(contract: ::ethers_contract::Contract<M>) -> Self {
73            Self::new(contract.address(), contract.client())
74        }
75    }
76    ///Container type for all input parameters for the `CLOCK_MODE` function with signature `CLOCK_MODE()` and selector `0x4bf5d7e9`
77    #[derive(
78        Clone,
79        ::ethers_contract::EthCall,
80        ::ethers_contract::EthDisplay,
81        Default,
82        Debug,
83        PartialEq,
84        Eq,
85        Hash
86    )]
87    #[ethcall(name = "CLOCK_MODE", abi = "CLOCK_MODE()")]
88    pub struct ClockModeCall;
89    ///Container type for all input parameters for the `clock` function with signature `clock()` and selector `0x91ddadf4`
90    #[derive(
91        Clone,
92        ::ethers_contract::EthCall,
93        ::ethers_contract::EthDisplay,
94        Default,
95        Debug,
96        PartialEq,
97        Eq,
98        Hash
99    )]
100    #[ethcall(name = "clock", abi = "clock()")]
101    pub struct ClockCall;
102    ///Container type for all of the contract's call
103    #[derive(Clone, ::ethers_contract::EthAbiType, Debug, PartialEq, Eq, Hash)]
104    pub enum IERC6372Calls {
105        ClockMode(ClockModeCall),
106        Clock(ClockCall),
107    }
108    impl ::ethers_core::abi::AbiDecode for IERC6372Calls {
109        fn decode(
110            data: impl AsRef<[u8]>,
111        ) -> ::core::result::Result<Self, ::ethers_core::abi::AbiError> {
112            let data = data.as_ref();
113            if let Ok(decoded)
114                = <ClockModeCall as ::ethers_core::abi::AbiDecode>::decode(data) {
115                return Ok(Self::ClockMode(decoded));
116            }
117            if let Ok(decoded)
118                = <ClockCall as ::ethers_core::abi::AbiDecode>::decode(data) {
119                return Ok(Self::Clock(decoded));
120            }
121            Err(::ethers_core::abi::Error::InvalidData.into())
122        }
123    }
124    impl ::ethers_core::abi::AbiEncode for IERC6372Calls {
125        fn encode(self) -> Vec<u8> {
126            match self {
127                Self::ClockMode(element) => {
128                    ::ethers_core::abi::AbiEncode::encode(element)
129                }
130                Self::Clock(element) => ::ethers_core::abi::AbiEncode::encode(element),
131            }
132        }
133    }
134    impl ::core::fmt::Display for IERC6372Calls {
135        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
136            match self {
137                Self::ClockMode(element) => ::core::fmt::Display::fmt(element, f),
138                Self::Clock(element) => ::core::fmt::Display::fmt(element, f),
139            }
140        }
141    }
142    impl ::core::convert::From<ClockModeCall> for IERC6372Calls {
143        fn from(value: ClockModeCall) -> Self {
144            Self::ClockMode(value)
145        }
146    }
147    impl ::core::convert::From<ClockCall> for IERC6372Calls {
148        fn from(value: ClockCall) -> Self {
149            Self::Clock(value)
150        }
151    }
152    ///Container type for all return fields from the `CLOCK_MODE` function with signature `CLOCK_MODE()` and selector `0x4bf5d7e9`
153    #[derive(
154        Clone,
155        ::ethers_contract::EthAbiType,
156        ::ethers_contract::EthAbiCodec,
157        Default,
158        Debug,
159        PartialEq,
160        Eq,
161        Hash
162    )]
163    pub struct ClockModeReturn(pub ::std::string::String);
164    ///Container type for all return fields from the `clock` function with signature `clock()` and selector `0x91ddadf4`
165    #[derive(
166        Clone,
167        ::ethers_contract::EthAbiType,
168        ::ethers_contract::EthAbiCodec,
169        Default,
170        Debug,
171        PartialEq,
172        Eq,
173        Hash
174    )]
175    pub struct ClockReturn(pub u64);
176}