1pub use erc20_votes::*;
2#[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 erc20_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\":\"owner\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\",\"components\":[],\"indexed\":false}],\"type\":\"event\",\"name\":\"Approval\",\"outputs\":[],\"anonymous\":false},{\"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\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\",\"components\":[],\"indexed\":false}],\"type\":\"event\",\"name\":\"Transfer\",\"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\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint32\",\"name\":\"pos\",\"type\":\"uint32\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"checkpoints\",\"outputs\":[{\"internalType\":\"struct ERC20Votes.Checkpoint\",\"name\":\"\",\"type\":\"tuple\",\"components\":[{\"internalType\":\"uint32\",\"name\":\"fromBlock\",\"type\":\"uint32\",\"components\":[]},{\"internalType\":\"uint224\",\"name\":\"votes\",\"type\":\"uint224\",\"components\":[]}]}]},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"clock\",\"outputs\":[{\"internalType\":\"uint48\",\"name\":\"\",\"type\":\"uint48\",\"components\":[]}]},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\",\"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\":\"spender\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\",\"components\":[]}]},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"nonces\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"numCheckpoints\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"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\":\"permit\",\"outputs\":[]},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\",\"components\":[]}]},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\",\"components\":[]}]}]";
15 pub static ERC20VOTES_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 ERC20Votes<M>(::ethers_contract::Contract<M>);
19 impl<M> ::core::clone::Clone for ERC20Votes<M> {
20 fn clone(&self) -> Self {
21 Self(::core::clone::Clone::clone(&self.0))
22 }
23 }
24 impl<M> ::core::ops::Deref for ERC20Votes<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 ERC20Votes<M> {
31 fn deref_mut(&mut self) -> &mut Self::Target {
32 &mut self.0
33 }
34 }
35 impl<M> ::core::fmt::Debug for ERC20Votes<M> {
36 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
37 f.debug_tuple(stringify!(ERC20Votes)).field(&self.address()).finish()
38 }
39 }
40 impl<M: ::ethers_providers::Middleware> ERC20Votes<M> {
41 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 ERC20VOTES_ABI.clone(),
51 client,
52 ),
53 )
54 }
55 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 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 pub fn allowance(
73 &self,
74 owner: ::ethers_core::types::Address,
75 spender: ::ethers_core::types::Address,
76 ) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
77 self.0
78 .method_hash([221, 98, 237, 62], (owner, spender))
79 .expect("method not found (this should never happen)")
80 }
81 pub fn approve(
83 &self,
84 spender: ::ethers_core::types::Address,
85 amount: ::ethers_core::types::U256,
86 ) -> ::ethers_contract::builders::ContractCall<M, bool> {
87 self.0
88 .method_hash([9, 94, 167, 179], (spender, amount))
89 .expect("method not found (this should never happen)")
90 }
91 pub fn balance_of(
93 &self,
94 account: ::ethers_core::types::Address,
95 ) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
96 self.0
97 .method_hash([112, 160, 130, 49], account)
98 .expect("method not found (this should never happen)")
99 }
100 pub fn checkpoints(
102 &self,
103 account: ::ethers_core::types::Address,
104 pos: u32,
105 ) -> ::ethers_contract::builders::ContractCall<M, Checkpoint> {
106 self.0
107 .method_hash([241, 18, 126, 216], (account, pos))
108 .expect("method not found (this should never happen)")
109 }
110 pub fn clock(&self) -> ::ethers_contract::builders::ContractCall<M, u64> {
112 self.0
113 .method_hash([145, 221, 173, 244], ())
114 .expect("method not found (this should never happen)")
115 }
116 pub fn decimals(&self) -> ::ethers_contract::builders::ContractCall<M, u8> {
118 self.0
119 .method_hash([49, 60, 229, 103], ())
120 .expect("method not found (this should never happen)")
121 }
122 pub fn decrease_allowance(
124 &self,
125 spender: ::ethers_core::types::Address,
126 subtracted_value: ::ethers_core::types::U256,
127 ) -> ::ethers_contract::builders::ContractCall<M, bool> {
128 self.0
129 .method_hash([164, 87, 194, 215], (spender, subtracted_value))
130 .expect("method not found (this should never happen)")
131 }
132 pub fn delegate(
134 &self,
135 delegatee: ::ethers_core::types::Address,
136 ) -> ::ethers_contract::builders::ContractCall<M, ()> {
137 self.0
138 .method_hash([92, 25, 169, 92], delegatee)
139 .expect("method not found (this should never happen)")
140 }
141 pub fn delegate_by_sig(
143 &self,
144 delegatee: ::ethers_core::types::Address,
145 nonce: ::ethers_core::types::U256,
146 expiry: ::ethers_core::types::U256,
147 v: u8,
148 r: [u8; 32],
149 s: [u8; 32],
150 ) -> ::ethers_contract::builders::ContractCall<M, ()> {
151 self.0
152 .method_hash([195, 205, 165, 32], (delegatee, nonce, expiry, v, r, s))
153 .expect("method not found (this should never happen)")
154 }
155 pub fn delegates(
157 &self,
158 account: ::ethers_core::types::Address,
159 ) -> ::ethers_contract::builders::ContractCall<
160 M,
161 ::ethers_core::types::Address,
162 > {
163 self.0
164 .method_hash([88, 124, 222, 30], account)
165 .expect("method not found (this should never happen)")
166 }
167 pub fn eip_712_domain(
169 &self,
170 ) -> ::ethers_contract::builders::ContractCall<
171 M,
172 (
173 [u8; 1],
174 ::std::string::String,
175 ::std::string::String,
176 ::ethers_core::types::U256,
177 ::ethers_core::types::Address,
178 [u8; 32],
179 ::std::vec::Vec<::ethers_core::types::U256>,
180 ),
181 > {
182 self.0
183 .method_hash([132, 176, 25, 110], ())
184 .expect("method not found (this should never happen)")
185 }
186 pub fn get_past_total_supply(
188 &self,
189 timepoint: ::ethers_core::types::U256,
190 ) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
191 self.0
192 .method_hash([142, 83, 158, 140], timepoint)
193 .expect("method not found (this should never happen)")
194 }
195 pub fn get_past_votes(
197 &self,
198 account: ::ethers_core::types::Address,
199 timepoint: ::ethers_core::types::U256,
200 ) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
201 self.0
202 .method_hash([58, 70, 177, 168], (account, timepoint))
203 .expect("method not found (this should never happen)")
204 }
205 pub fn get_votes(
207 &self,
208 account: ::ethers_core::types::Address,
209 ) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
210 self.0
211 .method_hash([154, 178, 78, 176], account)
212 .expect("method not found (this should never happen)")
213 }
214 pub fn increase_allowance(
216 &self,
217 spender: ::ethers_core::types::Address,
218 added_value: ::ethers_core::types::U256,
219 ) -> ::ethers_contract::builders::ContractCall<M, bool> {
220 self.0
221 .method_hash([57, 80, 147, 81], (spender, added_value))
222 .expect("method not found (this should never happen)")
223 }
224 pub fn name(
226 &self,
227 ) -> ::ethers_contract::builders::ContractCall<M, ::std::string::String> {
228 self.0
229 .method_hash([6, 253, 222, 3], ())
230 .expect("method not found (this should never happen)")
231 }
232 pub fn nonces(
234 &self,
235 owner: ::ethers_core::types::Address,
236 ) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
237 self.0
238 .method_hash([126, 206, 190, 0], owner)
239 .expect("method not found (this should never happen)")
240 }
241 pub fn num_checkpoints(
243 &self,
244 account: ::ethers_core::types::Address,
245 ) -> ::ethers_contract::builders::ContractCall<M, u32> {
246 self.0
247 .method_hash([111, 207, 255, 69], account)
248 .expect("method not found (this should never happen)")
249 }
250 pub fn permit(
252 &self,
253 owner: ::ethers_core::types::Address,
254 spender: ::ethers_core::types::Address,
255 value: ::ethers_core::types::U256,
256 deadline: ::ethers_core::types::U256,
257 v: u8,
258 r: [u8; 32],
259 s: [u8; 32],
260 ) -> ::ethers_contract::builders::ContractCall<M, ()> {
261 self.0
262 .method_hash(
263 [213, 5, 172, 207],
264 (owner, spender, value, deadline, v, r, s),
265 )
266 .expect("method not found (this should never happen)")
267 }
268 pub fn symbol(
270 &self,
271 ) -> ::ethers_contract::builders::ContractCall<M, ::std::string::String> {
272 self.0
273 .method_hash([149, 216, 155, 65], ())
274 .expect("method not found (this should never happen)")
275 }
276 pub fn total_supply(
278 &self,
279 ) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
280 self.0
281 .method_hash([24, 22, 13, 221], ())
282 .expect("method not found (this should never happen)")
283 }
284 pub fn transfer(
286 &self,
287 to: ::ethers_core::types::Address,
288 amount: ::ethers_core::types::U256,
289 ) -> ::ethers_contract::builders::ContractCall<M, bool> {
290 self.0
291 .method_hash([169, 5, 156, 187], (to, amount))
292 .expect("method not found (this should never happen)")
293 }
294 pub fn transfer_from(
296 &self,
297 from: ::ethers_core::types::Address,
298 to: ::ethers_core::types::Address,
299 amount: ::ethers_core::types::U256,
300 ) -> ::ethers_contract::builders::ContractCall<M, bool> {
301 self.0
302 .method_hash([35, 184, 114, 221], (from, to, amount))
303 .expect("method not found (this should never happen)")
304 }
305 pub fn approval_filter(
307 &self,
308 ) -> ::ethers_contract::builders::Event<::std::sync::Arc<M>, M, ApprovalFilter> {
309 self.0.event()
310 }
311 pub fn delegate_changed_filter(
313 &self,
314 ) -> ::ethers_contract::builders::Event<
315 ::std::sync::Arc<M>,
316 M,
317 DelegateChangedFilter,
318 > {
319 self.0.event()
320 }
321 pub fn delegate_votes_changed_filter(
323 &self,
324 ) -> ::ethers_contract::builders::Event<
325 ::std::sync::Arc<M>,
326 M,
327 DelegateVotesChangedFilter,
328 > {
329 self.0.event()
330 }
331 pub fn eip712_domain_changed_filter(
333 &self,
334 ) -> ::ethers_contract::builders::Event<
335 ::std::sync::Arc<M>,
336 M,
337 Eip712DomainChangedFilter,
338 > {
339 self.0.event()
340 }
341 pub fn transfer_filter(
343 &self,
344 ) -> ::ethers_contract::builders::Event<::std::sync::Arc<M>, M, TransferFilter> {
345 self.0.event()
346 }
347 pub fn events(
349 &self,
350 ) -> ::ethers_contract::builders::Event<
351 ::std::sync::Arc<M>,
352 M,
353 ERC20VotesEvents,
354 > {
355 self.0.event_with_filter(::core::default::Default::default())
356 }
357 }
358 impl<M: ::ethers_providers::Middleware> From<::ethers_contract::Contract<M>>
359 for ERC20Votes<M> {
360 fn from(contract: ::ethers_contract::Contract<M>) -> Self {
361 Self::new(contract.address(), contract.client())
362 }
363 }
364 #[derive(
366 Clone,
367 ::ethers_contract::EthError,
368 ::ethers_contract::EthDisplay,
369 Default,
370 Debug,
371 PartialEq,
372 Eq,
373 Hash
374 )]
375 #[etherror(name = "InvalidShortString", abi = "InvalidShortString()")]
376 pub struct InvalidShortString;
377 #[derive(
379 Clone,
380 ::ethers_contract::EthError,
381 ::ethers_contract::EthDisplay,
382 Default,
383 Debug,
384 PartialEq,
385 Eq,
386 Hash
387 )]
388 #[etherror(name = "StringTooLong", abi = "StringTooLong(string)")]
389 pub struct StringTooLong {
390 pub str: ::std::string::String,
391 }
392 #[derive(Clone, ::ethers_contract::EthAbiType, Debug, PartialEq, Eq, Hash)]
394 pub enum ERC20VotesErrors {
395 InvalidShortString(InvalidShortString),
396 StringTooLong(StringTooLong),
397 RevertString(::std::string::String),
400 }
401 impl ::ethers_core::abi::AbiDecode for ERC20VotesErrors {
402 fn decode(
403 data: impl AsRef<[u8]>,
404 ) -> ::core::result::Result<Self, ::ethers_core::abi::AbiError> {
405 let data = data.as_ref();
406 if let Ok(decoded)
407 = <::std::string::String as ::ethers_core::abi::AbiDecode>::decode(
408 data,
409 ) {
410 return Ok(Self::RevertString(decoded));
411 }
412 if let Ok(decoded)
413 = <InvalidShortString as ::ethers_core::abi::AbiDecode>::decode(data) {
414 return Ok(Self::InvalidShortString(decoded));
415 }
416 if let Ok(decoded)
417 = <StringTooLong as ::ethers_core::abi::AbiDecode>::decode(data) {
418 return Ok(Self::StringTooLong(decoded));
419 }
420 Err(::ethers_core::abi::Error::InvalidData.into())
421 }
422 }
423 impl ::ethers_core::abi::AbiEncode for ERC20VotesErrors {
424 fn encode(self) -> ::std::vec::Vec<u8> {
425 match self {
426 Self::InvalidShortString(element) => {
427 ::ethers_core::abi::AbiEncode::encode(element)
428 }
429 Self::StringTooLong(element) => {
430 ::ethers_core::abi::AbiEncode::encode(element)
431 }
432 Self::RevertString(s) => ::ethers_core::abi::AbiEncode::encode(s),
433 }
434 }
435 }
436 impl ::ethers_contract::ContractRevert for ERC20VotesErrors {
437 fn valid_selector(selector: [u8; 4]) -> bool {
438 match selector {
439 [0x08, 0xc3, 0x79, 0xa0] => true,
440 _ if selector
441 == <InvalidShortString as ::ethers_contract::EthError>::selector() => {
442 true
443 }
444 _ if selector
445 == <StringTooLong as ::ethers_contract::EthError>::selector() => true,
446 _ => false,
447 }
448 }
449 }
450 impl ::core::fmt::Display for ERC20VotesErrors {
451 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
452 match self {
453 Self::InvalidShortString(element) => {
454 ::core::fmt::Display::fmt(element, f)
455 }
456 Self::StringTooLong(element) => ::core::fmt::Display::fmt(element, f),
457 Self::RevertString(s) => ::core::fmt::Display::fmt(s, f),
458 }
459 }
460 }
461 impl ::core::convert::From<::std::string::String> for ERC20VotesErrors {
462 fn from(value: String) -> Self {
463 Self::RevertString(value)
464 }
465 }
466 impl ::core::convert::From<InvalidShortString> for ERC20VotesErrors {
467 fn from(value: InvalidShortString) -> Self {
468 Self::InvalidShortString(value)
469 }
470 }
471 impl ::core::convert::From<StringTooLong> for ERC20VotesErrors {
472 fn from(value: StringTooLong) -> Self {
473 Self::StringTooLong(value)
474 }
475 }
476 #[derive(
477 Clone,
478 ::ethers_contract::EthEvent,
479 ::ethers_contract::EthDisplay,
480 Default,
481 Debug,
482 PartialEq,
483 Eq,
484 Hash
485 )]
486 #[ethevent(name = "Approval", abi = "Approval(address,address,uint256)")]
487 pub struct ApprovalFilter {
488 #[ethevent(indexed)]
489 pub owner: ::ethers_core::types::Address,
490 #[ethevent(indexed)]
491 pub spender: ::ethers_core::types::Address,
492 pub value: ::ethers_core::types::U256,
493 }
494 #[derive(
495 Clone,
496 ::ethers_contract::EthEvent,
497 ::ethers_contract::EthDisplay,
498 Default,
499 Debug,
500 PartialEq,
501 Eq,
502 Hash
503 )]
504 #[ethevent(
505 name = "DelegateChanged",
506 abi = "DelegateChanged(address,address,address)"
507 )]
508 pub struct DelegateChangedFilter {
509 #[ethevent(indexed)]
510 pub delegator: ::ethers_core::types::Address,
511 #[ethevent(indexed)]
512 pub from_delegate: ::ethers_core::types::Address,
513 #[ethevent(indexed)]
514 pub to_delegate: ::ethers_core::types::Address,
515 }
516 #[derive(
517 Clone,
518 ::ethers_contract::EthEvent,
519 ::ethers_contract::EthDisplay,
520 Default,
521 Debug,
522 PartialEq,
523 Eq,
524 Hash
525 )]
526 #[ethevent(
527 name = "DelegateVotesChanged",
528 abi = "DelegateVotesChanged(address,uint256,uint256)"
529 )]
530 pub struct DelegateVotesChangedFilter {
531 #[ethevent(indexed)]
532 pub delegate: ::ethers_core::types::Address,
533 pub previous_balance: ::ethers_core::types::U256,
534 pub new_balance: ::ethers_core::types::U256,
535 }
536 #[derive(
537 Clone,
538 ::ethers_contract::EthEvent,
539 ::ethers_contract::EthDisplay,
540 Default,
541 Debug,
542 PartialEq,
543 Eq,
544 Hash
545 )]
546 #[ethevent(name = "EIP712DomainChanged", abi = "EIP712DomainChanged()")]
547 pub struct Eip712DomainChangedFilter;
548 #[derive(
549 Clone,
550 ::ethers_contract::EthEvent,
551 ::ethers_contract::EthDisplay,
552 Default,
553 Debug,
554 PartialEq,
555 Eq,
556 Hash
557 )]
558 #[ethevent(name = "Transfer", abi = "Transfer(address,address,uint256)")]
559 pub struct TransferFilter {
560 #[ethevent(indexed)]
561 pub from: ::ethers_core::types::Address,
562 #[ethevent(indexed)]
563 pub to: ::ethers_core::types::Address,
564 pub value: ::ethers_core::types::U256,
565 }
566 #[derive(Clone, ::ethers_contract::EthAbiType, Debug, PartialEq, Eq, Hash)]
568 pub enum ERC20VotesEvents {
569 ApprovalFilter(ApprovalFilter),
570 DelegateChangedFilter(DelegateChangedFilter),
571 DelegateVotesChangedFilter(DelegateVotesChangedFilter),
572 Eip712DomainChangedFilter(Eip712DomainChangedFilter),
573 TransferFilter(TransferFilter),
574 }
575 impl ::ethers_contract::EthLogDecode for ERC20VotesEvents {
576 fn decode_log(
577 log: &::ethers_core::abi::RawLog,
578 ) -> ::core::result::Result<Self, ::ethers_core::abi::Error> {
579 if let Ok(decoded) = ApprovalFilter::decode_log(log) {
580 return Ok(ERC20VotesEvents::ApprovalFilter(decoded));
581 }
582 if let Ok(decoded) = DelegateChangedFilter::decode_log(log) {
583 return Ok(ERC20VotesEvents::DelegateChangedFilter(decoded));
584 }
585 if let Ok(decoded) = DelegateVotesChangedFilter::decode_log(log) {
586 return Ok(ERC20VotesEvents::DelegateVotesChangedFilter(decoded));
587 }
588 if let Ok(decoded) = Eip712DomainChangedFilter::decode_log(log) {
589 return Ok(ERC20VotesEvents::Eip712DomainChangedFilter(decoded));
590 }
591 if let Ok(decoded) = TransferFilter::decode_log(log) {
592 return Ok(ERC20VotesEvents::TransferFilter(decoded));
593 }
594 Err(::ethers_core::abi::Error::InvalidData)
595 }
596 }
597 impl ::core::fmt::Display for ERC20VotesEvents {
598 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
599 match self {
600 Self::ApprovalFilter(element) => ::core::fmt::Display::fmt(element, f),
601 Self::DelegateChangedFilter(element) => {
602 ::core::fmt::Display::fmt(element, f)
603 }
604 Self::DelegateVotesChangedFilter(element) => {
605 ::core::fmt::Display::fmt(element, f)
606 }
607 Self::Eip712DomainChangedFilter(element) => {
608 ::core::fmt::Display::fmt(element, f)
609 }
610 Self::TransferFilter(element) => ::core::fmt::Display::fmt(element, f),
611 }
612 }
613 }
614 impl ::core::convert::From<ApprovalFilter> for ERC20VotesEvents {
615 fn from(value: ApprovalFilter) -> Self {
616 Self::ApprovalFilter(value)
617 }
618 }
619 impl ::core::convert::From<DelegateChangedFilter> for ERC20VotesEvents {
620 fn from(value: DelegateChangedFilter) -> Self {
621 Self::DelegateChangedFilter(value)
622 }
623 }
624 impl ::core::convert::From<DelegateVotesChangedFilter> for ERC20VotesEvents {
625 fn from(value: DelegateVotesChangedFilter) -> Self {
626 Self::DelegateVotesChangedFilter(value)
627 }
628 }
629 impl ::core::convert::From<Eip712DomainChangedFilter> for ERC20VotesEvents {
630 fn from(value: Eip712DomainChangedFilter) -> Self {
631 Self::Eip712DomainChangedFilter(value)
632 }
633 }
634 impl ::core::convert::From<TransferFilter> for ERC20VotesEvents {
635 fn from(value: TransferFilter) -> Self {
636 Self::TransferFilter(value)
637 }
638 }
639 #[derive(
641 Clone,
642 ::ethers_contract::EthCall,
643 ::ethers_contract::EthDisplay,
644 Default,
645 Debug,
646 PartialEq,
647 Eq,
648 Hash
649 )]
650 #[ethcall(name = "CLOCK_MODE", abi = "CLOCK_MODE()")]
651 pub struct ClockModeCall;
652 #[derive(
654 Clone,
655 ::ethers_contract::EthCall,
656 ::ethers_contract::EthDisplay,
657 Default,
658 Debug,
659 PartialEq,
660 Eq,
661 Hash
662 )]
663 #[ethcall(name = "DOMAIN_SEPARATOR", abi = "DOMAIN_SEPARATOR()")]
664 pub struct DomainSeparatorCall;
665 #[derive(
667 Clone,
668 ::ethers_contract::EthCall,
669 ::ethers_contract::EthDisplay,
670 Default,
671 Debug,
672 PartialEq,
673 Eq,
674 Hash
675 )]
676 #[ethcall(name = "allowance", abi = "allowance(address,address)")]
677 pub struct AllowanceCall {
678 pub owner: ::ethers_core::types::Address,
679 pub spender: ::ethers_core::types::Address,
680 }
681 #[derive(
683 Clone,
684 ::ethers_contract::EthCall,
685 ::ethers_contract::EthDisplay,
686 Default,
687 Debug,
688 PartialEq,
689 Eq,
690 Hash
691 )]
692 #[ethcall(name = "approve", abi = "approve(address,uint256)")]
693 pub struct ApproveCall {
694 pub spender: ::ethers_core::types::Address,
695 pub amount: ::ethers_core::types::U256,
696 }
697 #[derive(
699 Clone,
700 ::ethers_contract::EthCall,
701 ::ethers_contract::EthDisplay,
702 Default,
703 Debug,
704 PartialEq,
705 Eq,
706 Hash
707 )]
708 #[ethcall(name = "balanceOf", abi = "balanceOf(address)")]
709 pub struct BalanceOfCall {
710 pub account: ::ethers_core::types::Address,
711 }
712 #[derive(
714 Clone,
715 ::ethers_contract::EthCall,
716 ::ethers_contract::EthDisplay,
717 Default,
718 Debug,
719 PartialEq,
720 Eq,
721 Hash
722 )]
723 #[ethcall(name = "checkpoints", abi = "checkpoints(address,uint32)")]
724 pub struct CheckpointsCall {
725 pub account: ::ethers_core::types::Address,
726 pub pos: u32,
727 }
728 #[derive(
730 Clone,
731 ::ethers_contract::EthCall,
732 ::ethers_contract::EthDisplay,
733 Default,
734 Debug,
735 PartialEq,
736 Eq,
737 Hash
738 )]
739 #[ethcall(name = "clock", abi = "clock()")]
740 pub struct ClockCall;
741 #[derive(
743 Clone,
744 ::ethers_contract::EthCall,
745 ::ethers_contract::EthDisplay,
746 Default,
747 Debug,
748 PartialEq,
749 Eq,
750 Hash
751 )]
752 #[ethcall(name = "decimals", abi = "decimals()")]
753 pub struct DecimalsCall;
754 #[derive(
756 Clone,
757 ::ethers_contract::EthCall,
758 ::ethers_contract::EthDisplay,
759 Default,
760 Debug,
761 PartialEq,
762 Eq,
763 Hash
764 )]
765 #[ethcall(name = "decreaseAllowance", abi = "decreaseAllowance(address,uint256)")]
766 pub struct DecreaseAllowanceCall {
767 pub spender: ::ethers_core::types::Address,
768 pub subtracted_value: ::ethers_core::types::U256,
769 }
770 #[derive(
772 Clone,
773 ::ethers_contract::EthCall,
774 ::ethers_contract::EthDisplay,
775 Default,
776 Debug,
777 PartialEq,
778 Eq,
779 Hash
780 )]
781 #[ethcall(name = "delegate", abi = "delegate(address)")]
782 pub struct DelegateCall {
783 pub delegatee: ::ethers_core::types::Address,
784 }
785 #[derive(
787 Clone,
788 ::ethers_contract::EthCall,
789 ::ethers_contract::EthDisplay,
790 Default,
791 Debug,
792 PartialEq,
793 Eq,
794 Hash
795 )]
796 #[ethcall(
797 name = "delegateBySig",
798 abi = "delegateBySig(address,uint256,uint256,uint8,bytes32,bytes32)"
799 )]
800 pub struct DelegateBySigCall {
801 pub delegatee: ::ethers_core::types::Address,
802 pub nonce: ::ethers_core::types::U256,
803 pub expiry: ::ethers_core::types::U256,
804 pub v: u8,
805 pub r: [u8; 32],
806 pub s: [u8; 32],
807 }
808 #[derive(
810 Clone,
811 ::ethers_contract::EthCall,
812 ::ethers_contract::EthDisplay,
813 Default,
814 Debug,
815 PartialEq,
816 Eq,
817 Hash
818 )]
819 #[ethcall(name = "delegates", abi = "delegates(address)")]
820 pub struct DelegatesCall {
821 pub account: ::ethers_core::types::Address,
822 }
823 #[derive(
825 Clone,
826 ::ethers_contract::EthCall,
827 ::ethers_contract::EthDisplay,
828 Default,
829 Debug,
830 PartialEq,
831 Eq,
832 Hash
833 )]
834 #[ethcall(name = "eip712Domain", abi = "eip712Domain()")]
835 pub struct Eip712DomainCall;
836 #[derive(
838 Clone,
839 ::ethers_contract::EthCall,
840 ::ethers_contract::EthDisplay,
841 Default,
842 Debug,
843 PartialEq,
844 Eq,
845 Hash
846 )]
847 #[ethcall(name = "getPastTotalSupply", abi = "getPastTotalSupply(uint256)")]
848 pub struct GetPastTotalSupplyCall {
849 pub timepoint: ::ethers_core::types::U256,
850 }
851 #[derive(
853 Clone,
854 ::ethers_contract::EthCall,
855 ::ethers_contract::EthDisplay,
856 Default,
857 Debug,
858 PartialEq,
859 Eq,
860 Hash
861 )]
862 #[ethcall(name = "getPastVotes", abi = "getPastVotes(address,uint256)")]
863 pub struct GetPastVotesCall {
864 pub account: ::ethers_core::types::Address,
865 pub timepoint: ::ethers_core::types::U256,
866 }
867 #[derive(
869 Clone,
870 ::ethers_contract::EthCall,
871 ::ethers_contract::EthDisplay,
872 Default,
873 Debug,
874 PartialEq,
875 Eq,
876 Hash
877 )]
878 #[ethcall(name = "getVotes", abi = "getVotes(address)")]
879 pub struct GetVotesCall {
880 pub account: ::ethers_core::types::Address,
881 }
882 #[derive(
884 Clone,
885 ::ethers_contract::EthCall,
886 ::ethers_contract::EthDisplay,
887 Default,
888 Debug,
889 PartialEq,
890 Eq,
891 Hash
892 )]
893 #[ethcall(name = "increaseAllowance", abi = "increaseAllowance(address,uint256)")]
894 pub struct IncreaseAllowanceCall {
895 pub spender: ::ethers_core::types::Address,
896 pub added_value: ::ethers_core::types::U256,
897 }
898 #[derive(
900 Clone,
901 ::ethers_contract::EthCall,
902 ::ethers_contract::EthDisplay,
903 Default,
904 Debug,
905 PartialEq,
906 Eq,
907 Hash
908 )]
909 #[ethcall(name = "name", abi = "name()")]
910 pub struct NameCall;
911 #[derive(
913 Clone,
914 ::ethers_contract::EthCall,
915 ::ethers_contract::EthDisplay,
916 Default,
917 Debug,
918 PartialEq,
919 Eq,
920 Hash
921 )]
922 #[ethcall(name = "nonces", abi = "nonces(address)")]
923 pub struct NoncesCall {
924 pub owner: ::ethers_core::types::Address,
925 }
926 #[derive(
928 Clone,
929 ::ethers_contract::EthCall,
930 ::ethers_contract::EthDisplay,
931 Default,
932 Debug,
933 PartialEq,
934 Eq,
935 Hash
936 )]
937 #[ethcall(name = "numCheckpoints", abi = "numCheckpoints(address)")]
938 pub struct NumCheckpointsCall {
939 pub account: ::ethers_core::types::Address,
940 }
941 #[derive(
943 Clone,
944 ::ethers_contract::EthCall,
945 ::ethers_contract::EthDisplay,
946 Default,
947 Debug,
948 PartialEq,
949 Eq,
950 Hash
951 )]
952 #[ethcall(
953 name = "permit",
954 abi = "permit(address,address,uint256,uint256,uint8,bytes32,bytes32)"
955 )]
956 pub struct PermitCall {
957 pub owner: ::ethers_core::types::Address,
958 pub spender: ::ethers_core::types::Address,
959 pub value: ::ethers_core::types::U256,
960 pub deadline: ::ethers_core::types::U256,
961 pub v: u8,
962 pub r: [u8; 32],
963 pub s: [u8; 32],
964 }
965 #[derive(
967 Clone,
968 ::ethers_contract::EthCall,
969 ::ethers_contract::EthDisplay,
970 Default,
971 Debug,
972 PartialEq,
973 Eq,
974 Hash
975 )]
976 #[ethcall(name = "symbol", abi = "symbol()")]
977 pub struct SymbolCall;
978 #[derive(
980 Clone,
981 ::ethers_contract::EthCall,
982 ::ethers_contract::EthDisplay,
983 Default,
984 Debug,
985 PartialEq,
986 Eq,
987 Hash
988 )]
989 #[ethcall(name = "totalSupply", abi = "totalSupply()")]
990 pub struct TotalSupplyCall;
991 #[derive(
993 Clone,
994 ::ethers_contract::EthCall,
995 ::ethers_contract::EthDisplay,
996 Default,
997 Debug,
998 PartialEq,
999 Eq,
1000 Hash
1001 )]
1002 #[ethcall(name = "transfer", abi = "transfer(address,uint256)")]
1003 pub struct TransferCall {
1004 pub to: ::ethers_core::types::Address,
1005 pub amount: ::ethers_core::types::U256,
1006 }
1007 #[derive(
1009 Clone,
1010 ::ethers_contract::EthCall,
1011 ::ethers_contract::EthDisplay,
1012 Default,
1013 Debug,
1014 PartialEq,
1015 Eq,
1016 Hash
1017 )]
1018 #[ethcall(name = "transferFrom", abi = "transferFrom(address,address,uint256)")]
1019 pub struct TransferFromCall {
1020 pub from: ::ethers_core::types::Address,
1021 pub to: ::ethers_core::types::Address,
1022 pub amount: ::ethers_core::types::U256,
1023 }
1024 #[derive(Clone, ::ethers_contract::EthAbiType, Debug, PartialEq, Eq, Hash)]
1026 pub enum ERC20VotesCalls {
1027 ClockMode(ClockModeCall),
1028 DomainSeparator(DomainSeparatorCall),
1029 Allowance(AllowanceCall),
1030 Approve(ApproveCall),
1031 BalanceOf(BalanceOfCall),
1032 Checkpoints(CheckpointsCall),
1033 Clock(ClockCall),
1034 Decimals(DecimalsCall),
1035 DecreaseAllowance(DecreaseAllowanceCall),
1036 Delegate(DelegateCall),
1037 DelegateBySig(DelegateBySigCall),
1038 Delegates(DelegatesCall),
1039 Eip712Domain(Eip712DomainCall),
1040 GetPastTotalSupply(GetPastTotalSupplyCall),
1041 GetPastVotes(GetPastVotesCall),
1042 GetVotes(GetVotesCall),
1043 IncreaseAllowance(IncreaseAllowanceCall),
1044 Name(NameCall),
1045 Nonces(NoncesCall),
1046 NumCheckpoints(NumCheckpointsCall),
1047 Permit(PermitCall),
1048 Symbol(SymbolCall),
1049 TotalSupply(TotalSupplyCall),
1050 Transfer(TransferCall),
1051 TransferFrom(TransferFromCall),
1052 }
1053 impl ::ethers_core::abi::AbiDecode for ERC20VotesCalls {
1054 fn decode(
1055 data: impl AsRef<[u8]>,
1056 ) -> ::core::result::Result<Self, ::ethers_core::abi::AbiError> {
1057 let data = data.as_ref();
1058 if let Ok(decoded)
1059 = <ClockModeCall as ::ethers_core::abi::AbiDecode>::decode(data) {
1060 return Ok(Self::ClockMode(decoded));
1061 }
1062 if let Ok(decoded)
1063 = <DomainSeparatorCall as ::ethers_core::abi::AbiDecode>::decode(data) {
1064 return Ok(Self::DomainSeparator(decoded));
1065 }
1066 if let Ok(decoded)
1067 = <AllowanceCall as ::ethers_core::abi::AbiDecode>::decode(data) {
1068 return Ok(Self::Allowance(decoded));
1069 }
1070 if let Ok(decoded)
1071 = <ApproveCall as ::ethers_core::abi::AbiDecode>::decode(data) {
1072 return Ok(Self::Approve(decoded));
1073 }
1074 if let Ok(decoded)
1075 = <BalanceOfCall as ::ethers_core::abi::AbiDecode>::decode(data) {
1076 return Ok(Self::BalanceOf(decoded));
1077 }
1078 if let Ok(decoded)
1079 = <CheckpointsCall as ::ethers_core::abi::AbiDecode>::decode(data) {
1080 return Ok(Self::Checkpoints(decoded));
1081 }
1082 if let Ok(decoded)
1083 = <ClockCall as ::ethers_core::abi::AbiDecode>::decode(data) {
1084 return Ok(Self::Clock(decoded));
1085 }
1086 if let Ok(decoded)
1087 = <DecimalsCall as ::ethers_core::abi::AbiDecode>::decode(data) {
1088 return Ok(Self::Decimals(decoded));
1089 }
1090 if let Ok(decoded)
1091 = <DecreaseAllowanceCall as ::ethers_core::abi::AbiDecode>::decode(
1092 data,
1093 ) {
1094 return Ok(Self::DecreaseAllowance(decoded));
1095 }
1096 if let Ok(decoded)
1097 = <DelegateCall as ::ethers_core::abi::AbiDecode>::decode(data) {
1098 return Ok(Self::Delegate(decoded));
1099 }
1100 if let Ok(decoded)
1101 = <DelegateBySigCall as ::ethers_core::abi::AbiDecode>::decode(data) {
1102 return Ok(Self::DelegateBySig(decoded));
1103 }
1104 if let Ok(decoded)
1105 = <DelegatesCall as ::ethers_core::abi::AbiDecode>::decode(data) {
1106 return Ok(Self::Delegates(decoded));
1107 }
1108 if let Ok(decoded)
1109 = <Eip712DomainCall as ::ethers_core::abi::AbiDecode>::decode(data) {
1110 return Ok(Self::Eip712Domain(decoded));
1111 }
1112 if let Ok(decoded)
1113 = <GetPastTotalSupplyCall as ::ethers_core::abi::AbiDecode>::decode(
1114 data,
1115 ) {
1116 return Ok(Self::GetPastTotalSupply(decoded));
1117 }
1118 if let Ok(decoded)
1119 = <GetPastVotesCall as ::ethers_core::abi::AbiDecode>::decode(data) {
1120 return Ok(Self::GetPastVotes(decoded));
1121 }
1122 if let Ok(decoded)
1123 = <GetVotesCall as ::ethers_core::abi::AbiDecode>::decode(data) {
1124 return Ok(Self::GetVotes(decoded));
1125 }
1126 if let Ok(decoded)
1127 = <IncreaseAllowanceCall as ::ethers_core::abi::AbiDecode>::decode(
1128 data,
1129 ) {
1130 return Ok(Self::IncreaseAllowance(decoded));
1131 }
1132 if let Ok(decoded)
1133 = <NameCall as ::ethers_core::abi::AbiDecode>::decode(data) {
1134 return Ok(Self::Name(decoded));
1135 }
1136 if let Ok(decoded)
1137 = <NoncesCall as ::ethers_core::abi::AbiDecode>::decode(data) {
1138 return Ok(Self::Nonces(decoded));
1139 }
1140 if let Ok(decoded)
1141 = <NumCheckpointsCall as ::ethers_core::abi::AbiDecode>::decode(data) {
1142 return Ok(Self::NumCheckpoints(decoded));
1143 }
1144 if let Ok(decoded)
1145 = <PermitCall as ::ethers_core::abi::AbiDecode>::decode(data) {
1146 return Ok(Self::Permit(decoded));
1147 }
1148 if let Ok(decoded)
1149 = <SymbolCall as ::ethers_core::abi::AbiDecode>::decode(data) {
1150 return Ok(Self::Symbol(decoded));
1151 }
1152 if let Ok(decoded)
1153 = <TotalSupplyCall as ::ethers_core::abi::AbiDecode>::decode(data) {
1154 return Ok(Self::TotalSupply(decoded));
1155 }
1156 if let Ok(decoded)
1157 = <TransferCall as ::ethers_core::abi::AbiDecode>::decode(data) {
1158 return Ok(Self::Transfer(decoded));
1159 }
1160 if let Ok(decoded)
1161 = <TransferFromCall as ::ethers_core::abi::AbiDecode>::decode(data) {
1162 return Ok(Self::TransferFrom(decoded));
1163 }
1164 Err(::ethers_core::abi::Error::InvalidData.into())
1165 }
1166 }
1167 impl ::ethers_core::abi::AbiEncode for ERC20VotesCalls {
1168 fn encode(self) -> Vec<u8> {
1169 match self {
1170 Self::ClockMode(element) => {
1171 ::ethers_core::abi::AbiEncode::encode(element)
1172 }
1173 Self::DomainSeparator(element) => {
1174 ::ethers_core::abi::AbiEncode::encode(element)
1175 }
1176 Self::Allowance(element) => {
1177 ::ethers_core::abi::AbiEncode::encode(element)
1178 }
1179 Self::Approve(element) => ::ethers_core::abi::AbiEncode::encode(element),
1180 Self::BalanceOf(element) => {
1181 ::ethers_core::abi::AbiEncode::encode(element)
1182 }
1183 Self::Checkpoints(element) => {
1184 ::ethers_core::abi::AbiEncode::encode(element)
1185 }
1186 Self::Clock(element) => ::ethers_core::abi::AbiEncode::encode(element),
1187 Self::Decimals(element) => ::ethers_core::abi::AbiEncode::encode(element),
1188 Self::DecreaseAllowance(element) => {
1189 ::ethers_core::abi::AbiEncode::encode(element)
1190 }
1191 Self::Delegate(element) => ::ethers_core::abi::AbiEncode::encode(element),
1192 Self::DelegateBySig(element) => {
1193 ::ethers_core::abi::AbiEncode::encode(element)
1194 }
1195 Self::Delegates(element) => {
1196 ::ethers_core::abi::AbiEncode::encode(element)
1197 }
1198 Self::Eip712Domain(element) => {
1199 ::ethers_core::abi::AbiEncode::encode(element)
1200 }
1201 Self::GetPastTotalSupply(element) => {
1202 ::ethers_core::abi::AbiEncode::encode(element)
1203 }
1204 Self::GetPastVotes(element) => {
1205 ::ethers_core::abi::AbiEncode::encode(element)
1206 }
1207 Self::GetVotes(element) => ::ethers_core::abi::AbiEncode::encode(element),
1208 Self::IncreaseAllowance(element) => {
1209 ::ethers_core::abi::AbiEncode::encode(element)
1210 }
1211 Self::Name(element) => ::ethers_core::abi::AbiEncode::encode(element),
1212 Self::Nonces(element) => ::ethers_core::abi::AbiEncode::encode(element),
1213 Self::NumCheckpoints(element) => {
1214 ::ethers_core::abi::AbiEncode::encode(element)
1215 }
1216 Self::Permit(element) => ::ethers_core::abi::AbiEncode::encode(element),
1217 Self::Symbol(element) => ::ethers_core::abi::AbiEncode::encode(element),
1218 Self::TotalSupply(element) => {
1219 ::ethers_core::abi::AbiEncode::encode(element)
1220 }
1221 Self::Transfer(element) => ::ethers_core::abi::AbiEncode::encode(element),
1222 Self::TransferFrom(element) => {
1223 ::ethers_core::abi::AbiEncode::encode(element)
1224 }
1225 }
1226 }
1227 }
1228 impl ::core::fmt::Display for ERC20VotesCalls {
1229 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1230 match self {
1231 Self::ClockMode(element) => ::core::fmt::Display::fmt(element, f),
1232 Self::DomainSeparator(element) => ::core::fmt::Display::fmt(element, f),
1233 Self::Allowance(element) => ::core::fmt::Display::fmt(element, f),
1234 Self::Approve(element) => ::core::fmt::Display::fmt(element, f),
1235 Self::BalanceOf(element) => ::core::fmt::Display::fmt(element, f),
1236 Self::Checkpoints(element) => ::core::fmt::Display::fmt(element, f),
1237 Self::Clock(element) => ::core::fmt::Display::fmt(element, f),
1238 Self::Decimals(element) => ::core::fmt::Display::fmt(element, f),
1239 Self::DecreaseAllowance(element) => ::core::fmt::Display::fmt(element, f),
1240 Self::Delegate(element) => ::core::fmt::Display::fmt(element, f),
1241 Self::DelegateBySig(element) => ::core::fmt::Display::fmt(element, f),
1242 Self::Delegates(element) => ::core::fmt::Display::fmt(element, f),
1243 Self::Eip712Domain(element) => ::core::fmt::Display::fmt(element, f),
1244 Self::GetPastTotalSupply(element) => {
1245 ::core::fmt::Display::fmt(element, f)
1246 }
1247 Self::GetPastVotes(element) => ::core::fmt::Display::fmt(element, f),
1248 Self::GetVotes(element) => ::core::fmt::Display::fmt(element, f),
1249 Self::IncreaseAllowance(element) => ::core::fmt::Display::fmt(element, f),
1250 Self::Name(element) => ::core::fmt::Display::fmt(element, f),
1251 Self::Nonces(element) => ::core::fmt::Display::fmt(element, f),
1252 Self::NumCheckpoints(element) => ::core::fmt::Display::fmt(element, f),
1253 Self::Permit(element) => ::core::fmt::Display::fmt(element, f),
1254 Self::Symbol(element) => ::core::fmt::Display::fmt(element, f),
1255 Self::TotalSupply(element) => ::core::fmt::Display::fmt(element, f),
1256 Self::Transfer(element) => ::core::fmt::Display::fmt(element, f),
1257 Self::TransferFrom(element) => ::core::fmt::Display::fmt(element, f),
1258 }
1259 }
1260 }
1261 impl ::core::convert::From<ClockModeCall> for ERC20VotesCalls {
1262 fn from(value: ClockModeCall) -> Self {
1263 Self::ClockMode(value)
1264 }
1265 }
1266 impl ::core::convert::From<DomainSeparatorCall> for ERC20VotesCalls {
1267 fn from(value: DomainSeparatorCall) -> Self {
1268 Self::DomainSeparator(value)
1269 }
1270 }
1271 impl ::core::convert::From<AllowanceCall> for ERC20VotesCalls {
1272 fn from(value: AllowanceCall) -> Self {
1273 Self::Allowance(value)
1274 }
1275 }
1276 impl ::core::convert::From<ApproveCall> for ERC20VotesCalls {
1277 fn from(value: ApproveCall) -> Self {
1278 Self::Approve(value)
1279 }
1280 }
1281 impl ::core::convert::From<BalanceOfCall> for ERC20VotesCalls {
1282 fn from(value: BalanceOfCall) -> Self {
1283 Self::BalanceOf(value)
1284 }
1285 }
1286 impl ::core::convert::From<CheckpointsCall> for ERC20VotesCalls {
1287 fn from(value: CheckpointsCall) -> Self {
1288 Self::Checkpoints(value)
1289 }
1290 }
1291 impl ::core::convert::From<ClockCall> for ERC20VotesCalls {
1292 fn from(value: ClockCall) -> Self {
1293 Self::Clock(value)
1294 }
1295 }
1296 impl ::core::convert::From<DecimalsCall> for ERC20VotesCalls {
1297 fn from(value: DecimalsCall) -> Self {
1298 Self::Decimals(value)
1299 }
1300 }
1301 impl ::core::convert::From<DecreaseAllowanceCall> for ERC20VotesCalls {
1302 fn from(value: DecreaseAllowanceCall) -> Self {
1303 Self::DecreaseAllowance(value)
1304 }
1305 }
1306 impl ::core::convert::From<DelegateCall> for ERC20VotesCalls {
1307 fn from(value: DelegateCall) -> Self {
1308 Self::Delegate(value)
1309 }
1310 }
1311 impl ::core::convert::From<DelegateBySigCall> for ERC20VotesCalls {
1312 fn from(value: DelegateBySigCall) -> Self {
1313 Self::DelegateBySig(value)
1314 }
1315 }
1316 impl ::core::convert::From<DelegatesCall> for ERC20VotesCalls {
1317 fn from(value: DelegatesCall) -> Self {
1318 Self::Delegates(value)
1319 }
1320 }
1321 impl ::core::convert::From<Eip712DomainCall> for ERC20VotesCalls {
1322 fn from(value: Eip712DomainCall) -> Self {
1323 Self::Eip712Domain(value)
1324 }
1325 }
1326 impl ::core::convert::From<GetPastTotalSupplyCall> for ERC20VotesCalls {
1327 fn from(value: GetPastTotalSupplyCall) -> Self {
1328 Self::GetPastTotalSupply(value)
1329 }
1330 }
1331 impl ::core::convert::From<GetPastVotesCall> for ERC20VotesCalls {
1332 fn from(value: GetPastVotesCall) -> Self {
1333 Self::GetPastVotes(value)
1334 }
1335 }
1336 impl ::core::convert::From<GetVotesCall> for ERC20VotesCalls {
1337 fn from(value: GetVotesCall) -> Self {
1338 Self::GetVotes(value)
1339 }
1340 }
1341 impl ::core::convert::From<IncreaseAllowanceCall> for ERC20VotesCalls {
1342 fn from(value: IncreaseAllowanceCall) -> Self {
1343 Self::IncreaseAllowance(value)
1344 }
1345 }
1346 impl ::core::convert::From<NameCall> for ERC20VotesCalls {
1347 fn from(value: NameCall) -> Self {
1348 Self::Name(value)
1349 }
1350 }
1351 impl ::core::convert::From<NoncesCall> for ERC20VotesCalls {
1352 fn from(value: NoncesCall) -> Self {
1353 Self::Nonces(value)
1354 }
1355 }
1356 impl ::core::convert::From<NumCheckpointsCall> for ERC20VotesCalls {
1357 fn from(value: NumCheckpointsCall) -> Self {
1358 Self::NumCheckpoints(value)
1359 }
1360 }
1361 impl ::core::convert::From<PermitCall> for ERC20VotesCalls {
1362 fn from(value: PermitCall) -> Self {
1363 Self::Permit(value)
1364 }
1365 }
1366 impl ::core::convert::From<SymbolCall> for ERC20VotesCalls {
1367 fn from(value: SymbolCall) -> Self {
1368 Self::Symbol(value)
1369 }
1370 }
1371 impl ::core::convert::From<TotalSupplyCall> for ERC20VotesCalls {
1372 fn from(value: TotalSupplyCall) -> Self {
1373 Self::TotalSupply(value)
1374 }
1375 }
1376 impl ::core::convert::From<TransferCall> for ERC20VotesCalls {
1377 fn from(value: TransferCall) -> Self {
1378 Self::Transfer(value)
1379 }
1380 }
1381 impl ::core::convert::From<TransferFromCall> for ERC20VotesCalls {
1382 fn from(value: TransferFromCall) -> Self {
1383 Self::TransferFrom(value)
1384 }
1385 }
1386 #[derive(
1388 Clone,
1389 ::ethers_contract::EthAbiType,
1390 ::ethers_contract::EthAbiCodec,
1391 Default,
1392 Debug,
1393 PartialEq,
1394 Eq,
1395 Hash
1396 )]
1397 pub struct ClockModeReturn(pub ::std::string::String);
1398 #[derive(
1400 Clone,
1401 ::ethers_contract::EthAbiType,
1402 ::ethers_contract::EthAbiCodec,
1403 Default,
1404 Debug,
1405 PartialEq,
1406 Eq,
1407 Hash
1408 )]
1409 pub struct DomainSeparatorReturn(pub [u8; 32]);
1410 #[derive(
1412 Clone,
1413 ::ethers_contract::EthAbiType,
1414 ::ethers_contract::EthAbiCodec,
1415 Default,
1416 Debug,
1417 PartialEq,
1418 Eq,
1419 Hash
1420 )]
1421 pub struct AllowanceReturn(pub ::ethers_core::types::U256);
1422 #[derive(
1424 Clone,
1425 ::ethers_contract::EthAbiType,
1426 ::ethers_contract::EthAbiCodec,
1427 Default,
1428 Debug,
1429 PartialEq,
1430 Eq,
1431 Hash
1432 )]
1433 pub struct ApproveReturn(pub bool);
1434 #[derive(
1436 Clone,
1437 ::ethers_contract::EthAbiType,
1438 ::ethers_contract::EthAbiCodec,
1439 Default,
1440 Debug,
1441 PartialEq,
1442 Eq,
1443 Hash
1444 )]
1445 pub struct BalanceOfReturn(pub ::ethers_core::types::U256);
1446 #[derive(
1448 Clone,
1449 ::ethers_contract::EthAbiType,
1450 ::ethers_contract::EthAbiCodec,
1451 Default,
1452 Debug,
1453 PartialEq,
1454 Eq,
1455 Hash
1456 )]
1457 pub struct CheckpointsReturn(pub Checkpoint);
1458 #[derive(
1460 Clone,
1461 ::ethers_contract::EthAbiType,
1462 ::ethers_contract::EthAbiCodec,
1463 Default,
1464 Debug,
1465 PartialEq,
1466 Eq,
1467 Hash
1468 )]
1469 pub struct ClockReturn(pub u64);
1470 #[derive(
1472 Clone,
1473 ::ethers_contract::EthAbiType,
1474 ::ethers_contract::EthAbiCodec,
1475 Default,
1476 Debug,
1477 PartialEq,
1478 Eq,
1479 Hash
1480 )]
1481 pub struct DecimalsReturn(pub u8);
1482 #[derive(
1484 Clone,
1485 ::ethers_contract::EthAbiType,
1486 ::ethers_contract::EthAbiCodec,
1487 Default,
1488 Debug,
1489 PartialEq,
1490 Eq,
1491 Hash
1492 )]
1493 pub struct DecreaseAllowanceReturn(pub bool);
1494 #[derive(
1496 Clone,
1497 ::ethers_contract::EthAbiType,
1498 ::ethers_contract::EthAbiCodec,
1499 Default,
1500 Debug,
1501 PartialEq,
1502 Eq,
1503 Hash
1504 )]
1505 pub struct DelegatesReturn(pub ::ethers_core::types::Address);
1506 #[derive(
1508 Clone,
1509 ::ethers_contract::EthAbiType,
1510 ::ethers_contract::EthAbiCodec,
1511 Default,
1512 Debug,
1513 PartialEq,
1514 Eq,
1515 Hash
1516 )]
1517 pub struct Eip712DomainReturn {
1518 pub fields: [u8; 1],
1519 pub name: ::std::string::String,
1520 pub version: ::std::string::String,
1521 pub chain_id: ::ethers_core::types::U256,
1522 pub verifying_contract: ::ethers_core::types::Address,
1523 pub salt: [u8; 32],
1524 pub extensions: ::std::vec::Vec<::ethers_core::types::U256>,
1525 }
1526 #[derive(
1528 Clone,
1529 ::ethers_contract::EthAbiType,
1530 ::ethers_contract::EthAbiCodec,
1531 Default,
1532 Debug,
1533 PartialEq,
1534 Eq,
1535 Hash
1536 )]
1537 pub struct GetPastTotalSupplyReturn(pub ::ethers_core::types::U256);
1538 #[derive(
1540 Clone,
1541 ::ethers_contract::EthAbiType,
1542 ::ethers_contract::EthAbiCodec,
1543 Default,
1544 Debug,
1545 PartialEq,
1546 Eq,
1547 Hash
1548 )]
1549 pub struct GetPastVotesReturn(pub ::ethers_core::types::U256);
1550 #[derive(
1552 Clone,
1553 ::ethers_contract::EthAbiType,
1554 ::ethers_contract::EthAbiCodec,
1555 Default,
1556 Debug,
1557 PartialEq,
1558 Eq,
1559 Hash
1560 )]
1561 pub struct GetVotesReturn(pub ::ethers_core::types::U256);
1562 #[derive(
1564 Clone,
1565 ::ethers_contract::EthAbiType,
1566 ::ethers_contract::EthAbiCodec,
1567 Default,
1568 Debug,
1569 PartialEq,
1570 Eq,
1571 Hash
1572 )]
1573 pub struct IncreaseAllowanceReturn(pub bool);
1574 #[derive(
1576 Clone,
1577 ::ethers_contract::EthAbiType,
1578 ::ethers_contract::EthAbiCodec,
1579 Default,
1580 Debug,
1581 PartialEq,
1582 Eq,
1583 Hash
1584 )]
1585 pub struct NameReturn(pub ::std::string::String);
1586 #[derive(
1588 Clone,
1589 ::ethers_contract::EthAbiType,
1590 ::ethers_contract::EthAbiCodec,
1591 Default,
1592 Debug,
1593 PartialEq,
1594 Eq,
1595 Hash
1596 )]
1597 pub struct NoncesReturn(pub ::ethers_core::types::U256);
1598 #[derive(
1600 Clone,
1601 ::ethers_contract::EthAbiType,
1602 ::ethers_contract::EthAbiCodec,
1603 Default,
1604 Debug,
1605 PartialEq,
1606 Eq,
1607 Hash
1608 )]
1609 pub struct NumCheckpointsReturn(pub u32);
1610 #[derive(
1612 Clone,
1613 ::ethers_contract::EthAbiType,
1614 ::ethers_contract::EthAbiCodec,
1615 Default,
1616 Debug,
1617 PartialEq,
1618 Eq,
1619 Hash
1620 )]
1621 pub struct SymbolReturn(pub ::std::string::String);
1622 #[derive(
1624 Clone,
1625 ::ethers_contract::EthAbiType,
1626 ::ethers_contract::EthAbiCodec,
1627 Default,
1628 Debug,
1629 PartialEq,
1630 Eq,
1631 Hash
1632 )]
1633 pub struct TotalSupplyReturn(pub ::ethers_core::types::U256);
1634 #[derive(
1636 Clone,
1637 ::ethers_contract::EthAbiType,
1638 ::ethers_contract::EthAbiCodec,
1639 Default,
1640 Debug,
1641 PartialEq,
1642 Eq,
1643 Hash
1644 )]
1645 pub struct TransferReturn(pub bool);
1646 #[derive(
1648 Clone,
1649 ::ethers_contract::EthAbiType,
1650 ::ethers_contract::EthAbiCodec,
1651 Default,
1652 Debug,
1653 PartialEq,
1654 Eq,
1655 Hash
1656 )]
1657 pub struct TransferFromReturn(pub bool);
1658 #[derive(
1660 Clone,
1661 ::ethers_contract::EthAbiType,
1662 ::ethers_contract::EthAbiCodec,
1663 Default,
1664 Debug,
1665 PartialEq,
1666 Eq,
1667 Hash
1668 )]
1669 pub struct Checkpoint {
1670 pub from_block: u32,
1671 pub votes: ::ethers_core::types::U256,
1672 }
1673}