1pub use erc20_snapshot::*;
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_snapshot {
13 #[rustfmt::skip]
14 const __ABI: &str = "[{\"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\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\",\"components\":[],\"indexed\":false}],\"type\":\"event\",\"name\":\"Snapshot\",\"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\":[{\"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\":\"uint256\",\"name\":\"snapshotId\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"balanceOfAt\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\",\"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\":\"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\":[],\"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\":\"uint256\",\"name\":\"snapshotId\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"totalSupplyAt\",\"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 ERC20SNAPSHOT_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 ERC20Snapshot<M>(::ethers_contract::Contract<M>);
19 impl<M> ::core::clone::Clone for ERC20Snapshot<M> {
20 fn clone(&self) -> Self {
21 Self(::core::clone::Clone::clone(&self.0))
22 }
23 }
24 impl<M> ::core::ops::Deref for ERC20Snapshot<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 ERC20Snapshot<M> {
31 fn deref_mut(&mut self) -> &mut Self::Target {
32 &mut self.0
33 }
34 }
35 impl<M> ::core::fmt::Debug for ERC20Snapshot<M> {
36 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
37 f.debug_tuple(stringify!(ERC20Snapshot)).field(&self.address()).finish()
38 }
39 }
40 impl<M: ::ethers_providers::Middleware> ERC20Snapshot<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 ERC20SNAPSHOT_ABI.clone(),
51 client,
52 ),
53 )
54 }
55 pub fn allowance(
57 &self,
58 owner: ::ethers_core::types::Address,
59 spender: ::ethers_core::types::Address,
60 ) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
61 self.0
62 .method_hash([221, 98, 237, 62], (owner, spender))
63 .expect("method not found (this should never happen)")
64 }
65 pub fn approve(
67 &self,
68 spender: ::ethers_core::types::Address,
69 amount: ::ethers_core::types::U256,
70 ) -> ::ethers_contract::builders::ContractCall<M, bool> {
71 self.0
72 .method_hash([9, 94, 167, 179], (spender, amount))
73 .expect("method not found (this should never happen)")
74 }
75 pub fn balance_of(
77 &self,
78 account: ::ethers_core::types::Address,
79 ) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
80 self.0
81 .method_hash([112, 160, 130, 49], account)
82 .expect("method not found (this should never happen)")
83 }
84 pub fn balance_of_at(
86 &self,
87 account: ::ethers_core::types::Address,
88 snapshot_id: ::ethers_core::types::U256,
89 ) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
90 self.0
91 .method_hash([78, 226, 205, 126], (account, snapshot_id))
92 .expect("method not found (this should never happen)")
93 }
94 pub fn decimals(&self) -> ::ethers_contract::builders::ContractCall<M, u8> {
96 self.0
97 .method_hash([49, 60, 229, 103], ())
98 .expect("method not found (this should never happen)")
99 }
100 pub fn decrease_allowance(
102 &self,
103 spender: ::ethers_core::types::Address,
104 subtracted_value: ::ethers_core::types::U256,
105 ) -> ::ethers_contract::builders::ContractCall<M, bool> {
106 self.0
107 .method_hash([164, 87, 194, 215], (spender, subtracted_value))
108 .expect("method not found (this should never happen)")
109 }
110 pub fn increase_allowance(
112 &self,
113 spender: ::ethers_core::types::Address,
114 added_value: ::ethers_core::types::U256,
115 ) -> ::ethers_contract::builders::ContractCall<M, bool> {
116 self.0
117 .method_hash([57, 80, 147, 81], (spender, added_value))
118 .expect("method not found (this should never happen)")
119 }
120 pub fn name(
122 &self,
123 ) -> ::ethers_contract::builders::ContractCall<M, ::std::string::String> {
124 self.0
125 .method_hash([6, 253, 222, 3], ())
126 .expect("method not found (this should never happen)")
127 }
128 pub fn symbol(
130 &self,
131 ) -> ::ethers_contract::builders::ContractCall<M, ::std::string::String> {
132 self.0
133 .method_hash([149, 216, 155, 65], ())
134 .expect("method not found (this should never happen)")
135 }
136 pub fn total_supply(
138 &self,
139 ) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
140 self.0
141 .method_hash([24, 22, 13, 221], ())
142 .expect("method not found (this should never happen)")
143 }
144 pub fn total_supply_at(
146 &self,
147 snapshot_id: ::ethers_core::types::U256,
148 ) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
149 self.0
150 .method_hash([152, 27, 36, 208], snapshot_id)
151 .expect("method not found (this should never happen)")
152 }
153 pub fn transfer(
155 &self,
156 to: ::ethers_core::types::Address,
157 amount: ::ethers_core::types::U256,
158 ) -> ::ethers_contract::builders::ContractCall<M, bool> {
159 self.0
160 .method_hash([169, 5, 156, 187], (to, amount))
161 .expect("method not found (this should never happen)")
162 }
163 pub fn transfer_from(
165 &self,
166 from: ::ethers_core::types::Address,
167 to: ::ethers_core::types::Address,
168 amount: ::ethers_core::types::U256,
169 ) -> ::ethers_contract::builders::ContractCall<M, bool> {
170 self.0
171 .method_hash([35, 184, 114, 221], (from, to, amount))
172 .expect("method not found (this should never happen)")
173 }
174 pub fn approval_filter(
176 &self,
177 ) -> ::ethers_contract::builders::Event<::std::sync::Arc<M>, M, ApprovalFilter> {
178 self.0.event()
179 }
180 pub fn snapshot_filter(
182 &self,
183 ) -> ::ethers_contract::builders::Event<::std::sync::Arc<M>, M, SnapshotFilter> {
184 self.0.event()
185 }
186 pub fn transfer_filter(
188 &self,
189 ) -> ::ethers_contract::builders::Event<::std::sync::Arc<M>, M, TransferFilter> {
190 self.0.event()
191 }
192 pub fn events(
194 &self,
195 ) -> ::ethers_contract::builders::Event<
196 ::std::sync::Arc<M>,
197 M,
198 ERC20SnapshotEvents,
199 > {
200 self.0.event_with_filter(::core::default::Default::default())
201 }
202 }
203 impl<M: ::ethers_providers::Middleware> From<::ethers_contract::Contract<M>>
204 for ERC20Snapshot<M> {
205 fn from(contract: ::ethers_contract::Contract<M>) -> Self {
206 Self::new(contract.address(), contract.client())
207 }
208 }
209 #[derive(
210 Clone,
211 ::ethers_contract::EthEvent,
212 ::ethers_contract::EthDisplay,
213 Default,
214 Debug,
215 PartialEq,
216 Eq,
217 Hash
218 )]
219 #[ethevent(name = "Approval", abi = "Approval(address,address,uint256)")]
220 pub struct ApprovalFilter {
221 #[ethevent(indexed)]
222 pub owner: ::ethers_core::types::Address,
223 #[ethevent(indexed)]
224 pub spender: ::ethers_core::types::Address,
225 pub value: ::ethers_core::types::U256,
226 }
227 #[derive(
228 Clone,
229 ::ethers_contract::EthEvent,
230 ::ethers_contract::EthDisplay,
231 Default,
232 Debug,
233 PartialEq,
234 Eq,
235 Hash
236 )]
237 #[ethevent(name = "Snapshot", abi = "Snapshot(uint256)")]
238 pub struct SnapshotFilter {
239 pub id: ::ethers_core::types::U256,
240 }
241 #[derive(
242 Clone,
243 ::ethers_contract::EthEvent,
244 ::ethers_contract::EthDisplay,
245 Default,
246 Debug,
247 PartialEq,
248 Eq,
249 Hash
250 )]
251 #[ethevent(name = "Transfer", abi = "Transfer(address,address,uint256)")]
252 pub struct TransferFilter {
253 #[ethevent(indexed)]
254 pub from: ::ethers_core::types::Address,
255 #[ethevent(indexed)]
256 pub to: ::ethers_core::types::Address,
257 pub value: ::ethers_core::types::U256,
258 }
259 #[derive(Clone, ::ethers_contract::EthAbiType, Debug, PartialEq, Eq, Hash)]
261 pub enum ERC20SnapshotEvents {
262 ApprovalFilter(ApprovalFilter),
263 SnapshotFilter(SnapshotFilter),
264 TransferFilter(TransferFilter),
265 }
266 impl ::ethers_contract::EthLogDecode for ERC20SnapshotEvents {
267 fn decode_log(
268 log: &::ethers_core::abi::RawLog,
269 ) -> ::core::result::Result<Self, ::ethers_core::abi::Error> {
270 if let Ok(decoded) = ApprovalFilter::decode_log(log) {
271 return Ok(ERC20SnapshotEvents::ApprovalFilter(decoded));
272 }
273 if let Ok(decoded) = SnapshotFilter::decode_log(log) {
274 return Ok(ERC20SnapshotEvents::SnapshotFilter(decoded));
275 }
276 if let Ok(decoded) = TransferFilter::decode_log(log) {
277 return Ok(ERC20SnapshotEvents::TransferFilter(decoded));
278 }
279 Err(::ethers_core::abi::Error::InvalidData)
280 }
281 }
282 impl ::core::fmt::Display for ERC20SnapshotEvents {
283 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
284 match self {
285 Self::ApprovalFilter(element) => ::core::fmt::Display::fmt(element, f),
286 Self::SnapshotFilter(element) => ::core::fmt::Display::fmt(element, f),
287 Self::TransferFilter(element) => ::core::fmt::Display::fmt(element, f),
288 }
289 }
290 }
291 impl ::core::convert::From<ApprovalFilter> for ERC20SnapshotEvents {
292 fn from(value: ApprovalFilter) -> Self {
293 Self::ApprovalFilter(value)
294 }
295 }
296 impl ::core::convert::From<SnapshotFilter> for ERC20SnapshotEvents {
297 fn from(value: SnapshotFilter) -> Self {
298 Self::SnapshotFilter(value)
299 }
300 }
301 impl ::core::convert::From<TransferFilter> for ERC20SnapshotEvents {
302 fn from(value: TransferFilter) -> Self {
303 Self::TransferFilter(value)
304 }
305 }
306 #[derive(
308 Clone,
309 ::ethers_contract::EthCall,
310 ::ethers_contract::EthDisplay,
311 Default,
312 Debug,
313 PartialEq,
314 Eq,
315 Hash
316 )]
317 #[ethcall(name = "allowance", abi = "allowance(address,address)")]
318 pub struct AllowanceCall {
319 pub owner: ::ethers_core::types::Address,
320 pub spender: ::ethers_core::types::Address,
321 }
322 #[derive(
324 Clone,
325 ::ethers_contract::EthCall,
326 ::ethers_contract::EthDisplay,
327 Default,
328 Debug,
329 PartialEq,
330 Eq,
331 Hash
332 )]
333 #[ethcall(name = "approve", abi = "approve(address,uint256)")]
334 pub struct ApproveCall {
335 pub spender: ::ethers_core::types::Address,
336 pub amount: ::ethers_core::types::U256,
337 }
338 #[derive(
340 Clone,
341 ::ethers_contract::EthCall,
342 ::ethers_contract::EthDisplay,
343 Default,
344 Debug,
345 PartialEq,
346 Eq,
347 Hash
348 )]
349 #[ethcall(name = "balanceOf", abi = "balanceOf(address)")]
350 pub struct BalanceOfCall {
351 pub account: ::ethers_core::types::Address,
352 }
353 #[derive(
355 Clone,
356 ::ethers_contract::EthCall,
357 ::ethers_contract::EthDisplay,
358 Default,
359 Debug,
360 PartialEq,
361 Eq,
362 Hash
363 )]
364 #[ethcall(name = "balanceOfAt", abi = "balanceOfAt(address,uint256)")]
365 pub struct BalanceOfAtCall {
366 pub account: ::ethers_core::types::Address,
367 pub snapshot_id: ::ethers_core::types::U256,
368 }
369 #[derive(
371 Clone,
372 ::ethers_contract::EthCall,
373 ::ethers_contract::EthDisplay,
374 Default,
375 Debug,
376 PartialEq,
377 Eq,
378 Hash
379 )]
380 #[ethcall(name = "decimals", abi = "decimals()")]
381 pub struct DecimalsCall;
382 #[derive(
384 Clone,
385 ::ethers_contract::EthCall,
386 ::ethers_contract::EthDisplay,
387 Default,
388 Debug,
389 PartialEq,
390 Eq,
391 Hash
392 )]
393 #[ethcall(name = "decreaseAllowance", abi = "decreaseAllowance(address,uint256)")]
394 pub struct DecreaseAllowanceCall {
395 pub spender: ::ethers_core::types::Address,
396 pub subtracted_value: ::ethers_core::types::U256,
397 }
398 #[derive(
400 Clone,
401 ::ethers_contract::EthCall,
402 ::ethers_contract::EthDisplay,
403 Default,
404 Debug,
405 PartialEq,
406 Eq,
407 Hash
408 )]
409 #[ethcall(name = "increaseAllowance", abi = "increaseAllowance(address,uint256)")]
410 pub struct IncreaseAllowanceCall {
411 pub spender: ::ethers_core::types::Address,
412 pub added_value: ::ethers_core::types::U256,
413 }
414 #[derive(
416 Clone,
417 ::ethers_contract::EthCall,
418 ::ethers_contract::EthDisplay,
419 Default,
420 Debug,
421 PartialEq,
422 Eq,
423 Hash
424 )]
425 #[ethcall(name = "name", abi = "name()")]
426 pub struct NameCall;
427 #[derive(
429 Clone,
430 ::ethers_contract::EthCall,
431 ::ethers_contract::EthDisplay,
432 Default,
433 Debug,
434 PartialEq,
435 Eq,
436 Hash
437 )]
438 #[ethcall(name = "symbol", abi = "symbol()")]
439 pub struct SymbolCall;
440 #[derive(
442 Clone,
443 ::ethers_contract::EthCall,
444 ::ethers_contract::EthDisplay,
445 Default,
446 Debug,
447 PartialEq,
448 Eq,
449 Hash
450 )]
451 #[ethcall(name = "totalSupply", abi = "totalSupply()")]
452 pub struct TotalSupplyCall;
453 #[derive(
455 Clone,
456 ::ethers_contract::EthCall,
457 ::ethers_contract::EthDisplay,
458 Default,
459 Debug,
460 PartialEq,
461 Eq,
462 Hash
463 )]
464 #[ethcall(name = "totalSupplyAt", abi = "totalSupplyAt(uint256)")]
465 pub struct TotalSupplyAtCall {
466 pub snapshot_id: ::ethers_core::types::U256,
467 }
468 #[derive(
470 Clone,
471 ::ethers_contract::EthCall,
472 ::ethers_contract::EthDisplay,
473 Default,
474 Debug,
475 PartialEq,
476 Eq,
477 Hash
478 )]
479 #[ethcall(name = "transfer", abi = "transfer(address,uint256)")]
480 pub struct TransferCall {
481 pub to: ::ethers_core::types::Address,
482 pub amount: ::ethers_core::types::U256,
483 }
484 #[derive(
486 Clone,
487 ::ethers_contract::EthCall,
488 ::ethers_contract::EthDisplay,
489 Default,
490 Debug,
491 PartialEq,
492 Eq,
493 Hash
494 )]
495 #[ethcall(name = "transferFrom", abi = "transferFrom(address,address,uint256)")]
496 pub struct TransferFromCall {
497 pub from: ::ethers_core::types::Address,
498 pub to: ::ethers_core::types::Address,
499 pub amount: ::ethers_core::types::U256,
500 }
501 #[derive(Clone, ::ethers_contract::EthAbiType, Debug, PartialEq, Eq, Hash)]
503 pub enum ERC20SnapshotCalls {
504 Allowance(AllowanceCall),
505 Approve(ApproveCall),
506 BalanceOf(BalanceOfCall),
507 BalanceOfAt(BalanceOfAtCall),
508 Decimals(DecimalsCall),
509 DecreaseAllowance(DecreaseAllowanceCall),
510 IncreaseAllowance(IncreaseAllowanceCall),
511 Name(NameCall),
512 Symbol(SymbolCall),
513 TotalSupply(TotalSupplyCall),
514 TotalSupplyAt(TotalSupplyAtCall),
515 Transfer(TransferCall),
516 TransferFrom(TransferFromCall),
517 }
518 impl ::ethers_core::abi::AbiDecode for ERC20SnapshotCalls {
519 fn decode(
520 data: impl AsRef<[u8]>,
521 ) -> ::core::result::Result<Self, ::ethers_core::abi::AbiError> {
522 let data = data.as_ref();
523 if let Ok(decoded)
524 = <AllowanceCall as ::ethers_core::abi::AbiDecode>::decode(data) {
525 return Ok(Self::Allowance(decoded));
526 }
527 if let Ok(decoded)
528 = <ApproveCall as ::ethers_core::abi::AbiDecode>::decode(data) {
529 return Ok(Self::Approve(decoded));
530 }
531 if let Ok(decoded)
532 = <BalanceOfCall as ::ethers_core::abi::AbiDecode>::decode(data) {
533 return Ok(Self::BalanceOf(decoded));
534 }
535 if let Ok(decoded)
536 = <BalanceOfAtCall as ::ethers_core::abi::AbiDecode>::decode(data) {
537 return Ok(Self::BalanceOfAt(decoded));
538 }
539 if let Ok(decoded)
540 = <DecimalsCall as ::ethers_core::abi::AbiDecode>::decode(data) {
541 return Ok(Self::Decimals(decoded));
542 }
543 if let Ok(decoded)
544 = <DecreaseAllowanceCall as ::ethers_core::abi::AbiDecode>::decode(
545 data,
546 ) {
547 return Ok(Self::DecreaseAllowance(decoded));
548 }
549 if let Ok(decoded)
550 = <IncreaseAllowanceCall as ::ethers_core::abi::AbiDecode>::decode(
551 data,
552 ) {
553 return Ok(Self::IncreaseAllowance(decoded));
554 }
555 if let Ok(decoded)
556 = <NameCall as ::ethers_core::abi::AbiDecode>::decode(data) {
557 return Ok(Self::Name(decoded));
558 }
559 if let Ok(decoded)
560 = <SymbolCall as ::ethers_core::abi::AbiDecode>::decode(data) {
561 return Ok(Self::Symbol(decoded));
562 }
563 if let Ok(decoded)
564 = <TotalSupplyCall as ::ethers_core::abi::AbiDecode>::decode(data) {
565 return Ok(Self::TotalSupply(decoded));
566 }
567 if let Ok(decoded)
568 = <TotalSupplyAtCall as ::ethers_core::abi::AbiDecode>::decode(data) {
569 return Ok(Self::TotalSupplyAt(decoded));
570 }
571 if let Ok(decoded)
572 = <TransferCall as ::ethers_core::abi::AbiDecode>::decode(data) {
573 return Ok(Self::Transfer(decoded));
574 }
575 if let Ok(decoded)
576 = <TransferFromCall as ::ethers_core::abi::AbiDecode>::decode(data) {
577 return Ok(Self::TransferFrom(decoded));
578 }
579 Err(::ethers_core::abi::Error::InvalidData.into())
580 }
581 }
582 impl ::ethers_core::abi::AbiEncode for ERC20SnapshotCalls {
583 fn encode(self) -> Vec<u8> {
584 match self {
585 Self::Allowance(element) => {
586 ::ethers_core::abi::AbiEncode::encode(element)
587 }
588 Self::Approve(element) => ::ethers_core::abi::AbiEncode::encode(element),
589 Self::BalanceOf(element) => {
590 ::ethers_core::abi::AbiEncode::encode(element)
591 }
592 Self::BalanceOfAt(element) => {
593 ::ethers_core::abi::AbiEncode::encode(element)
594 }
595 Self::Decimals(element) => ::ethers_core::abi::AbiEncode::encode(element),
596 Self::DecreaseAllowance(element) => {
597 ::ethers_core::abi::AbiEncode::encode(element)
598 }
599 Self::IncreaseAllowance(element) => {
600 ::ethers_core::abi::AbiEncode::encode(element)
601 }
602 Self::Name(element) => ::ethers_core::abi::AbiEncode::encode(element),
603 Self::Symbol(element) => ::ethers_core::abi::AbiEncode::encode(element),
604 Self::TotalSupply(element) => {
605 ::ethers_core::abi::AbiEncode::encode(element)
606 }
607 Self::TotalSupplyAt(element) => {
608 ::ethers_core::abi::AbiEncode::encode(element)
609 }
610 Self::Transfer(element) => ::ethers_core::abi::AbiEncode::encode(element),
611 Self::TransferFrom(element) => {
612 ::ethers_core::abi::AbiEncode::encode(element)
613 }
614 }
615 }
616 }
617 impl ::core::fmt::Display for ERC20SnapshotCalls {
618 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
619 match self {
620 Self::Allowance(element) => ::core::fmt::Display::fmt(element, f),
621 Self::Approve(element) => ::core::fmt::Display::fmt(element, f),
622 Self::BalanceOf(element) => ::core::fmt::Display::fmt(element, f),
623 Self::BalanceOfAt(element) => ::core::fmt::Display::fmt(element, f),
624 Self::Decimals(element) => ::core::fmt::Display::fmt(element, f),
625 Self::DecreaseAllowance(element) => ::core::fmt::Display::fmt(element, f),
626 Self::IncreaseAllowance(element) => ::core::fmt::Display::fmt(element, f),
627 Self::Name(element) => ::core::fmt::Display::fmt(element, f),
628 Self::Symbol(element) => ::core::fmt::Display::fmt(element, f),
629 Self::TotalSupply(element) => ::core::fmt::Display::fmt(element, f),
630 Self::TotalSupplyAt(element) => ::core::fmt::Display::fmt(element, f),
631 Self::Transfer(element) => ::core::fmt::Display::fmt(element, f),
632 Self::TransferFrom(element) => ::core::fmt::Display::fmt(element, f),
633 }
634 }
635 }
636 impl ::core::convert::From<AllowanceCall> for ERC20SnapshotCalls {
637 fn from(value: AllowanceCall) -> Self {
638 Self::Allowance(value)
639 }
640 }
641 impl ::core::convert::From<ApproveCall> for ERC20SnapshotCalls {
642 fn from(value: ApproveCall) -> Self {
643 Self::Approve(value)
644 }
645 }
646 impl ::core::convert::From<BalanceOfCall> for ERC20SnapshotCalls {
647 fn from(value: BalanceOfCall) -> Self {
648 Self::BalanceOf(value)
649 }
650 }
651 impl ::core::convert::From<BalanceOfAtCall> for ERC20SnapshotCalls {
652 fn from(value: BalanceOfAtCall) -> Self {
653 Self::BalanceOfAt(value)
654 }
655 }
656 impl ::core::convert::From<DecimalsCall> for ERC20SnapshotCalls {
657 fn from(value: DecimalsCall) -> Self {
658 Self::Decimals(value)
659 }
660 }
661 impl ::core::convert::From<DecreaseAllowanceCall> for ERC20SnapshotCalls {
662 fn from(value: DecreaseAllowanceCall) -> Self {
663 Self::DecreaseAllowance(value)
664 }
665 }
666 impl ::core::convert::From<IncreaseAllowanceCall> for ERC20SnapshotCalls {
667 fn from(value: IncreaseAllowanceCall) -> Self {
668 Self::IncreaseAllowance(value)
669 }
670 }
671 impl ::core::convert::From<NameCall> for ERC20SnapshotCalls {
672 fn from(value: NameCall) -> Self {
673 Self::Name(value)
674 }
675 }
676 impl ::core::convert::From<SymbolCall> for ERC20SnapshotCalls {
677 fn from(value: SymbolCall) -> Self {
678 Self::Symbol(value)
679 }
680 }
681 impl ::core::convert::From<TotalSupplyCall> for ERC20SnapshotCalls {
682 fn from(value: TotalSupplyCall) -> Self {
683 Self::TotalSupply(value)
684 }
685 }
686 impl ::core::convert::From<TotalSupplyAtCall> for ERC20SnapshotCalls {
687 fn from(value: TotalSupplyAtCall) -> Self {
688 Self::TotalSupplyAt(value)
689 }
690 }
691 impl ::core::convert::From<TransferCall> for ERC20SnapshotCalls {
692 fn from(value: TransferCall) -> Self {
693 Self::Transfer(value)
694 }
695 }
696 impl ::core::convert::From<TransferFromCall> for ERC20SnapshotCalls {
697 fn from(value: TransferFromCall) -> Self {
698 Self::TransferFrom(value)
699 }
700 }
701 #[derive(
703 Clone,
704 ::ethers_contract::EthAbiType,
705 ::ethers_contract::EthAbiCodec,
706 Default,
707 Debug,
708 PartialEq,
709 Eq,
710 Hash
711 )]
712 pub struct AllowanceReturn(pub ::ethers_core::types::U256);
713 #[derive(
715 Clone,
716 ::ethers_contract::EthAbiType,
717 ::ethers_contract::EthAbiCodec,
718 Default,
719 Debug,
720 PartialEq,
721 Eq,
722 Hash
723 )]
724 pub struct ApproveReturn(pub bool);
725 #[derive(
727 Clone,
728 ::ethers_contract::EthAbiType,
729 ::ethers_contract::EthAbiCodec,
730 Default,
731 Debug,
732 PartialEq,
733 Eq,
734 Hash
735 )]
736 pub struct BalanceOfReturn(pub ::ethers_core::types::U256);
737 #[derive(
739 Clone,
740 ::ethers_contract::EthAbiType,
741 ::ethers_contract::EthAbiCodec,
742 Default,
743 Debug,
744 PartialEq,
745 Eq,
746 Hash
747 )]
748 pub struct BalanceOfAtReturn(pub ::ethers_core::types::U256);
749 #[derive(
751 Clone,
752 ::ethers_contract::EthAbiType,
753 ::ethers_contract::EthAbiCodec,
754 Default,
755 Debug,
756 PartialEq,
757 Eq,
758 Hash
759 )]
760 pub struct DecimalsReturn(pub u8);
761 #[derive(
763 Clone,
764 ::ethers_contract::EthAbiType,
765 ::ethers_contract::EthAbiCodec,
766 Default,
767 Debug,
768 PartialEq,
769 Eq,
770 Hash
771 )]
772 pub struct DecreaseAllowanceReturn(pub bool);
773 #[derive(
775 Clone,
776 ::ethers_contract::EthAbiType,
777 ::ethers_contract::EthAbiCodec,
778 Default,
779 Debug,
780 PartialEq,
781 Eq,
782 Hash
783 )]
784 pub struct IncreaseAllowanceReturn(pub bool);
785 #[derive(
787 Clone,
788 ::ethers_contract::EthAbiType,
789 ::ethers_contract::EthAbiCodec,
790 Default,
791 Debug,
792 PartialEq,
793 Eq,
794 Hash
795 )]
796 pub struct NameReturn(pub ::std::string::String);
797 #[derive(
799 Clone,
800 ::ethers_contract::EthAbiType,
801 ::ethers_contract::EthAbiCodec,
802 Default,
803 Debug,
804 PartialEq,
805 Eq,
806 Hash
807 )]
808 pub struct SymbolReturn(pub ::std::string::String);
809 #[derive(
811 Clone,
812 ::ethers_contract::EthAbiType,
813 ::ethers_contract::EthAbiCodec,
814 Default,
815 Debug,
816 PartialEq,
817 Eq,
818 Hash
819 )]
820 pub struct TotalSupplyReturn(pub ::ethers_core::types::U256);
821 #[derive(
823 Clone,
824 ::ethers_contract::EthAbiType,
825 ::ethers_contract::EthAbiCodec,
826 Default,
827 Debug,
828 PartialEq,
829 Eq,
830 Hash
831 )]
832 pub struct TotalSupplyAtReturn(pub ::ethers_core::types::U256);
833 #[derive(
835 Clone,
836 ::ethers_contract::EthAbiType,
837 ::ethers_contract::EthAbiCodec,
838 Default,
839 Debug,
840 PartialEq,
841 Eq,
842 Hash
843 )]
844 pub struct TransferReturn(pub bool);
845 #[derive(
847 Clone,
848 ::ethers_contract::EthAbiType,
849 ::ethers_contract::EthAbiCodec,
850 Default,
851 Debug,
852 PartialEq,
853 Eq,
854 Hash
855 )]
856 pub struct TransferFromReturn(pub bool);
857}