1pub use erc20_wrapper::*;
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_wrapper {
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\":\"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\":[],\"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\":\"account\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"depositFor\",\"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\":\"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\":[]}]},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"underlying\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"withdrawTo\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\",\"components\":[]}]}]";
15 pub static ERC20WRAPPER_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 ERC20Wrapper<M>(::ethers_contract::Contract<M>);
19 impl<M> ::core::clone::Clone for ERC20Wrapper<M> {
20 fn clone(&self) -> Self {
21 Self(::core::clone::Clone::clone(&self.0))
22 }
23 }
24 impl<M> ::core::ops::Deref for ERC20Wrapper<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 ERC20Wrapper<M> {
31 fn deref_mut(&mut self) -> &mut Self::Target {
32 &mut self.0
33 }
34 }
35 impl<M> ::core::fmt::Debug for ERC20Wrapper<M> {
36 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
37 f.debug_tuple(stringify!(ERC20Wrapper)).field(&self.address()).finish()
38 }
39 }
40 impl<M: ::ethers_providers::Middleware> ERC20Wrapper<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 ERC20WRAPPER_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 decimals(&self) -> ::ethers_contract::builders::ContractCall<M, u8> {
86 self.0
87 .method_hash([49, 60, 229, 103], ())
88 .expect("method not found (this should never happen)")
89 }
90 pub fn decrease_allowance(
92 &self,
93 spender: ::ethers_core::types::Address,
94 subtracted_value: ::ethers_core::types::U256,
95 ) -> ::ethers_contract::builders::ContractCall<M, bool> {
96 self.0
97 .method_hash([164, 87, 194, 215], (spender, subtracted_value))
98 .expect("method not found (this should never happen)")
99 }
100 pub fn deposit_for(
102 &self,
103 account: ::ethers_core::types::Address,
104 amount: ::ethers_core::types::U256,
105 ) -> ::ethers_contract::builders::ContractCall<M, bool> {
106 self.0
107 .method_hash([47, 79, 33, 226], (account, amount))
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 transfer(
146 &self,
147 to: ::ethers_core::types::Address,
148 amount: ::ethers_core::types::U256,
149 ) -> ::ethers_contract::builders::ContractCall<M, bool> {
150 self.0
151 .method_hash([169, 5, 156, 187], (to, amount))
152 .expect("method not found (this should never happen)")
153 }
154 pub fn transfer_from(
156 &self,
157 from: ::ethers_core::types::Address,
158 to: ::ethers_core::types::Address,
159 amount: ::ethers_core::types::U256,
160 ) -> ::ethers_contract::builders::ContractCall<M, bool> {
161 self.0
162 .method_hash([35, 184, 114, 221], (from, to, amount))
163 .expect("method not found (this should never happen)")
164 }
165 pub fn underlying(
167 &self,
168 ) -> ::ethers_contract::builders::ContractCall<
169 M,
170 ::ethers_core::types::Address,
171 > {
172 self.0
173 .method_hash([111, 48, 125, 195], ())
174 .expect("method not found (this should never happen)")
175 }
176 pub fn withdraw_to(
178 &self,
179 account: ::ethers_core::types::Address,
180 amount: ::ethers_core::types::U256,
181 ) -> ::ethers_contract::builders::ContractCall<M, bool> {
182 self.0
183 .method_hash([32, 92, 40, 120], (account, amount))
184 .expect("method not found (this should never happen)")
185 }
186 pub fn approval_filter(
188 &self,
189 ) -> ::ethers_contract::builders::Event<::std::sync::Arc<M>, M, ApprovalFilter> {
190 self.0.event()
191 }
192 pub fn transfer_filter(
194 &self,
195 ) -> ::ethers_contract::builders::Event<::std::sync::Arc<M>, M, TransferFilter> {
196 self.0.event()
197 }
198 pub fn events(
200 &self,
201 ) -> ::ethers_contract::builders::Event<
202 ::std::sync::Arc<M>,
203 M,
204 ERC20WrapperEvents,
205 > {
206 self.0.event_with_filter(::core::default::Default::default())
207 }
208 }
209 impl<M: ::ethers_providers::Middleware> From<::ethers_contract::Contract<M>>
210 for ERC20Wrapper<M> {
211 fn from(contract: ::ethers_contract::Contract<M>) -> Self {
212 Self::new(contract.address(), contract.client())
213 }
214 }
215 #[derive(
216 Clone,
217 ::ethers_contract::EthEvent,
218 ::ethers_contract::EthDisplay,
219 Default,
220 Debug,
221 PartialEq,
222 Eq,
223 Hash
224 )]
225 #[ethevent(name = "Approval", abi = "Approval(address,address,uint256)")]
226 pub struct ApprovalFilter {
227 #[ethevent(indexed)]
228 pub owner: ::ethers_core::types::Address,
229 #[ethevent(indexed)]
230 pub spender: ::ethers_core::types::Address,
231 pub value: ::ethers_core::types::U256,
232 }
233 #[derive(
234 Clone,
235 ::ethers_contract::EthEvent,
236 ::ethers_contract::EthDisplay,
237 Default,
238 Debug,
239 PartialEq,
240 Eq,
241 Hash
242 )]
243 #[ethevent(name = "Transfer", abi = "Transfer(address,address,uint256)")]
244 pub struct TransferFilter {
245 #[ethevent(indexed)]
246 pub from: ::ethers_core::types::Address,
247 #[ethevent(indexed)]
248 pub to: ::ethers_core::types::Address,
249 pub value: ::ethers_core::types::U256,
250 }
251 #[derive(Clone, ::ethers_contract::EthAbiType, Debug, PartialEq, Eq, Hash)]
253 pub enum ERC20WrapperEvents {
254 ApprovalFilter(ApprovalFilter),
255 TransferFilter(TransferFilter),
256 }
257 impl ::ethers_contract::EthLogDecode for ERC20WrapperEvents {
258 fn decode_log(
259 log: &::ethers_core::abi::RawLog,
260 ) -> ::core::result::Result<Self, ::ethers_core::abi::Error> {
261 if let Ok(decoded) = ApprovalFilter::decode_log(log) {
262 return Ok(ERC20WrapperEvents::ApprovalFilter(decoded));
263 }
264 if let Ok(decoded) = TransferFilter::decode_log(log) {
265 return Ok(ERC20WrapperEvents::TransferFilter(decoded));
266 }
267 Err(::ethers_core::abi::Error::InvalidData)
268 }
269 }
270 impl ::core::fmt::Display for ERC20WrapperEvents {
271 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
272 match self {
273 Self::ApprovalFilter(element) => ::core::fmt::Display::fmt(element, f),
274 Self::TransferFilter(element) => ::core::fmt::Display::fmt(element, f),
275 }
276 }
277 }
278 impl ::core::convert::From<ApprovalFilter> for ERC20WrapperEvents {
279 fn from(value: ApprovalFilter) -> Self {
280 Self::ApprovalFilter(value)
281 }
282 }
283 impl ::core::convert::From<TransferFilter> for ERC20WrapperEvents {
284 fn from(value: TransferFilter) -> Self {
285 Self::TransferFilter(value)
286 }
287 }
288 #[derive(
290 Clone,
291 ::ethers_contract::EthCall,
292 ::ethers_contract::EthDisplay,
293 Default,
294 Debug,
295 PartialEq,
296 Eq,
297 Hash
298 )]
299 #[ethcall(name = "allowance", abi = "allowance(address,address)")]
300 pub struct AllowanceCall {
301 pub owner: ::ethers_core::types::Address,
302 pub spender: ::ethers_core::types::Address,
303 }
304 #[derive(
306 Clone,
307 ::ethers_contract::EthCall,
308 ::ethers_contract::EthDisplay,
309 Default,
310 Debug,
311 PartialEq,
312 Eq,
313 Hash
314 )]
315 #[ethcall(name = "approve", abi = "approve(address,uint256)")]
316 pub struct ApproveCall {
317 pub spender: ::ethers_core::types::Address,
318 pub amount: ::ethers_core::types::U256,
319 }
320 #[derive(
322 Clone,
323 ::ethers_contract::EthCall,
324 ::ethers_contract::EthDisplay,
325 Default,
326 Debug,
327 PartialEq,
328 Eq,
329 Hash
330 )]
331 #[ethcall(name = "balanceOf", abi = "balanceOf(address)")]
332 pub struct BalanceOfCall {
333 pub account: ::ethers_core::types::Address,
334 }
335 #[derive(
337 Clone,
338 ::ethers_contract::EthCall,
339 ::ethers_contract::EthDisplay,
340 Default,
341 Debug,
342 PartialEq,
343 Eq,
344 Hash
345 )]
346 #[ethcall(name = "decimals", abi = "decimals()")]
347 pub struct DecimalsCall;
348 #[derive(
350 Clone,
351 ::ethers_contract::EthCall,
352 ::ethers_contract::EthDisplay,
353 Default,
354 Debug,
355 PartialEq,
356 Eq,
357 Hash
358 )]
359 #[ethcall(name = "decreaseAllowance", abi = "decreaseAllowance(address,uint256)")]
360 pub struct DecreaseAllowanceCall {
361 pub spender: ::ethers_core::types::Address,
362 pub subtracted_value: ::ethers_core::types::U256,
363 }
364 #[derive(
366 Clone,
367 ::ethers_contract::EthCall,
368 ::ethers_contract::EthDisplay,
369 Default,
370 Debug,
371 PartialEq,
372 Eq,
373 Hash
374 )]
375 #[ethcall(name = "depositFor", abi = "depositFor(address,uint256)")]
376 pub struct DepositForCall {
377 pub account: ::ethers_core::types::Address,
378 pub amount: ::ethers_core::types::U256,
379 }
380 #[derive(
382 Clone,
383 ::ethers_contract::EthCall,
384 ::ethers_contract::EthDisplay,
385 Default,
386 Debug,
387 PartialEq,
388 Eq,
389 Hash
390 )]
391 #[ethcall(name = "increaseAllowance", abi = "increaseAllowance(address,uint256)")]
392 pub struct IncreaseAllowanceCall {
393 pub spender: ::ethers_core::types::Address,
394 pub added_value: ::ethers_core::types::U256,
395 }
396 #[derive(
398 Clone,
399 ::ethers_contract::EthCall,
400 ::ethers_contract::EthDisplay,
401 Default,
402 Debug,
403 PartialEq,
404 Eq,
405 Hash
406 )]
407 #[ethcall(name = "name", abi = "name()")]
408 pub struct NameCall;
409 #[derive(
411 Clone,
412 ::ethers_contract::EthCall,
413 ::ethers_contract::EthDisplay,
414 Default,
415 Debug,
416 PartialEq,
417 Eq,
418 Hash
419 )]
420 #[ethcall(name = "symbol", abi = "symbol()")]
421 pub struct SymbolCall;
422 #[derive(
424 Clone,
425 ::ethers_contract::EthCall,
426 ::ethers_contract::EthDisplay,
427 Default,
428 Debug,
429 PartialEq,
430 Eq,
431 Hash
432 )]
433 #[ethcall(name = "totalSupply", abi = "totalSupply()")]
434 pub struct TotalSupplyCall;
435 #[derive(
437 Clone,
438 ::ethers_contract::EthCall,
439 ::ethers_contract::EthDisplay,
440 Default,
441 Debug,
442 PartialEq,
443 Eq,
444 Hash
445 )]
446 #[ethcall(name = "transfer", abi = "transfer(address,uint256)")]
447 pub struct TransferCall {
448 pub to: ::ethers_core::types::Address,
449 pub amount: ::ethers_core::types::U256,
450 }
451 #[derive(
453 Clone,
454 ::ethers_contract::EthCall,
455 ::ethers_contract::EthDisplay,
456 Default,
457 Debug,
458 PartialEq,
459 Eq,
460 Hash
461 )]
462 #[ethcall(name = "transferFrom", abi = "transferFrom(address,address,uint256)")]
463 pub struct TransferFromCall {
464 pub from: ::ethers_core::types::Address,
465 pub to: ::ethers_core::types::Address,
466 pub amount: ::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 = "underlying", abi = "underlying()")]
480 pub struct UnderlyingCall;
481 #[derive(
483 Clone,
484 ::ethers_contract::EthCall,
485 ::ethers_contract::EthDisplay,
486 Default,
487 Debug,
488 PartialEq,
489 Eq,
490 Hash
491 )]
492 #[ethcall(name = "withdrawTo", abi = "withdrawTo(address,uint256)")]
493 pub struct WithdrawToCall {
494 pub account: ::ethers_core::types::Address,
495 pub amount: ::ethers_core::types::U256,
496 }
497 #[derive(Clone, ::ethers_contract::EthAbiType, Debug, PartialEq, Eq, Hash)]
499 pub enum ERC20WrapperCalls {
500 Allowance(AllowanceCall),
501 Approve(ApproveCall),
502 BalanceOf(BalanceOfCall),
503 Decimals(DecimalsCall),
504 DecreaseAllowance(DecreaseAllowanceCall),
505 DepositFor(DepositForCall),
506 IncreaseAllowance(IncreaseAllowanceCall),
507 Name(NameCall),
508 Symbol(SymbolCall),
509 TotalSupply(TotalSupplyCall),
510 Transfer(TransferCall),
511 TransferFrom(TransferFromCall),
512 Underlying(UnderlyingCall),
513 WithdrawTo(WithdrawToCall),
514 }
515 impl ::ethers_core::abi::AbiDecode for ERC20WrapperCalls {
516 fn decode(
517 data: impl AsRef<[u8]>,
518 ) -> ::core::result::Result<Self, ::ethers_core::abi::AbiError> {
519 let data = data.as_ref();
520 if let Ok(decoded)
521 = <AllowanceCall as ::ethers_core::abi::AbiDecode>::decode(data) {
522 return Ok(Self::Allowance(decoded));
523 }
524 if let Ok(decoded)
525 = <ApproveCall as ::ethers_core::abi::AbiDecode>::decode(data) {
526 return Ok(Self::Approve(decoded));
527 }
528 if let Ok(decoded)
529 = <BalanceOfCall as ::ethers_core::abi::AbiDecode>::decode(data) {
530 return Ok(Self::BalanceOf(decoded));
531 }
532 if let Ok(decoded)
533 = <DecimalsCall as ::ethers_core::abi::AbiDecode>::decode(data) {
534 return Ok(Self::Decimals(decoded));
535 }
536 if let Ok(decoded)
537 = <DecreaseAllowanceCall as ::ethers_core::abi::AbiDecode>::decode(
538 data,
539 ) {
540 return Ok(Self::DecreaseAllowance(decoded));
541 }
542 if let Ok(decoded)
543 = <DepositForCall as ::ethers_core::abi::AbiDecode>::decode(data) {
544 return Ok(Self::DepositFor(decoded));
545 }
546 if let Ok(decoded)
547 = <IncreaseAllowanceCall as ::ethers_core::abi::AbiDecode>::decode(
548 data,
549 ) {
550 return Ok(Self::IncreaseAllowance(decoded));
551 }
552 if let Ok(decoded)
553 = <NameCall as ::ethers_core::abi::AbiDecode>::decode(data) {
554 return Ok(Self::Name(decoded));
555 }
556 if let Ok(decoded)
557 = <SymbolCall as ::ethers_core::abi::AbiDecode>::decode(data) {
558 return Ok(Self::Symbol(decoded));
559 }
560 if let Ok(decoded)
561 = <TotalSupplyCall as ::ethers_core::abi::AbiDecode>::decode(data) {
562 return Ok(Self::TotalSupply(decoded));
563 }
564 if let Ok(decoded)
565 = <TransferCall as ::ethers_core::abi::AbiDecode>::decode(data) {
566 return Ok(Self::Transfer(decoded));
567 }
568 if let Ok(decoded)
569 = <TransferFromCall as ::ethers_core::abi::AbiDecode>::decode(data) {
570 return Ok(Self::TransferFrom(decoded));
571 }
572 if let Ok(decoded)
573 = <UnderlyingCall as ::ethers_core::abi::AbiDecode>::decode(data) {
574 return Ok(Self::Underlying(decoded));
575 }
576 if let Ok(decoded)
577 = <WithdrawToCall as ::ethers_core::abi::AbiDecode>::decode(data) {
578 return Ok(Self::WithdrawTo(decoded));
579 }
580 Err(::ethers_core::abi::Error::InvalidData.into())
581 }
582 }
583 impl ::ethers_core::abi::AbiEncode for ERC20WrapperCalls {
584 fn encode(self) -> Vec<u8> {
585 match self {
586 Self::Allowance(element) => {
587 ::ethers_core::abi::AbiEncode::encode(element)
588 }
589 Self::Approve(element) => ::ethers_core::abi::AbiEncode::encode(element),
590 Self::BalanceOf(element) => {
591 ::ethers_core::abi::AbiEncode::encode(element)
592 }
593 Self::Decimals(element) => ::ethers_core::abi::AbiEncode::encode(element),
594 Self::DecreaseAllowance(element) => {
595 ::ethers_core::abi::AbiEncode::encode(element)
596 }
597 Self::DepositFor(element) => {
598 ::ethers_core::abi::AbiEncode::encode(element)
599 }
600 Self::IncreaseAllowance(element) => {
601 ::ethers_core::abi::AbiEncode::encode(element)
602 }
603 Self::Name(element) => ::ethers_core::abi::AbiEncode::encode(element),
604 Self::Symbol(element) => ::ethers_core::abi::AbiEncode::encode(element),
605 Self::TotalSupply(element) => {
606 ::ethers_core::abi::AbiEncode::encode(element)
607 }
608 Self::Transfer(element) => ::ethers_core::abi::AbiEncode::encode(element),
609 Self::TransferFrom(element) => {
610 ::ethers_core::abi::AbiEncode::encode(element)
611 }
612 Self::Underlying(element) => {
613 ::ethers_core::abi::AbiEncode::encode(element)
614 }
615 Self::WithdrawTo(element) => {
616 ::ethers_core::abi::AbiEncode::encode(element)
617 }
618 }
619 }
620 }
621 impl ::core::fmt::Display for ERC20WrapperCalls {
622 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
623 match self {
624 Self::Allowance(element) => ::core::fmt::Display::fmt(element, f),
625 Self::Approve(element) => ::core::fmt::Display::fmt(element, f),
626 Self::BalanceOf(element) => ::core::fmt::Display::fmt(element, f),
627 Self::Decimals(element) => ::core::fmt::Display::fmt(element, f),
628 Self::DecreaseAllowance(element) => ::core::fmt::Display::fmt(element, f),
629 Self::DepositFor(element) => ::core::fmt::Display::fmt(element, f),
630 Self::IncreaseAllowance(element) => ::core::fmt::Display::fmt(element, f),
631 Self::Name(element) => ::core::fmt::Display::fmt(element, f),
632 Self::Symbol(element) => ::core::fmt::Display::fmt(element, f),
633 Self::TotalSupply(element) => ::core::fmt::Display::fmt(element, f),
634 Self::Transfer(element) => ::core::fmt::Display::fmt(element, f),
635 Self::TransferFrom(element) => ::core::fmt::Display::fmt(element, f),
636 Self::Underlying(element) => ::core::fmt::Display::fmt(element, f),
637 Self::WithdrawTo(element) => ::core::fmt::Display::fmt(element, f),
638 }
639 }
640 }
641 impl ::core::convert::From<AllowanceCall> for ERC20WrapperCalls {
642 fn from(value: AllowanceCall) -> Self {
643 Self::Allowance(value)
644 }
645 }
646 impl ::core::convert::From<ApproveCall> for ERC20WrapperCalls {
647 fn from(value: ApproveCall) -> Self {
648 Self::Approve(value)
649 }
650 }
651 impl ::core::convert::From<BalanceOfCall> for ERC20WrapperCalls {
652 fn from(value: BalanceOfCall) -> Self {
653 Self::BalanceOf(value)
654 }
655 }
656 impl ::core::convert::From<DecimalsCall> for ERC20WrapperCalls {
657 fn from(value: DecimalsCall) -> Self {
658 Self::Decimals(value)
659 }
660 }
661 impl ::core::convert::From<DecreaseAllowanceCall> for ERC20WrapperCalls {
662 fn from(value: DecreaseAllowanceCall) -> Self {
663 Self::DecreaseAllowance(value)
664 }
665 }
666 impl ::core::convert::From<DepositForCall> for ERC20WrapperCalls {
667 fn from(value: DepositForCall) -> Self {
668 Self::DepositFor(value)
669 }
670 }
671 impl ::core::convert::From<IncreaseAllowanceCall> for ERC20WrapperCalls {
672 fn from(value: IncreaseAllowanceCall) -> Self {
673 Self::IncreaseAllowance(value)
674 }
675 }
676 impl ::core::convert::From<NameCall> for ERC20WrapperCalls {
677 fn from(value: NameCall) -> Self {
678 Self::Name(value)
679 }
680 }
681 impl ::core::convert::From<SymbolCall> for ERC20WrapperCalls {
682 fn from(value: SymbolCall) -> Self {
683 Self::Symbol(value)
684 }
685 }
686 impl ::core::convert::From<TotalSupplyCall> for ERC20WrapperCalls {
687 fn from(value: TotalSupplyCall) -> Self {
688 Self::TotalSupply(value)
689 }
690 }
691 impl ::core::convert::From<TransferCall> for ERC20WrapperCalls {
692 fn from(value: TransferCall) -> Self {
693 Self::Transfer(value)
694 }
695 }
696 impl ::core::convert::From<TransferFromCall> for ERC20WrapperCalls {
697 fn from(value: TransferFromCall) -> Self {
698 Self::TransferFrom(value)
699 }
700 }
701 impl ::core::convert::From<UnderlyingCall> for ERC20WrapperCalls {
702 fn from(value: UnderlyingCall) -> Self {
703 Self::Underlying(value)
704 }
705 }
706 impl ::core::convert::From<WithdrawToCall> for ERC20WrapperCalls {
707 fn from(value: WithdrawToCall) -> Self {
708 Self::WithdrawTo(value)
709 }
710 }
711 #[derive(
713 Clone,
714 ::ethers_contract::EthAbiType,
715 ::ethers_contract::EthAbiCodec,
716 Default,
717 Debug,
718 PartialEq,
719 Eq,
720 Hash
721 )]
722 pub struct AllowanceReturn(pub ::ethers_core::types::U256);
723 #[derive(
725 Clone,
726 ::ethers_contract::EthAbiType,
727 ::ethers_contract::EthAbiCodec,
728 Default,
729 Debug,
730 PartialEq,
731 Eq,
732 Hash
733 )]
734 pub struct ApproveReturn(pub bool);
735 #[derive(
737 Clone,
738 ::ethers_contract::EthAbiType,
739 ::ethers_contract::EthAbiCodec,
740 Default,
741 Debug,
742 PartialEq,
743 Eq,
744 Hash
745 )]
746 pub struct BalanceOfReturn(pub ::ethers_core::types::U256);
747 #[derive(
749 Clone,
750 ::ethers_contract::EthAbiType,
751 ::ethers_contract::EthAbiCodec,
752 Default,
753 Debug,
754 PartialEq,
755 Eq,
756 Hash
757 )]
758 pub struct DecimalsReturn(pub u8);
759 #[derive(
761 Clone,
762 ::ethers_contract::EthAbiType,
763 ::ethers_contract::EthAbiCodec,
764 Default,
765 Debug,
766 PartialEq,
767 Eq,
768 Hash
769 )]
770 pub struct DecreaseAllowanceReturn(pub bool);
771 #[derive(
773 Clone,
774 ::ethers_contract::EthAbiType,
775 ::ethers_contract::EthAbiCodec,
776 Default,
777 Debug,
778 PartialEq,
779 Eq,
780 Hash
781 )]
782 pub struct DepositForReturn(pub bool);
783 #[derive(
785 Clone,
786 ::ethers_contract::EthAbiType,
787 ::ethers_contract::EthAbiCodec,
788 Default,
789 Debug,
790 PartialEq,
791 Eq,
792 Hash
793 )]
794 pub struct IncreaseAllowanceReturn(pub bool);
795 #[derive(
797 Clone,
798 ::ethers_contract::EthAbiType,
799 ::ethers_contract::EthAbiCodec,
800 Default,
801 Debug,
802 PartialEq,
803 Eq,
804 Hash
805 )]
806 pub struct NameReturn(pub ::std::string::String);
807 #[derive(
809 Clone,
810 ::ethers_contract::EthAbiType,
811 ::ethers_contract::EthAbiCodec,
812 Default,
813 Debug,
814 PartialEq,
815 Eq,
816 Hash
817 )]
818 pub struct SymbolReturn(pub ::std::string::String);
819 #[derive(
821 Clone,
822 ::ethers_contract::EthAbiType,
823 ::ethers_contract::EthAbiCodec,
824 Default,
825 Debug,
826 PartialEq,
827 Eq,
828 Hash
829 )]
830 pub struct TotalSupplyReturn(pub ::ethers_core::types::U256);
831 #[derive(
833 Clone,
834 ::ethers_contract::EthAbiType,
835 ::ethers_contract::EthAbiCodec,
836 Default,
837 Debug,
838 PartialEq,
839 Eq,
840 Hash
841 )]
842 pub struct TransferReturn(pub bool);
843 #[derive(
845 Clone,
846 ::ethers_contract::EthAbiType,
847 ::ethers_contract::EthAbiCodec,
848 Default,
849 Debug,
850 PartialEq,
851 Eq,
852 Hash
853 )]
854 pub struct TransferFromReturn(pub bool);
855 #[derive(
857 Clone,
858 ::ethers_contract::EthAbiType,
859 ::ethers_contract::EthAbiCodec,
860 Default,
861 Debug,
862 PartialEq,
863 Eq,
864 Hash
865 )]
866 pub struct UnderlyingReturn(pub ::ethers_core::types::Address);
867 #[derive(
869 Clone,
870 ::ethers_contract::EthAbiType,
871 ::ethers_contract::EthAbiCodec,
872 Default,
873 Debug,
874 PartialEq,
875 Eq,
876 Hash
877 )]
878 pub struct WithdrawToReturn(pub bool);
879}