1pub use erc20_flash_mint::*;
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_flash_mint {
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\":\"token\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"flashFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"contract IERC3156FlashBorrower\",\"name\":\"receiver\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\",\"components\":[]},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"flashLoan\",\"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\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"maxFlashLoan\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\",\"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\":[]}]}]";
15 pub static ERC20FLASHMINT_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 ERC20FlashMint<M>(::ethers_contract::Contract<M>);
19 impl<M> ::core::clone::Clone for ERC20FlashMint<M> {
20 fn clone(&self) -> Self {
21 Self(::core::clone::Clone::clone(&self.0))
22 }
23 }
24 impl<M> ::core::ops::Deref for ERC20FlashMint<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 ERC20FlashMint<M> {
31 fn deref_mut(&mut self) -> &mut Self::Target {
32 &mut self.0
33 }
34 }
35 impl<M> ::core::fmt::Debug for ERC20FlashMint<M> {
36 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
37 f.debug_tuple(stringify!(ERC20FlashMint)).field(&self.address()).finish()
38 }
39 }
40 impl<M: ::ethers_providers::Middleware> ERC20FlashMint<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 ERC20FLASHMINT_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 flash_fee(
102 &self,
103 token: ::ethers_core::types::Address,
104 amount: ::ethers_core::types::U256,
105 ) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
106 self.0
107 .method_hash([217, 217, 140, 228], (token, amount))
108 .expect("method not found (this should never happen)")
109 }
110 pub fn flash_loan(
112 &self,
113 receiver: ::ethers_core::types::Address,
114 token: ::ethers_core::types::Address,
115 amount: ::ethers_core::types::U256,
116 data: ::ethers_core::types::Bytes,
117 ) -> ::ethers_contract::builders::ContractCall<M, bool> {
118 self.0
119 .method_hash([92, 255, 233, 222], (receiver, token, amount, data))
120 .expect("method not found (this should never happen)")
121 }
122 pub fn increase_allowance(
124 &self,
125 spender: ::ethers_core::types::Address,
126 added_value: ::ethers_core::types::U256,
127 ) -> ::ethers_contract::builders::ContractCall<M, bool> {
128 self.0
129 .method_hash([57, 80, 147, 81], (spender, added_value))
130 .expect("method not found (this should never happen)")
131 }
132 pub fn max_flash_loan(
134 &self,
135 token: ::ethers_core::types::Address,
136 ) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
137 self.0
138 .method_hash([97, 50, 85, 171], token)
139 .expect("method not found (this should never happen)")
140 }
141 pub fn name(
143 &self,
144 ) -> ::ethers_contract::builders::ContractCall<M, ::std::string::String> {
145 self.0
146 .method_hash([6, 253, 222, 3], ())
147 .expect("method not found (this should never happen)")
148 }
149 pub fn symbol(
151 &self,
152 ) -> ::ethers_contract::builders::ContractCall<M, ::std::string::String> {
153 self.0
154 .method_hash([149, 216, 155, 65], ())
155 .expect("method not found (this should never happen)")
156 }
157 pub fn total_supply(
159 &self,
160 ) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
161 self.0
162 .method_hash([24, 22, 13, 221], ())
163 .expect("method not found (this should never happen)")
164 }
165 pub fn transfer(
167 &self,
168 to: ::ethers_core::types::Address,
169 amount: ::ethers_core::types::U256,
170 ) -> ::ethers_contract::builders::ContractCall<M, bool> {
171 self.0
172 .method_hash([169, 5, 156, 187], (to, amount))
173 .expect("method not found (this should never happen)")
174 }
175 pub fn transfer_from(
177 &self,
178 from: ::ethers_core::types::Address,
179 to: ::ethers_core::types::Address,
180 amount: ::ethers_core::types::U256,
181 ) -> ::ethers_contract::builders::ContractCall<M, bool> {
182 self.0
183 .method_hash([35, 184, 114, 221], (from, to, 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 ERC20FlashMintEvents,
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 ERC20FlashMint<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 ERC20FlashMintEvents {
254 ApprovalFilter(ApprovalFilter),
255 TransferFilter(TransferFilter),
256 }
257 impl ::ethers_contract::EthLogDecode for ERC20FlashMintEvents {
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(ERC20FlashMintEvents::ApprovalFilter(decoded));
263 }
264 if let Ok(decoded) = TransferFilter::decode_log(log) {
265 return Ok(ERC20FlashMintEvents::TransferFilter(decoded));
266 }
267 Err(::ethers_core::abi::Error::InvalidData)
268 }
269 }
270 impl ::core::fmt::Display for ERC20FlashMintEvents {
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 ERC20FlashMintEvents {
279 fn from(value: ApprovalFilter) -> Self {
280 Self::ApprovalFilter(value)
281 }
282 }
283 impl ::core::convert::From<TransferFilter> for ERC20FlashMintEvents {
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 = "flashFee", abi = "flashFee(address,uint256)")]
376 pub struct FlashFeeCall {
377 pub token: ::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 = "flashLoan", abi = "flashLoan(address,address,uint256,bytes)")]
392 pub struct FlashLoanCall {
393 pub receiver: ::ethers_core::types::Address,
394 pub token: ::ethers_core::types::Address,
395 pub amount: ::ethers_core::types::U256,
396 pub data: ::ethers_core::types::Bytes,
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 = "maxFlashLoan", abi = "maxFlashLoan(address)")]
426 pub struct MaxFlashLoanCall {
427 pub token: ::ethers_core::types::Address,
428 }
429 #[derive(
431 Clone,
432 ::ethers_contract::EthCall,
433 ::ethers_contract::EthDisplay,
434 Default,
435 Debug,
436 PartialEq,
437 Eq,
438 Hash
439 )]
440 #[ethcall(name = "name", abi = "name()")]
441 pub struct NameCall;
442 #[derive(
444 Clone,
445 ::ethers_contract::EthCall,
446 ::ethers_contract::EthDisplay,
447 Default,
448 Debug,
449 PartialEq,
450 Eq,
451 Hash
452 )]
453 #[ethcall(name = "symbol", abi = "symbol()")]
454 pub struct SymbolCall;
455 #[derive(
457 Clone,
458 ::ethers_contract::EthCall,
459 ::ethers_contract::EthDisplay,
460 Default,
461 Debug,
462 PartialEq,
463 Eq,
464 Hash
465 )]
466 #[ethcall(name = "totalSupply", abi = "totalSupply()")]
467 pub struct TotalSupplyCall;
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 ERC20FlashMintCalls {
504 Allowance(AllowanceCall),
505 Approve(ApproveCall),
506 BalanceOf(BalanceOfCall),
507 Decimals(DecimalsCall),
508 DecreaseAllowance(DecreaseAllowanceCall),
509 FlashFee(FlashFeeCall),
510 FlashLoan(FlashLoanCall),
511 IncreaseAllowance(IncreaseAllowanceCall),
512 MaxFlashLoan(MaxFlashLoanCall),
513 Name(NameCall),
514 Symbol(SymbolCall),
515 TotalSupply(TotalSupplyCall),
516 Transfer(TransferCall),
517 TransferFrom(TransferFromCall),
518 }
519 impl ::ethers_core::abi::AbiDecode for ERC20FlashMintCalls {
520 fn decode(
521 data: impl AsRef<[u8]>,
522 ) -> ::core::result::Result<Self, ::ethers_core::abi::AbiError> {
523 let data = data.as_ref();
524 if let Ok(decoded)
525 = <AllowanceCall as ::ethers_core::abi::AbiDecode>::decode(data) {
526 return Ok(Self::Allowance(decoded));
527 }
528 if let Ok(decoded)
529 = <ApproveCall as ::ethers_core::abi::AbiDecode>::decode(data) {
530 return Ok(Self::Approve(decoded));
531 }
532 if let Ok(decoded)
533 = <BalanceOfCall as ::ethers_core::abi::AbiDecode>::decode(data) {
534 return Ok(Self::BalanceOf(decoded));
535 }
536 if let Ok(decoded)
537 = <DecimalsCall as ::ethers_core::abi::AbiDecode>::decode(data) {
538 return Ok(Self::Decimals(decoded));
539 }
540 if let Ok(decoded)
541 = <DecreaseAllowanceCall as ::ethers_core::abi::AbiDecode>::decode(
542 data,
543 ) {
544 return Ok(Self::DecreaseAllowance(decoded));
545 }
546 if let Ok(decoded)
547 = <FlashFeeCall as ::ethers_core::abi::AbiDecode>::decode(data) {
548 return Ok(Self::FlashFee(decoded));
549 }
550 if let Ok(decoded)
551 = <FlashLoanCall as ::ethers_core::abi::AbiDecode>::decode(data) {
552 return Ok(Self::FlashLoan(decoded));
553 }
554 if let Ok(decoded)
555 = <IncreaseAllowanceCall as ::ethers_core::abi::AbiDecode>::decode(
556 data,
557 ) {
558 return Ok(Self::IncreaseAllowance(decoded));
559 }
560 if let Ok(decoded)
561 = <MaxFlashLoanCall as ::ethers_core::abi::AbiDecode>::decode(data) {
562 return Ok(Self::MaxFlashLoan(decoded));
563 }
564 if let Ok(decoded)
565 = <NameCall as ::ethers_core::abi::AbiDecode>::decode(data) {
566 return Ok(Self::Name(decoded));
567 }
568 if let Ok(decoded)
569 = <SymbolCall as ::ethers_core::abi::AbiDecode>::decode(data) {
570 return Ok(Self::Symbol(decoded));
571 }
572 if let Ok(decoded)
573 = <TotalSupplyCall as ::ethers_core::abi::AbiDecode>::decode(data) {
574 return Ok(Self::TotalSupply(decoded));
575 }
576 if let Ok(decoded)
577 = <TransferCall as ::ethers_core::abi::AbiDecode>::decode(data) {
578 return Ok(Self::Transfer(decoded));
579 }
580 if let Ok(decoded)
581 = <TransferFromCall as ::ethers_core::abi::AbiDecode>::decode(data) {
582 return Ok(Self::TransferFrom(decoded));
583 }
584 Err(::ethers_core::abi::Error::InvalidData.into())
585 }
586 }
587 impl ::ethers_core::abi::AbiEncode for ERC20FlashMintCalls {
588 fn encode(self) -> Vec<u8> {
589 match self {
590 Self::Allowance(element) => {
591 ::ethers_core::abi::AbiEncode::encode(element)
592 }
593 Self::Approve(element) => ::ethers_core::abi::AbiEncode::encode(element),
594 Self::BalanceOf(element) => {
595 ::ethers_core::abi::AbiEncode::encode(element)
596 }
597 Self::Decimals(element) => ::ethers_core::abi::AbiEncode::encode(element),
598 Self::DecreaseAllowance(element) => {
599 ::ethers_core::abi::AbiEncode::encode(element)
600 }
601 Self::FlashFee(element) => ::ethers_core::abi::AbiEncode::encode(element),
602 Self::FlashLoan(element) => {
603 ::ethers_core::abi::AbiEncode::encode(element)
604 }
605 Self::IncreaseAllowance(element) => {
606 ::ethers_core::abi::AbiEncode::encode(element)
607 }
608 Self::MaxFlashLoan(element) => {
609 ::ethers_core::abi::AbiEncode::encode(element)
610 }
611 Self::Name(element) => ::ethers_core::abi::AbiEncode::encode(element),
612 Self::Symbol(element) => ::ethers_core::abi::AbiEncode::encode(element),
613 Self::TotalSupply(element) => {
614 ::ethers_core::abi::AbiEncode::encode(element)
615 }
616 Self::Transfer(element) => ::ethers_core::abi::AbiEncode::encode(element),
617 Self::TransferFrom(element) => {
618 ::ethers_core::abi::AbiEncode::encode(element)
619 }
620 }
621 }
622 }
623 impl ::core::fmt::Display for ERC20FlashMintCalls {
624 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
625 match self {
626 Self::Allowance(element) => ::core::fmt::Display::fmt(element, f),
627 Self::Approve(element) => ::core::fmt::Display::fmt(element, f),
628 Self::BalanceOf(element) => ::core::fmt::Display::fmt(element, f),
629 Self::Decimals(element) => ::core::fmt::Display::fmt(element, f),
630 Self::DecreaseAllowance(element) => ::core::fmt::Display::fmt(element, f),
631 Self::FlashFee(element) => ::core::fmt::Display::fmt(element, f),
632 Self::FlashLoan(element) => ::core::fmt::Display::fmt(element, f),
633 Self::IncreaseAllowance(element) => ::core::fmt::Display::fmt(element, f),
634 Self::MaxFlashLoan(element) => ::core::fmt::Display::fmt(element, f),
635 Self::Name(element) => ::core::fmt::Display::fmt(element, f),
636 Self::Symbol(element) => ::core::fmt::Display::fmt(element, f),
637 Self::TotalSupply(element) => ::core::fmt::Display::fmt(element, f),
638 Self::Transfer(element) => ::core::fmt::Display::fmt(element, f),
639 Self::TransferFrom(element) => ::core::fmt::Display::fmt(element, f),
640 }
641 }
642 }
643 impl ::core::convert::From<AllowanceCall> for ERC20FlashMintCalls {
644 fn from(value: AllowanceCall) -> Self {
645 Self::Allowance(value)
646 }
647 }
648 impl ::core::convert::From<ApproveCall> for ERC20FlashMintCalls {
649 fn from(value: ApproveCall) -> Self {
650 Self::Approve(value)
651 }
652 }
653 impl ::core::convert::From<BalanceOfCall> for ERC20FlashMintCalls {
654 fn from(value: BalanceOfCall) -> Self {
655 Self::BalanceOf(value)
656 }
657 }
658 impl ::core::convert::From<DecimalsCall> for ERC20FlashMintCalls {
659 fn from(value: DecimalsCall) -> Self {
660 Self::Decimals(value)
661 }
662 }
663 impl ::core::convert::From<DecreaseAllowanceCall> for ERC20FlashMintCalls {
664 fn from(value: DecreaseAllowanceCall) -> Self {
665 Self::DecreaseAllowance(value)
666 }
667 }
668 impl ::core::convert::From<FlashFeeCall> for ERC20FlashMintCalls {
669 fn from(value: FlashFeeCall) -> Self {
670 Self::FlashFee(value)
671 }
672 }
673 impl ::core::convert::From<FlashLoanCall> for ERC20FlashMintCalls {
674 fn from(value: FlashLoanCall) -> Self {
675 Self::FlashLoan(value)
676 }
677 }
678 impl ::core::convert::From<IncreaseAllowanceCall> for ERC20FlashMintCalls {
679 fn from(value: IncreaseAllowanceCall) -> Self {
680 Self::IncreaseAllowance(value)
681 }
682 }
683 impl ::core::convert::From<MaxFlashLoanCall> for ERC20FlashMintCalls {
684 fn from(value: MaxFlashLoanCall) -> Self {
685 Self::MaxFlashLoan(value)
686 }
687 }
688 impl ::core::convert::From<NameCall> for ERC20FlashMintCalls {
689 fn from(value: NameCall) -> Self {
690 Self::Name(value)
691 }
692 }
693 impl ::core::convert::From<SymbolCall> for ERC20FlashMintCalls {
694 fn from(value: SymbolCall) -> Self {
695 Self::Symbol(value)
696 }
697 }
698 impl ::core::convert::From<TotalSupplyCall> for ERC20FlashMintCalls {
699 fn from(value: TotalSupplyCall) -> Self {
700 Self::TotalSupply(value)
701 }
702 }
703 impl ::core::convert::From<TransferCall> for ERC20FlashMintCalls {
704 fn from(value: TransferCall) -> Self {
705 Self::Transfer(value)
706 }
707 }
708 impl ::core::convert::From<TransferFromCall> for ERC20FlashMintCalls {
709 fn from(value: TransferFromCall) -> Self {
710 Self::TransferFrom(value)
711 }
712 }
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 AllowanceReturn(pub ::ethers_core::types::U256);
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 ApproveReturn(pub bool);
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 BalanceOfReturn(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 FlashFeeReturn(pub ::ethers_core::types::U256);
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 FlashLoanReturn(pub bool);
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 IncreaseAllowanceReturn(pub bool);
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 MaxFlashLoanReturn(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 NameReturn(pub ::std::string::String);
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 SymbolReturn(pub ::std::string::String);
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 TotalSupplyReturn(pub ::ethers_core::types::U256);
857 #[derive(
859 Clone,
860 ::ethers_contract::EthAbiType,
861 ::ethers_contract::EthAbiCodec,
862 Default,
863 Debug,
864 PartialEq,
865 Eq,
866 Hash
867 )]
868 pub struct TransferReturn(pub bool);
869 #[derive(
871 Clone,
872 ::ethers_contract::EthAbiType,
873 ::ethers_contract::EthAbiCodec,
874 Default,
875 Debug,
876 PartialEq,
877 Eq,
878 Hash
879 )]
880 pub struct TransferFromReturn(pub bool);
881}