openzeppelin_rs/contracts/
Votes.rs

1pub use votes::*;
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 votes {
13    #[rustfmt::skip]
14    const __ABI: &str = "[{\"inputs\":[],\"type\":\"error\",\"name\":\"InvalidShortString\",\"outputs\":[]},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"str\",\"type\":\"string\",\"components\":[]}],\"type\":\"error\",\"name\":\"StringTooLong\",\"outputs\":[]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"address\",\"name\":\"fromDelegate\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"address\",\"name\":\"toDelegate\",\"type\":\"address\",\"components\":[],\"indexed\":true}],\"type\":\"event\",\"name\":\"DelegateChanged\",\"outputs\":[],\"anonymous\":false},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"uint256\",\"name\":\"previousBalance\",\"type\":\"uint256\",\"components\":[],\"indexed\":false},{\"internalType\":\"uint256\",\"name\":\"newBalance\",\"type\":\"uint256\",\"components\":[],\"indexed\":false}],\"type\":\"event\",\"name\":\"DelegateVotesChanged\",\"outputs\":[],\"anonymous\":false},{\"inputs\":[],\"type\":\"event\",\"name\":\"EIP712DomainChanged\",\"outputs\":[],\"anonymous\":false},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"CLOCK_MODE\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\",\"components\":[]}]},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\",\"components\":[]}]},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"clock\",\"outputs\":[{\"internalType\":\"uint48\",\"name\":\"\",\"type\":\"uint48\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"delegate\",\"outputs\":[]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\",\"components\":[]},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\",\"components\":[]},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\",\"components\":[]},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"delegateBySig\",\"outputs\":[]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"delegates\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\",\"components\":[]}]},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"eip712Domain\",\"outputs\":[{\"internalType\":\"bytes1\",\"name\":\"fields\",\"type\":\"bytes1\",\"components\":[]},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\",\"components\":[]},{\"internalType\":\"string\",\"name\":\"version\",\"type\":\"string\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\",\"components\":[]},{\"internalType\":\"address\",\"name\":\"verifyingContract\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"bytes32\",\"name\":\"salt\",\"type\":\"bytes32\",\"components\":[]},{\"internalType\":\"uint256[]\",\"name\":\"extensions\",\"type\":\"uint256[]\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"getPastTotalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"getPastVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"getVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"nonces\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\",\"components\":[]}]}]";
15    ///The parsed JSON ABI of the contract.
16    pub static VOTES_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 Votes<M>(::ethers_contract::Contract<M>);
19    impl<M> ::core::clone::Clone for Votes<M> {
20        fn clone(&self) -> Self {
21            Self(::core::clone::Clone::clone(&self.0))
22        }
23    }
24    impl<M> ::core::ops::Deref for Votes<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 Votes<M> {
31        fn deref_mut(&mut self) -> &mut Self::Target {
32            &mut self.0
33        }
34    }
35    impl<M> ::core::fmt::Debug for Votes<M> {
36        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
37            f.debug_tuple(stringify!(Votes)).field(&self.address()).finish()
38        }
39    }
40    impl<M: ::ethers_providers::Middleware> Votes<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                    VOTES_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 `DOMAIN_SEPARATOR` (0x3644e515) function
64        pub fn domain_separator(
65            &self,
66        ) -> ::ethers_contract::builders::ContractCall<M, [u8; 32]> {
67            self.0
68                .method_hash([54, 68, 229, 21], ())
69                .expect("method not found (this should never happen)")
70        }
71        ///Calls the contract's `clock` (0x91ddadf4) function
72        pub fn clock(&self) -> ::ethers_contract::builders::ContractCall<M, u64> {
73            self.0
74                .method_hash([145, 221, 173, 244], ())
75                .expect("method not found (this should never happen)")
76        }
77        ///Calls the contract's `delegate` (0x5c19a95c) function
78        pub fn delegate(
79            &self,
80            delegatee: ::ethers_core::types::Address,
81        ) -> ::ethers_contract::builders::ContractCall<M, ()> {
82            self.0
83                .method_hash([92, 25, 169, 92], delegatee)
84                .expect("method not found (this should never happen)")
85        }
86        ///Calls the contract's `delegateBySig` (0xc3cda520) function
87        pub fn delegate_by_sig(
88            &self,
89            delegatee: ::ethers_core::types::Address,
90            nonce: ::ethers_core::types::U256,
91            expiry: ::ethers_core::types::U256,
92            v: u8,
93            r: [u8; 32],
94            s: [u8; 32],
95        ) -> ::ethers_contract::builders::ContractCall<M, ()> {
96            self.0
97                .method_hash([195, 205, 165, 32], (delegatee, nonce, expiry, v, r, s))
98                .expect("method not found (this should never happen)")
99        }
100        ///Calls the contract's `delegates` (0x587cde1e) function
101        pub fn delegates(
102            &self,
103            account: ::ethers_core::types::Address,
104        ) -> ::ethers_contract::builders::ContractCall<
105            M,
106            ::ethers_core::types::Address,
107        > {
108            self.0
109                .method_hash([88, 124, 222, 30], account)
110                .expect("method not found (this should never happen)")
111        }
112        ///Calls the contract's `eip712Domain` (0x84b0196e) function
113        pub fn eip_712_domain(
114            &self,
115        ) -> ::ethers_contract::builders::ContractCall<
116            M,
117            (
118                [u8; 1],
119                ::std::string::String,
120                ::std::string::String,
121                ::ethers_core::types::U256,
122                ::ethers_core::types::Address,
123                [u8; 32],
124                ::std::vec::Vec<::ethers_core::types::U256>,
125            ),
126        > {
127            self.0
128                .method_hash([132, 176, 25, 110], ())
129                .expect("method not found (this should never happen)")
130        }
131        ///Calls the contract's `getPastTotalSupply` (0x8e539e8c) function
132        pub fn get_past_total_supply(
133            &self,
134            timepoint: ::ethers_core::types::U256,
135        ) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
136            self.0
137                .method_hash([142, 83, 158, 140], timepoint)
138                .expect("method not found (this should never happen)")
139        }
140        ///Calls the contract's `getPastVotes` (0x3a46b1a8) function
141        pub fn get_past_votes(
142            &self,
143            account: ::ethers_core::types::Address,
144            timepoint: ::ethers_core::types::U256,
145        ) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
146            self.0
147                .method_hash([58, 70, 177, 168], (account, timepoint))
148                .expect("method not found (this should never happen)")
149        }
150        ///Calls the contract's `getVotes` (0x9ab24eb0) function
151        pub fn get_votes(
152            &self,
153            account: ::ethers_core::types::Address,
154        ) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
155            self.0
156                .method_hash([154, 178, 78, 176], account)
157                .expect("method not found (this should never happen)")
158        }
159        ///Calls the contract's `nonces` (0x7ecebe00) function
160        pub fn nonces(
161            &self,
162            owner: ::ethers_core::types::Address,
163        ) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
164            self.0
165                .method_hash([126, 206, 190, 0], owner)
166                .expect("method not found (this should never happen)")
167        }
168        ///Gets the contract's `DelegateChanged` event
169        pub fn delegate_changed_filter(
170            &self,
171        ) -> ::ethers_contract::builders::Event<
172            ::std::sync::Arc<M>,
173            M,
174            DelegateChangedFilter,
175        > {
176            self.0.event()
177        }
178        ///Gets the contract's `DelegateVotesChanged` event
179        pub fn delegate_votes_changed_filter(
180            &self,
181        ) -> ::ethers_contract::builders::Event<
182            ::std::sync::Arc<M>,
183            M,
184            DelegateVotesChangedFilter,
185        > {
186            self.0.event()
187        }
188        ///Gets the contract's `EIP712DomainChanged` event
189        pub fn eip712_domain_changed_filter(
190            &self,
191        ) -> ::ethers_contract::builders::Event<
192            ::std::sync::Arc<M>,
193            M,
194            Eip712DomainChangedFilter,
195        > {
196            self.0.event()
197        }
198        /// Returns an `Event` builder for all the events of this contract.
199        pub fn events(
200            &self,
201        ) -> ::ethers_contract::builders::Event<::std::sync::Arc<M>, M, VotesEvents> {
202            self.0.event_with_filter(::core::default::Default::default())
203        }
204    }
205    impl<M: ::ethers_providers::Middleware> From<::ethers_contract::Contract<M>>
206    for Votes<M> {
207        fn from(contract: ::ethers_contract::Contract<M>) -> Self {
208            Self::new(contract.address(), contract.client())
209        }
210    }
211    ///Custom Error type `InvalidShortString` with signature `InvalidShortString()` and selector `0xb3512b0c`
212    #[derive(
213        Clone,
214        ::ethers_contract::EthError,
215        ::ethers_contract::EthDisplay,
216        Default,
217        Debug,
218        PartialEq,
219        Eq,
220        Hash
221    )]
222    #[etherror(name = "InvalidShortString", abi = "InvalidShortString()")]
223    pub struct InvalidShortString;
224    ///Custom Error type `StringTooLong` with signature `StringTooLong(string)` and selector `0x305a27a9`
225    #[derive(
226        Clone,
227        ::ethers_contract::EthError,
228        ::ethers_contract::EthDisplay,
229        Default,
230        Debug,
231        PartialEq,
232        Eq,
233        Hash
234    )]
235    #[etherror(name = "StringTooLong", abi = "StringTooLong(string)")]
236    pub struct StringTooLong {
237        pub str: ::std::string::String,
238    }
239    ///Container type for all of the contract's custom errors
240    #[derive(Clone, ::ethers_contract::EthAbiType, Debug, PartialEq, Eq, Hash)]
241    pub enum VotesErrors {
242        InvalidShortString(InvalidShortString),
243        StringTooLong(StringTooLong),
244        /// The standard solidity revert string, with selector
245        /// Error(string) -- 0x08c379a0
246        RevertString(::std::string::String),
247    }
248    impl ::ethers_core::abi::AbiDecode for VotesErrors {
249        fn decode(
250            data: impl AsRef<[u8]>,
251        ) -> ::core::result::Result<Self, ::ethers_core::abi::AbiError> {
252            let data = data.as_ref();
253            if let Ok(decoded)
254                = <::std::string::String as ::ethers_core::abi::AbiDecode>::decode(
255                    data,
256                ) {
257                return Ok(Self::RevertString(decoded));
258            }
259            if let Ok(decoded)
260                = <InvalidShortString as ::ethers_core::abi::AbiDecode>::decode(data) {
261                return Ok(Self::InvalidShortString(decoded));
262            }
263            if let Ok(decoded)
264                = <StringTooLong as ::ethers_core::abi::AbiDecode>::decode(data) {
265                return Ok(Self::StringTooLong(decoded));
266            }
267            Err(::ethers_core::abi::Error::InvalidData.into())
268        }
269    }
270    impl ::ethers_core::abi::AbiEncode for VotesErrors {
271        fn encode(self) -> ::std::vec::Vec<u8> {
272            match self {
273                Self::InvalidShortString(element) => {
274                    ::ethers_core::abi::AbiEncode::encode(element)
275                }
276                Self::StringTooLong(element) => {
277                    ::ethers_core::abi::AbiEncode::encode(element)
278                }
279                Self::RevertString(s) => ::ethers_core::abi::AbiEncode::encode(s),
280            }
281        }
282    }
283    impl ::ethers_contract::ContractRevert for VotesErrors {
284        fn valid_selector(selector: [u8; 4]) -> bool {
285            match selector {
286                [0x08, 0xc3, 0x79, 0xa0] => true,
287                _ if selector
288                    == <InvalidShortString as ::ethers_contract::EthError>::selector() => {
289                    true
290                }
291                _ if selector
292                    == <StringTooLong as ::ethers_contract::EthError>::selector() => true,
293                _ => false,
294            }
295        }
296    }
297    impl ::core::fmt::Display for VotesErrors {
298        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
299            match self {
300                Self::InvalidShortString(element) => {
301                    ::core::fmt::Display::fmt(element, f)
302                }
303                Self::StringTooLong(element) => ::core::fmt::Display::fmt(element, f),
304                Self::RevertString(s) => ::core::fmt::Display::fmt(s, f),
305            }
306        }
307    }
308    impl ::core::convert::From<::std::string::String> for VotesErrors {
309        fn from(value: String) -> Self {
310            Self::RevertString(value)
311        }
312    }
313    impl ::core::convert::From<InvalidShortString> for VotesErrors {
314        fn from(value: InvalidShortString) -> Self {
315            Self::InvalidShortString(value)
316        }
317    }
318    impl ::core::convert::From<StringTooLong> for VotesErrors {
319        fn from(value: StringTooLong) -> Self {
320            Self::StringTooLong(value)
321        }
322    }
323    #[derive(
324        Clone,
325        ::ethers_contract::EthEvent,
326        ::ethers_contract::EthDisplay,
327        Default,
328        Debug,
329        PartialEq,
330        Eq,
331        Hash
332    )]
333    #[ethevent(
334        name = "DelegateChanged",
335        abi = "DelegateChanged(address,address,address)"
336    )]
337    pub struct DelegateChangedFilter {
338        #[ethevent(indexed)]
339        pub delegator: ::ethers_core::types::Address,
340        #[ethevent(indexed)]
341        pub from_delegate: ::ethers_core::types::Address,
342        #[ethevent(indexed)]
343        pub to_delegate: ::ethers_core::types::Address,
344    }
345    #[derive(
346        Clone,
347        ::ethers_contract::EthEvent,
348        ::ethers_contract::EthDisplay,
349        Default,
350        Debug,
351        PartialEq,
352        Eq,
353        Hash
354    )]
355    #[ethevent(
356        name = "DelegateVotesChanged",
357        abi = "DelegateVotesChanged(address,uint256,uint256)"
358    )]
359    pub struct DelegateVotesChangedFilter {
360        #[ethevent(indexed)]
361        pub delegate: ::ethers_core::types::Address,
362        pub previous_balance: ::ethers_core::types::U256,
363        pub new_balance: ::ethers_core::types::U256,
364    }
365    #[derive(
366        Clone,
367        ::ethers_contract::EthEvent,
368        ::ethers_contract::EthDisplay,
369        Default,
370        Debug,
371        PartialEq,
372        Eq,
373        Hash
374    )]
375    #[ethevent(name = "EIP712DomainChanged", abi = "EIP712DomainChanged()")]
376    pub struct Eip712DomainChangedFilter;
377    ///Container type for all of the contract's events
378    #[derive(Clone, ::ethers_contract::EthAbiType, Debug, PartialEq, Eq, Hash)]
379    pub enum VotesEvents {
380        DelegateChangedFilter(DelegateChangedFilter),
381        DelegateVotesChangedFilter(DelegateVotesChangedFilter),
382        Eip712DomainChangedFilter(Eip712DomainChangedFilter),
383    }
384    impl ::ethers_contract::EthLogDecode for VotesEvents {
385        fn decode_log(
386            log: &::ethers_core::abi::RawLog,
387        ) -> ::core::result::Result<Self, ::ethers_core::abi::Error> {
388            if let Ok(decoded) = DelegateChangedFilter::decode_log(log) {
389                return Ok(VotesEvents::DelegateChangedFilter(decoded));
390            }
391            if let Ok(decoded) = DelegateVotesChangedFilter::decode_log(log) {
392                return Ok(VotesEvents::DelegateVotesChangedFilter(decoded));
393            }
394            if let Ok(decoded) = Eip712DomainChangedFilter::decode_log(log) {
395                return Ok(VotesEvents::Eip712DomainChangedFilter(decoded));
396            }
397            Err(::ethers_core::abi::Error::InvalidData)
398        }
399    }
400    impl ::core::fmt::Display for VotesEvents {
401        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
402            match self {
403                Self::DelegateChangedFilter(element) => {
404                    ::core::fmt::Display::fmt(element, f)
405                }
406                Self::DelegateVotesChangedFilter(element) => {
407                    ::core::fmt::Display::fmt(element, f)
408                }
409                Self::Eip712DomainChangedFilter(element) => {
410                    ::core::fmt::Display::fmt(element, f)
411                }
412            }
413        }
414    }
415    impl ::core::convert::From<DelegateChangedFilter> for VotesEvents {
416        fn from(value: DelegateChangedFilter) -> Self {
417            Self::DelegateChangedFilter(value)
418        }
419    }
420    impl ::core::convert::From<DelegateVotesChangedFilter> for VotesEvents {
421        fn from(value: DelegateVotesChangedFilter) -> Self {
422            Self::DelegateVotesChangedFilter(value)
423        }
424    }
425    impl ::core::convert::From<Eip712DomainChangedFilter> for VotesEvents {
426        fn from(value: Eip712DomainChangedFilter) -> Self {
427            Self::Eip712DomainChangedFilter(value)
428        }
429    }
430    ///Container type for all input parameters for the `CLOCK_MODE` function with signature `CLOCK_MODE()` and selector `0x4bf5d7e9`
431    #[derive(
432        Clone,
433        ::ethers_contract::EthCall,
434        ::ethers_contract::EthDisplay,
435        Default,
436        Debug,
437        PartialEq,
438        Eq,
439        Hash
440    )]
441    #[ethcall(name = "CLOCK_MODE", abi = "CLOCK_MODE()")]
442    pub struct ClockModeCall;
443    ///Container type for all input parameters for the `DOMAIN_SEPARATOR` function with signature `DOMAIN_SEPARATOR()` and selector `0x3644e515`
444    #[derive(
445        Clone,
446        ::ethers_contract::EthCall,
447        ::ethers_contract::EthDisplay,
448        Default,
449        Debug,
450        PartialEq,
451        Eq,
452        Hash
453    )]
454    #[ethcall(name = "DOMAIN_SEPARATOR", abi = "DOMAIN_SEPARATOR()")]
455    pub struct DomainSeparatorCall;
456    ///Container type for all input parameters for the `clock` function with signature `clock()` and selector `0x91ddadf4`
457    #[derive(
458        Clone,
459        ::ethers_contract::EthCall,
460        ::ethers_contract::EthDisplay,
461        Default,
462        Debug,
463        PartialEq,
464        Eq,
465        Hash
466    )]
467    #[ethcall(name = "clock", abi = "clock()")]
468    pub struct ClockCall;
469    ///Container type for all input parameters for the `delegate` function with signature `delegate(address)` and selector `0x5c19a95c`
470    #[derive(
471        Clone,
472        ::ethers_contract::EthCall,
473        ::ethers_contract::EthDisplay,
474        Default,
475        Debug,
476        PartialEq,
477        Eq,
478        Hash
479    )]
480    #[ethcall(name = "delegate", abi = "delegate(address)")]
481    pub struct DelegateCall {
482        pub delegatee: ::ethers_core::types::Address,
483    }
484    ///Container type for all input parameters for the `delegateBySig` function with signature `delegateBySig(address,uint256,uint256,uint8,bytes32,bytes32)` and selector `0xc3cda520`
485    #[derive(
486        Clone,
487        ::ethers_contract::EthCall,
488        ::ethers_contract::EthDisplay,
489        Default,
490        Debug,
491        PartialEq,
492        Eq,
493        Hash
494    )]
495    #[ethcall(
496        name = "delegateBySig",
497        abi = "delegateBySig(address,uint256,uint256,uint8,bytes32,bytes32)"
498    )]
499    pub struct DelegateBySigCall {
500        pub delegatee: ::ethers_core::types::Address,
501        pub nonce: ::ethers_core::types::U256,
502        pub expiry: ::ethers_core::types::U256,
503        pub v: u8,
504        pub r: [u8; 32],
505        pub s: [u8; 32],
506    }
507    ///Container type for all input parameters for the `delegates` function with signature `delegates(address)` and selector `0x587cde1e`
508    #[derive(
509        Clone,
510        ::ethers_contract::EthCall,
511        ::ethers_contract::EthDisplay,
512        Default,
513        Debug,
514        PartialEq,
515        Eq,
516        Hash
517    )]
518    #[ethcall(name = "delegates", abi = "delegates(address)")]
519    pub struct DelegatesCall {
520        pub account: ::ethers_core::types::Address,
521    }
522    ///Container type for all input parameters for the `eip712Domain` function with signature `eip712Domain()` and selector `0x84b0196e`
523    #[derive(
524        Clone,
525        ::ethers_contract::EthCall,
526        ::ethers_contract::EthDisplay,
527        Default,
528        Debug,
529        PartialEq,
530        Eq,
531        Hash
532    )]
533    #[ethcall(name = "eip712Domain", abi = "eip712Domain()")]
534    pub struct Eip712DomainCall;
535    ///Container type for all input parameters for the `getPastTotalSupply` function with signature `getPastTotalSupply(uint256)` and selector `0x8e539e8c`
536    #[derive(
537        Clone,
538        ::ethers_contract::EthCall,
539        ::ethers_contract::EthDisplay,
540        Default,
541        Debug,
542        PartialEq,
543        Eq,
544        Hash
545    )]
546    #[ethcall(name = "getPastTotalSupply", abi = "getPastTotalSupply(uint256)")]
547    pub struct GetPastTotalSupplyCall {
548        pub timepoint: ::ethers_core::types::U256,
549    }
550    ///Container type for all input parameters for the `getPastVotes` function with signature `getPastVotes(address,uint256)` and selector `0x3a46b1a8`
551    #[derive(
552        Clone,
553        ::ethers_contract::EthCall,
554        ::ethers_contract::EthDisplay,
555        Default,
556        Debug,
557        PartialEq,
558        Eq,
559        Hash
560    )]
561    #[ethcall(name = "getPastVotes", abi = "getPastVotes(address,uint256)")]
562    pub struct GetPastVotesCall {
563        pub account: ::ethers_core::types::Address,
564        pub timepoint: ::ethers_core::types::U256,
565    }
566    ///Container type for all input parameters for the `getVotes` function with signature `getVotes(address)` and selector `0x9ab24eb0`
567    #[derive(
568        Clone,
569        ::ethers_contract::EthCall,
570        ::ethers_contract::EthDisplay,
571        Default,
572        Debug,
573        PartialEq,
574        Eq,
575        Hash
576    )]
577    #[ethcall(name = "getVotes", abi = "getVotes(address)")]
578    pub struct GetVotesCall {
579        pub account: ::ethers_core::types::Address,
580    }
581    ///Container type for all input parameters for the `nonces` function with signature `nonces(address)` and selector `0x7ecebe00`
582    #[derive(
583        Clone,
584        ::ethers_contract::EthCall,
585        ::ethers_contract::EthDisplay,
586        Default,
587        Debug,
588        PartialEq,
589        Eq,
590        Hash
591    )]
592    #[ethcall(name = "nonces", abi = "nonces(address)")]
593    pub struct NoncesCall {
594        pub owner: ::ethers_core::types::Address,
595    }
596    ///Container type for all of the contract's call
597    #[derive(Clone, ::ethers_contract::EthAbiType, Debug, PartialEq, Eq, Hash)]
598    pub enum VotesCalls {
599        ClockMode(ClockModeCall),
600        DomainSeparator(DomainSeparatorCall),
601        Clock(ClockCall),
602        Delegate(DelegateCall),
603        DelegateBySig(DelegateBySigCall),
604        Delegates(DelegatesCall),
605        Eip712Domain(Eip712DomainCall),
606        GetPastTotalSupply(GetPastTotalSupplyCall),
607        GetPastVotes(GetPastVotesCall),
608        GetVotes(GetVotesCall),
609        Nonces(NoncesCall),
610    }
611    impl ::ethers_core::abi::AbiDecode for VotesCalls {
612        fn decode(
613            data: impl AsRef<[u8]>,
614        ) -> ::core::result::Result<Self, ::ethers_core::abi::AbiError> {
615            let data = data.as_ref();
616            if let Ok(decoded)
617                = <ClockModeCall as ::ethers_core::abi::AbiDecode>::decode(data) {
618                return Ok(Self::ClockMode(decoded));
619            }
620            if let Ok(decoded)
621                = <DomainSeparatorCall as ::ethers_core::abi::AbiDecode>::decode(data) {
622                return Ok(Self::DomainSeparator(decoded));
623            }
624            if let Ok(decoded)
625                = <ClockCall as ::ethers_core::abi::AbiDecode>::decode(data) {
626                return Ok(Self::Clock(decoded));
627            }
628            if let Ok(decoded)
629                = <DelegateCall as ::ethers_core::abi::AbiDecode>::decode(data) {
630                return Ok(Self::Delegate(decoded));
631            }
632            if let Ok(decoded)
633                = <DelegateBySigCall as ::ethers_core::abi::AbiDecode>::decode(data) {
634                return Ok(Self::DelegateBySig(decoded));
635            }
636            if let Ok(decoded)
637                = <DelegatesCall as ::ethers_core::abi::AbiDecode>::decode(data) {
638                return Ok(Self::Delegates(decoded));
639            }
640            if let Ok(decoded)
641                = <Eip712DomainCall as ::ethers_core::abi::AbiDecode>::decode(data) {
642                return Ok(Self::Eip712Domain(decoded));
643            }
644            if let Ok(decoded)
645                = <GetPastTotalSupplyCall as ::ethers_core::abi::AbiDecode>::decode(
646                    data,
647                ) {
648                return Ok(Self::GetPastTotalSupply(decoded));
649            }
650            if let Ok(decoded)
651                = <GetPastVotesCall as ::ethers_core::abi::AbiDecode>::decode(data) {
652                return Ok(Self::GetPastVotes(decoded));
653            }
654            if let Ok(decoded)
655                = <GetVotesCall as ::ethers_core::abi::AbiDecode>::decode(data) {
656                return Ok(Self::GetVotes(decoded));
657            }
658            if let Ok(decoded)
659                = <NoncesCall as ::ethers_core::abi::AbiDecode>::decode(data) {
660                return Ok(Self::Nonces(decoded));
661            }
662            Err(::ethers_core::abi::Error::InvalidData.into())
663        }
664    }
665    impl ::ethers_core::abi::AbiEncode for VotesCalls {
666        fn encode(self) -> Vec<u8> {
667            match self {
668                Self::ClockMode(element) => {
669                    ::ethers_core::abi::AbiEncode::encode(element)
670                }
671                Self::DomainSeparator(element) => {
672                    ::ethers_core::abi::AbiEncode::encode(element)
673                }
674                Self::Clock(element) => ::ethers_core::abi::AbiEncode::encode(element),
675                Self::Delegate(element) => ::ethers_core::abi::AbiEncode::encode(element),
676                Self::DelegateBySig(element) => {
677                    ::ethers_core::abi::AbiEncode::encode(element)
678                }
679                Self::Delegates(element) => {
680                    ::ethers_core::abi::AbiEncode::encode(element)
681                }
682                Self::Eip712Domain(element) => {
683                    ::ethers_core::abi::AbiEncode::encode(element)
684                }
685                Self::GetPastTotalSupply(element) => {
686                    ::ethers_core::abi::AbiEncode::encode(element)
687                }
688                Self::GetPastVotes(element) => {
689                    ::ethers_core::abi::AbiEncode::encode(element)
690                }
691                Self::GetVotes(element) => ::ethers_core::abi::AbiEncode::encode(element),
692                Self::Nonces(element) => ::ethers_core::abi::AbiEncode::encode(element),
693            }
694        }
695    }
696    impl ::core::fmt::Display for VotesCalls {
697        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
698            match self {
699                Self::ClockMode(element) => ::core::fmt::Display::fmt(element, f),
700                Self::DomainSeparator(element) => ::core::fmt::Display::fmt(element, f),
701                Self::Clock(element) => ::core::fmt::Display::fmt(element, f),
702                Self::Delegate(element) => ::core::fmt::Display::fmt(element, f),
703                Self::DelegateBySig(element) => ::core::fmt::Display::fmt(element, f),
704                Self::Delegates(element) => ::core::fmt::Display::fmt(element, f),
705                Self::Eip712Domain(element) => ::core::fmt::Display::fmt(element, f),
706                Self::GetPastTotalSupply(element) => {
707                    ::core::fmt::Display::fmt(element, f)
708                }
709                Self::GetPastVotes(element) => ::core::fmt::Display::fmt(element, f),
710                Self::GetVotes(element) => ::core::fmt::Display::fmt(element, f),
711                Self::Nonces(element) => ::core::fmt::Display::fmt(element, f),
712            }
713        }
714    }
715    impl ::core::convert::From<ClockModeCall> for VotesCalls {
716        fn from(value: ClockModeCall) -> Self {
717            Self::ClockMode(value)
718        }
719    }
720    impl ::core::convert::From<DomainSeparatorCall> for VotesCalls {
721        fn from(value: DomainSeparatorCall) -> Self {
722            Self::DomainSeparator(value)
723        }
724    }
725    impl ::core::convert::From<ClockCall> for VotesCalls {
726        fn from(value: ClockCall) -> Self {
727            Self::Clock(value)
728        }
729    }
730    impl ::core::convert::From<DelegateCall> for VotesCalls {
731        fn from(value: DelegateCall) -> Self {
732            Self::Delegate(value)
733        }
734    }
735    impl ::core::convert::From<DelegateBySigCall> for VotesCalls {
736        fn from(value: DelegateBySigCall) -> Self {
737            Self::DelegateBySig(value)
738        }
739    }
740    impl ::core::convert::From<DelegatesCall> for VotesCalls {
741        fn from(value: DelegatesCall) -> Self {
742            Self::Delegates(value)
743        }
744    }
745    impl ::core::convert::From<Eip712DomainCall> for VotesCalls {
746        fn from(value: Eip712DomainCall) -> Self {
747            Self::Eip712Domain(value)
748        }
749    }
750    impl ::core::convert::From<GetPastTotalSupplyCall> for VotesCalls {
751        fn from(value: GetPastTotalSupplyCall) -> Self {
752            Self::GetPastTotalSupply(value)
753        }
754    }
755    impl ::core::convert::From<GetPastVotesCall> for VotesCalls {
756        fn from(value: GetPastVotesCall) -> Self {
757            Self::GetPastVotes(value)
758        }
759    }
760    impl ::core::convert::From<GetVotesCall> for VotesCalls {
761        fn from(value: GetVotesCall) -> Self {
762            Self::GetVotes(value)
763        }
764    }
765    impl ::core::convert::From<NoncesCall> for VotesCalls {
766        fn from(value: NoncesCall) -> Self {
767            Self::Nonces(value)
768        }
769    }
770    ///Container type for all return fields from the `CLOCK_MODE` function with signature `CLOCK_MODE()` and selector `0x4bf5d7e9`
771    #[derive(
772        Clone,
773        ::ethers_contract::EthAbiType,
774        ::ethers_contract::EthAbiCodec,
775        Default,
776        Debug,
777        PartialEq,
778        Eq,
779        Hash
780    )]
781    pub struct ClockModeReturn(pub ::std::string::String);
782    ///Container type for all return fields from the `DOMAIN_SEPARATOR` function with signature `DOMAIN_SEPARATOR()` and selector `0x3644e515`
783    #[derive(
784        Clone,
785        ::ethers_contract::EthAbiType,
786        ::ethers_contract::EthAbiCodec,
787        Default,
788        Debug,
789        PartialEq,
790        Eq,
791        Hash
792    )]
793    pub struct DomainSeparatorReturn(pub [u8; 32]);
794    ///Container type for all return fields from the `clock` function with signature `clock()` and selector `0x91ddadf4`
795    #[derive(
796        Clone,
797        ::ethers_contract::EthAbiType,
798        ::ethers_contract::EthAbiCodec,
799        Default,
800        Debug,
801        PartialEq,
802        Eq,
803        Hash
804    )]
805    pub struct ClockReturn(pub u64);
806    ///Container type for all return fields from the `delegates` function with signature `delegates(address)` and selector `0x587cde1e`
807    #[derive(
808        Clone,
809        ::ethers_contract::EthAbiType,
810        ::ethers_contract::EthAbiCodec,
811        Default,
812        Debug,
813        PartialEq,
814        Eq,
815        Hash
816    )]
817    pub struct DelegatesReturn(pub ::ethers_core::types::Address);
818    ///Container type for all return fields from the `eip712Domain` function with signature `eip712Domain()` and selector `0x84b0196e`
819    #[derive(
820        Clone,
821        ::ethers_contract::EthAbiType,
822        ::ethers_contract::EthAbiCodec,
823        Default,
824        Debug,
825        PartialEq,
826        Eq,
827        Hash
828    )]
829    pub struct Eip712DomainReturn {
830        pub fields: [u8; 1],
831        pub name: ::std::string::String,
832        pub version: ::std::string::String,
833        pub chain_id: ::ethers_core::types::U256,
834        pub verifying_contract: ::ethers_core::types::Address,
835        pub salt: [u8; 32],
836        pub extensions: ::std::vec::Vec<::ethers_core::types::U256>,
837    }
838    ///Container type for all return fields from the `getPastTotalSupply` function with signature `getPastTotalSupply(uint256)` and selector `0x8e539e8c`
839    #[derive(
840        Clone,
841        ::ethers_contract::EthAbiType,
842        ::ethers_contract::EthAbiCodec,
843        Default,
844        Debug,
845        PartialEq,
846        Eq,
847        Hash
848    )]
849    pub struct GetPastTotalSupplyReturn(pub ::ethers_core::types::U256);
850    ///Container type for all return fields from the `getPastVotes` function with signature `getPastVotes(address,uint256)` and selector `0x3a46b1a8`
851    #[derive(
852        Clone,
853        ::ethers_contract::EthAbiType,
854        ::ethers_contract::EthAbiCodec,
855        Default,
856        Debug,
857        PartialEq,
858        Eq,
859        Hash
860    )]
861    pub struct GetPastVotesReturn(pub ::ethers_core::types::U256);
862    ///Container type for all return fields from the `getVotes` function with signature `getVotes(address)` and selector `0x9ab24eb0`
863    #[derive(
864        Clone,
865        ::ethers_contract::EthAbiType,
866        ::ethers_contract::EthAbiCodec,
867        Default,
868        Debug,
869        PartialEq,
870        Eq,
871        Hash
872    )]
873    pub struct GetVotesReturn(pub ::ethers_core::types::U256);
874    ///Container type for all return fields from the `nonces` function with signature `nonces(address)` and selector `0x7ecebe00`
875    #[derive(
876        Clone,
877        ::ethers_contract::EthAbiType,
878        ::ethers_contract::EthAbiCodec,
879        Default,
880        Debug,
881        PartialEq,
882        Eq,
883        Hash
884    )]
885    pub struct NoncesReturn(pub ::ethers_core::types::U256);
886}