openzeppelin_rs/contracts/
ERC20Capped.rs

1pub use erc20_capped::*;
2/// This module was auto-generated with ethers-rs Abigen.
3/// More information at: <https://github.com/gakonst/ethers-rs>
4#[allow(
5    clippy::enum_variant_names,
6    clippy::too_many_arguments,
7    clippy::upper_case_acronyms,
8    clippy::type_complexity,
9    dead_code,
10    non_camel_case_types,
11)]
12pub mod erc20_capped {
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\":\"cap\",\"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\":\"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    ///The parsed JSON ABI of the contract.
16    pub static ERC20CAPPED_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 ERC20Capped<M>(::ethers_contract::Contract<M>);
19    impl<M> ::core::clone::Clone for ERC20Capped<M> {
20        fn clone(&self) -> Self {
21            Self(::core::clone::Clone::clone(&self.0))
22        }
23    }
24    impl<M> ::core::ops::Deref for ERC20Capped<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 ERC20Capped<M> {
31        fn deref_mut(&mut self) -> &mut Self::Target {
32            &mut self.0
33        }
34    }
35    impl<M> ::core::fmt::Debug for ERC20Capped<M> {
36        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
37            f.debug_tuple(stringify!(ERC20Capped)).field(&self.address()).finish()
38        }
39    }
40    impl<M: ::ethers_providers::Middleware> ERC20Capped<M> {
41        /// Creates a new contract instance with the specified `ethers` client at
42        /// `address`. The contract derefs to a `ethers::Contract` object.
43        pub fn new<T: Into<::ethers_core::types::Address>>(
44            address: T,
45            client: ::std::sync::Arc<M>,
46        ) -> Self {
47            Self(
48                ::ethers_contract::Contract::new(
49                    address.into(),
50                    ERC20CAPPED_ABI.clone(),
51                    client,
52                ),
53            )
54        }
55        ///Calls the contract's `allowance` (0xdd62ed3e) function
56        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        ///Calls the contract's `approve` (0x095ea7b3) function
66        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        ///Calls the contract's `balanceOf` (0x70a08231) function
76        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        ///Calls the contract's `cap` (0x355274ea) function
85        pub fn cap(
86            &self,
87        ) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
88            self.0
89                .method_hash([53, 82, 116, 234], ())
90                .expect("method not found (this should never happen)")
91        }
92        ///Calls the contract's `decimals` (0x313ce567) function
93        pub fn decimals(&self) -> ::ethers_contract::builders::ContractCall<M, u8> {
94            self.0
95                .method_hash([49, 60, 229, 103], ())
96                .expect("method not found (this should never happen)")
97        }
98        ///Calls the contract's `decreaseAllowance` (0xa457c2d7) function
99        pub fn decrease_allowance(
100            &self,
101            spender: ::ethers_core::types::Address,
102            subtracted_value: ::ethers_core::types::U256,
103        ) -> ::ethers_contract::builders::ContractCall<M, bool> {
104            self.0
105                .method_hash([164, 87, 194, 215], (spender, subtracted_value))
106                .expect("method not found (this should never happen)")
107        }
108        ///Calls the contract's `increaseAllowance` (0x39509351) function
109        pub fn increase_allowance(
110            &self,
111            spender: ::ethers_core::types::Address,
112            added_value: ::ethers_core::types::U256,
113        ) -> ::ethers_contract::builders::ContractCall<M, bool> {
114            self.0
115                .method_hash([57, 80, 147, 81], (spender, added_value))
116                .expect("method not found (this should never happen)")
117        }
118        ///Calls the contract's `name` (0x06fdde03) function
119        pub fn name(
120            &self,
121        ) -> ::ethers_contract::builders::ContractCall<M, ::std::string::String> {
122            self.0
123                .method_hash([6, 253, 222, 3], ())
124                .expect("method not found (this should never happen)")
125        }
126        ///Calls the contract's `symbol` (0x95d89b41) function
127        pub fn symbol(
128            &self,
129        ) -> ::ethers_contract::builders::ContractCall<M, ::std::string::String> {
130            self.0
131                .method_hash([149, 216, 155, 65], ())
132                .expect("method not found (this should never happen)")
133        }
134        ///Calls the contract's `totalSupply` (0x18160ddd) function
135        pub fn total_supply(
136            &self,
137        ) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
138            self.0
139                .method_hash([24, 22, 13, 221], ())
140                .expect("method not found (this should never happen)")
141        }
142        ///Calls the contract's `transfer` (0xa9059cbb) function
143        pub fn transfer(
144            &self,
145            to: ::ethers_core::types::Address,
146            amount: ::ethers_core::types::U256,
147        ) -> ::ethers_contract::builders::ContractCall<M, bool> {
148            self.0
149                .method_hash([169, 5, 156, 187], (to, amount))
150                .expect("method not found (this should never happen)")
151        }
152        ///Calls the contract's `transferFrom` (0x23b872dd) function
153        pub fn transfer_from(
154            &self,
155            from: ::ethers_core::types::Address,
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([35, 184, 114, 221], (from, to, amount))
161                .expect("method not found (this should never happen)")
162        }
163        ///Gets the contract's `Approval` event
164        pub fn approval_filter(
165            &self,
166        ) -> ::ethers_contract::builders::Event<::std::sync::Arc<M>, M, ApprovalFilter> {
167            self.0.event()
168        }
169        ///Gets the contract's `Transfer` event
170        pub fn transfer_filter(
171            &self,
172        ) -> ::ethers_contract::builders::Event<::std::sync::Arc<M>, M, TransferFilter> {
173            self.0.event()
174        }
175        /// Returns an `Event` builder for all the events of this contract.
176        pub fn events(
177            &self,
178        ) -> ::ethers_contract::builders::Event<
179            ::std::sync::Arc<M>,
180            M,
181            ERC20CappedEvents,
182        > {
183            self.0.event_with_filter(::core::default::Default::default())
184        }
185    }
186    impl<M: ::ethers_providers::Middleware> From<::ethers_contract::Contract<M>>
187    for ERC20Capped<M> {
188        fn from(contract: ::ethers_contract::Contract<M>) -> Self {
189            Self::new(contract.address(), contract.client())
190        }
191    }
192    #[derive(
193        Clone,
194        ::ethers_contract::EthEvent,
195        ::ethers_contract::EthDisplay,
196        Default,
197        Debug,
198        PartialEq,
199        Eq,
200        Hash
201    )]
202    #[ethevent(name = "Approval", abi = "Approval(address,address,uint256)")]
203    pub struct ApprovalFilter {
204        #[ethevent(indexed)]
205        pub owner: ::ethers_core::types::Address,
206        #[ethevent(indexed)]
207        pub spender: ::ethers_core::types::Address,
208        pub value: ::ethers_core::types::U256,
209    }
210    #[derive(
211        Clone,
212        ::ethers_contract::EthEvent,
213        ::ethers_contract::EthDisplay,
214        Default,
215        Debug,
216        PartialEq,
217        Eq,
218        Hash
219    )]
220    #[ethevent(name = "Transfer", abi = "Transfer(address,address,uint256)")]
221    pub struct TransferFilter {
222        #[ethevent(indexed)]
223        pub from: ::ethers_core::types::Address,
224        #[ethevent(indexed)]
225        pub to: ::ethers_core::types::Address,
226        pub value: ::ethers_core::types::U256,
227    }
228    ///Container type for all of the contract's events
229    #[derive(Clone, ::ethers_contract::EthAbiType, Debug, PartialEq, Eq, Hash)]
230    pub enum ERC20CappedEvents {
231        ApprovalFilter(ApprovalFilter),
232        TransferFilter(TransferFilter),
233    }
234    impl ::ethers_contract::EthLogDecode for ERC20CappedEvents {
235        fn decode_log(
236            log: &::ethers_core::abi::RawLog,
237        ) -> ::core::result::Result<Self, ::ethers_core::abi::Error> {
238            if let Ok(decoded) = ApprovalFilter::decode_log(log) {
239                return Ok(ERC20CappedEvents::ApprovalFilter(decoded));
240            }
241            if let Ok(decoded) = TransferFilter::decode_log(log) {
242                return Ok(ERC20CappedEvents::TransferFilter(decoded));
243            }
244            Err(::ethers_core::abi::Error::InvalidData)
245        }
246    }
247    impl ::core::fmt::Display for ERC20CappedEvents {
248        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
249            match self {
250                Self::ApprovalFilter(element) => ::core::fmt::Display::fmt(element, f),
251                Self::TransferFilter(element) => ::core::fmt::Display::fmt(element, f),
252            }
253        }
254    }
255    impl ::core::convert::From<ApprovalFilter> for ERC20CappedEvents {
256        fn from(value: ApprovalFilter) -> Self {
257            Self::ApprovalFilter(value)
258        }
259    }
260    impl ::core::convert::From<TransferFilter> for ERC20CappedEvents {
261        fn from(value: TransferFilter) -> Self {
262            Self::TransferFilter(value)
263        }
264    }
265    ///Container type for all input parameters for the `allowance` function with signature `allowance(address,address)` and selector `0xdd62ed3e`
266    #[derive(
267        Clone,
268        ::ethers_contract::EthCall,
269        ::ethers_contract::EthDisplay,
270        Default,
271        Debug,
272        PartialEq,
273        Eq,
274        Hash
275    )]
276    #[ethcall(name = "allowance", abi = "allowance(address,address)")]
277    pub struct AllowanceCall {
278        pub owner: ::ethers_core::types::Address,
279        pub spender: ::ethers_core::types::Address,
280    }
281    ///Container type for all input parameters for the `approve` function with signature `approve(address,uint256)` and selector `0x095ea7b3`
282    #[derive(
283        Clone,
284        ::ethers_contract::EthCall,
285        ::ethers_contract::EthDisplay,
286        Default,
287        Debug,
288        PartialEq,
289        Eq,
290        Hash
291    )]
292    #[ethcall(name = "approve", abi = "approve(address,uint256)")]
293    pub struct ApproveCall {
294        pub spender: ::ethers_core::types::Address,
295        pub amount: ::ethers_core::types::U256,
296    }
297    ///Container type for all input parameters for the `balanceOf` function with signature `balanceOf(address)` and selector `0x70a08231`
298    #[derive(
299        Clone,
300        ::ethers_contract::EthCall,
301        ::ethers_contract::EthDisplay,
302        Default,
303        Debug,
304        PartialEq,
305        Eq,
306        Hash
307    )]
308    #[ethcall(name = "balanceOf", abi = "balanceOf(address)")]
309    pub struct BalanceOfCall {
310        pub account: ::ethers_core::types::Address,
311    }
312    ///Container type for all input parameters for the `cap` function with signature `cap()` and selector `0x355274ea`
313    #[derive(
314        Clone,
315        ::ethers_contract::EthCall,
316        ::ethers_contract::EthDisplay,
317        Default,
318        Debug,
319        PartialEq,
320        Eq,
321        Hash
322    )]
323    #[ethcall(name = "cap", abi = "cap()")]
324    pub struct CapCall;
325    ///Container type for all input parameters for the `decimals` function with signature `decimals()` and selector `0x313ce567`
326    #[derive(
327        Clone,
328        ::ethers_contract::EthCall,
329        ::ethers_contract::EthDisplay,
330        Default,
331        Debug,
332        PartialEq,
333        Eq,
334        Hash
335    )]
336    #[ethcall(name = "decimals", abi = "decimals()")]
337    pub struct DecimalsCall;
338    ///Container type for all input parameters for the `decreaseAllowance` function with signature `decreaseAllowance(address,uint256)` and selector `0xa457c2d7`
339    #[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 = "decreaseAllowance", abi = "decreaseAllowance(address,uint256)")]
350    pub struct DecreaseAllowanceCall {
351        pub spender: ::ethers_core::types::Address,
352        pub subtracted_value: ::ethers_core::types::U256,
353    }
354    ///Container type for all input parameters for the `increaseAllowance` function with signature `increaseAllowance(address,uint256)` and selector `0x39509351`
355    #[derive(
356        Clone,
357        ::ethers_contract::EthCall,
358        ::ethers_contract::EthDisplay,
359        Default,
360        Debug,
361        PartialEq,
362        Eq,
363        Hash
364    )]
365    #[ethcall(name = "increaseAllowance", abi = "increaseAllowance(address,uint256)")]
366    pub struct IncreaseAllowanceCall {
367        pub spender: ::ethers_core::types::Address,
368        pub added_value: ::ethers_core::types::U256,
369    }
370    ///Container type for all input parameters for the `name` function with signature `name()` and selector `0x06fdde03`
371    #[derive(
372        Clone,
373        ::ethers_contract::EthCall,
374        ::ethers_contract::EthDisplay,
375        Default,
376        Debug,
377        PartialEq,
378        Eq,
379        Hash
380    )]
381    #[ethcall(name = "name", abi = "name()")]
382    pub struct NameCall;
383    ///Container type for all input parameters for the `symbol` function with signature `symbol()` and selector `0x95d89b41`
384    #[derive(
385        Clone,
386        ::ethers_contract::EthCall,
387        ::ethers_contract::EthDisplay,
388        Default,
389        Debug,
390        PartialEq,
391        Eq,
392        Hash
393    )]
394    #[ethcall(name = "symbol", abi = "symbol()")]
395    pub struct SymbolCall;
396    ///Container type for all input parameters for the `totalSupply` function with signature `totalSupply()` and selector `0x18160ddd`
397    #[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 = "totalSupply", abi = "totalSupply()")]
408    pub struct TotalSupplyCall;
409    ///Container type for all input parameters for the `transfer` function with signature `transfer(address,uint256)` and selector `0xa9059cbb`
410    #[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 = "transfer", abi = "transfer(address,uint256)")]
421    pub struct TransferCall {
422        pub to: ::ethers_core::types::Address,
423        pub amount: ::ethers_core::types::U256,
424    }
425    ///Container type for all input parameters for the `transferFrom` function with signature `transferFrom(address,address,uint256)` and selector `0x23b872dd`
426    #[derive(
427        Clone,
428        ::ethers_contract::EthCall,
429        ::ethers_contract::EthDisplay,
430        Default,
431        Debug,
432        PartialEq,
433        Eq,
434        Hash
435    )]
436    #[ethcall(name = "transferFrom", abi = "transferFrom(address,address,uint256)")]
437    pub struct TransferFromCall {
438        pub from: ::ethers_core::types::Address,
439        pub to: ::ethers_core::types::Address,
440        pub amount: ::ethers_core::types::U256,
441    }
442    ///Container type for all of the contract's call
443    #[derive(Clone, ::ethers_contract::EthAbiType, Debug, PartialEq, Eq, Hash)]
444    pub enum ERC20CappedCalls {
445        Allowance(AllowanceCall),
446        Approve(ApproveCall),
447        BalanceOf(BalanceOfCall),
448        Cap(CapCall),
449        Decimals(DecimalsCall),
450        DecreaseAllowance(DecreaseAllowanceCall),
451        IncreaseAllowance(IncreaseAllowanceCall),
452        Name(NameCall),
453        Symbol(SymbolCall),
454        TotalSupply(TotalSupplyCall),
455        Transfer(TransferCall),
456        TransferFrom(TransferFromCall),
457    }
458    impl ::ethers_core::abi::AbiDecode for ERC20CappedCalls {
459        fn decode(
460            data: impl AsRef<[u8]>,
461        ) -> ::core::result::Result<Self, ::ethers_core::abi::AbiError> {
462            let data = data.as_ref();
463            if let Ok(decoded)
464                = <AllowanceCall as ::ethers_core::abi::AbiDecode>::decode(data) {
465                return Ok(Self::Allowance(decoded));
466            }
467            if let Ok(decoded)
468                = <ApproveCall as ::ethers_core::abi::AbiDecode>::decode(data) {
469                return Ok(Self::Approve(decoded));
470            }
471            if let Ok(decoded)
472                = <BalanceOfCall as ::ethers_core::abi::AbiDecode>::decode(data) {
473                return Ok(Self::BalanceOf(decoded));
474            }
475            if let Ok(decoded)
476                = <CapCall as ::ethers_core::abi::AbiDecode>::decode(data) {
477                return Ok(Self::Cap(decoded));
478            }
479            if let Ok(decoded)
480                = <DecimalsCall as ::ethers_core::abi::AbiDecode>::decode(data) {
481                return Ok(Self::Decimals(decoded));
482            }
483            if let Ok(decoded)
484                = <DecreaseAllowanceCall as ::ethers_core::abi::AbiDecode>::decode(
485                    data,
486                ) {
487                return Ok(Self::DecreaseAllowance(decoded));
488            }
489            if let Ok(decoded)
490                = <IncreaseAllowanceCall as ::ethers_core::abi::AbiDecode>::decode(
491                    data,
492                ) {
493                return Ok(Self::IncreaseAllowance(decoded));
494            }
495            if let Ok(decoded)
496                = <NameCall as ::ethers_core::abi::AbiDecode>::decode(data) {
497                return Ok(Self::Name(decoded));
498            }
499            if let Ok(decoded)
500                = <SymbolCall as ::ethers_core::abi::AbiDecode>::decode(data) {
501                return Ok(Self::Symbol(decoded));
502            }
503            if let Ok(decoded)
504                = <TotalSupplyCall as ::ethers_core::abi::AbiDecode>::decode(data) {
505                return Ok(Self::TotalSupply(decoded));
506            }
507            if let Ok(decoded)
508                = <TransferCall as ::ethers_core::abi::AbiDecode>::decode(data) {
509                return Ok(Self::Transfer(decoded));
510            }
511            if let Ok(decoded)
512                = <TransferFromCall as ::ethers_core::abi::AbiDecode>::decode(data) {
513                return Ok(Self::TransferFrom(decoded));
514            }
515            Err(::ethers_core::abi::Error::InvalidData.into())
516        }
517    }
518    impl ::ethers_core::abi::AbiEncode for ERC20CappedCalls {
519        fn encode(self) -> Vec<u8> {
520            match self {
521                Self::Allowance(element) => {
522                    ::ethers_core::abi::AbiEncode::encode(element)
523                }
524                Self::Approve(element) => ::ethers_core::abi::AbiEncode::encode(element),
525                Self::BalanceOf(element) => {
526                    ::ethers_core::abi::AbiEncode::encode(element)
527                }
528                Self::Cap(element) => ::ethers_core::abi::AbiEncode::encode(element),
529                Self::Decimals(element) => ::ethers_core::abi::AbiEncode::encode(element),
530                Self::DecreaseAllowance(element) => {
531                    ::ethers_core::abi::AbiEncode::encode(element)
532                }
533                Self::IncreaseAllowance(element) => {
534                    ::ethers_core::abi::AbiEncode::encode(element)
535                }
536                Self::Name(element) => ::ethers_core::abi::AbiEncode::encode(element),
537                Self::Symbol(element) => ::ethers_core::abi::AbiEncode::encode(element),
538                Self::TotalSupply(element) => {
539                    ::ethers_core::abi::AbiEncode::encode(element)
540                }
541                Self::Transfer(element) => ::ethers_core::abi::AbiEncode::encode(element),
542                Self::TransferFrom(element) => {
543                    ::ethers_core::abi::AbiEncode::encode(element)
544                }
545            }
546        }
547    }
548    impl ::core::fmt::Display for ERC20CappedCalls {
549        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
550            match self {
551                Self::Allowance(element) => ::core::fmt::Display::fmt(element, f),
552                Self::Approve(element) => ::core::fmt::Display::fmt(element, f),
553                Self::BalanceOf(element) => ::core::fmt::Display::fmt(element, f),
554                Self::Cap(element) => ::core::fmt::Display::fmt(element, f),
555                Self::Decimals(element) => ::core::fmt::Display::fmt(element, f),
556                Self::DecreaseAllowance(element) => ::core::fmt::Display::fmt(element, f),
557                Self::IncreaseAllowance(element) => ::core::fmt::Display::fmt(element, f),
558                Self::Name(element) => ::core::fmt::Display::fmt(element, f),
559                Self::Symbol(element) => ::core::fmt::Display::fmt(element, f),
560                Self::TotalSupply(element) => ::core::fmt::Display::fmt(element, f),
561                Self::Transfer(element) => ::core::fmt::Display::fmt(element, f),
562                Self::TransferFrom(element) => ::core::fmt::Display::fmt(element, f),
563            }
564        }
565    }
566    impl ::core::convert::From<AllowanceCall> for ERC20CappedCalls {
567        fn from(value: AllowanceCall) -> Self {
568            Self::Allowance(value)
569        }
570    }
571    impl ::core::convert::From<ApproveCall> for ERC20CappedCalls {
572        fn from(value: ApproveCall) -> Self {
573            Self::Approve(value)
574        }
575    }
576    impl ::core::convert::From<BalanceOfCall> for ERC20CappedCalls {
577        fn from(value: BalanceOfCall) -> Self {
578            Self::BalanceOf(value)
579        }
580    }
581    impl ::core::convert::From<CapCall> for ERC20CappedCalls {
582        fn from(value: CapCall) -> Self {
583            Self::Cap(value)
584        }
585    }
586    impl ::core::convert::From<DecimalsCall> for ERC20CappedCalls {
587        fn from(value: DecimalsCall) -> Self {
588            Self::Decimals(value)
589        }
590    }
591    impl ::core::convert::From<DecreaseAllowanceCall> for ERC20CappedCalls {
592        fn from(value: DecreaseAllowanceCall) -> Self {
593            Self::DecreaseAllowance(value)
594        }
595    }
596    impl ::core::convert::From<IncreaseAllowanceCall> for ERC20CappedCalls {
597        fn from(value: IncreaseAllowanceCall) -> Self {
598            Self::IncreaseAllowance(value)
599        }
600    }
601    impl ::core::convert::From<NameCall> for ERC20CappedCalls {
602        fn from(value: NameCall) -> Self {
603            Self::Name(value)
604        }
605    }
606    impl ::core::convert::From<SymbolCall> for ERC20CappedCalls {
607        fn from(value: SymbolCall) -> Self {
608            Self::Symbol(value)
609        }
610    }
611    impl ::core::convert::From<TotalSupplyCall> for ERC20CappedCalls {
612        fn from(value: TotalSupplyCall) -> Self {
613            Self::TotalSupply(value)
614        }
615    }
616    impl ::core::convert::From<TransferCall> for ERC20CappedCalls {
617        fn from(value: TransferCall) -> Self {
618            Self::Transfer(value)
619        }
620    }
621    impl ::core::convert::From<TransferFromCall> for ERC20CappedCalls {
622        fn from(value: TransferFromCall) -> Self {
623            Self::TransferFrom(value)
624        }
625    }
626    ///Container type for all return fields from the `allowance` function with signature `allowance(address,address)` and selector `0xdd62ed3e`
627    #[derive(
628        Clone,
629        ::ethers_contract::EthAbiType,
630        ::ethers_contract::EthAbiCodec,
631        Default,
632        Debug,
633        PartialEq,
634        Eq,
635        Hash
636    )]
637    pub struct AllowanceReturn(pub ::ethers_core::types::U256);
638    ///Container type for all return fields from the `approve` function with signature `approve(address,uint256)` and selector `0x095ea7b3`
639    #[derive(
640        Clone,
641        ::ethers_contract::EthAbiType,
642        ::ethers_contract::EthAbiCodec,
643        Default,
644        Debug,
645        PartialEq,
646        Eq,
647        Hash
648    )]
649    pub struct ApproveReturn(pub bool);
650    ///Container type for all return fields from the `balanceOf` function with signature `balanceOf(address)` and selector `0x70a08231`
651    #[derive(
652        Clone,
653        ::ethers_contract::EthAbiType,
654        ::ethers_contract::EthAbiCodec,
655        Default,
656        Debug,
657        PartialEq,
658        Eq,
659        Hash
660    )]
661    pub struct BalanceOfReturn(pub ::ethers_core::types::U256);
662    ///Container type for all return fields from the `cap` function with signature `cap()` and selector `0x355274ea`
663    #[derive(
664        Clone,
665        ::ethers_contract::EthAbiType,
666        ::ethers_contract::EthAbiCodec,
667        Default,
668        Debug,
669        PartialEq,
670        Eq,
671        Hash
672    )]
673    pub struct CapReturn(pub ::ethers_core::types::U256);
674    ///Container type for all return fields from the `decimals` function with signature `decimals()` and selector `0x313ce567`
675    #[derive(
676        Clone,
677        ::ethers_contract::EthAbiType,
678        ::ethers_contract::EthAbiCodec,
679        Default,
680        Debug,
681        PartialEq,
682        Eq,
683        Hash
684    )]
685    pub struct DecimalsReturn(pub u8);
686    ///Container type for all return fields from the `decreaseAllowance` function with signature `decreaseAllowance(address,uint256)` and selector `0xa457c2d7`
687    #[derive(
688        Clone,
689        ::ethers_contract::EthAbiType,
690        ::ethers_contract::EthAbiCodec,
691        Default,
692        Debug,
693        PartialEq,
694        Eq,
695        Hash
696    )]
697    pub struct DecreaseAllowanceReturn(pub bool);
698    ///Container type for all return fields from the `increaseAllowance` function with signature `increaseAllowance(address,uint256)` and selector `0x39509351`
699    #[derive(
700        Clone,
701        ::ethers_contract::EthAbiType,
702        ::ethers_contract::EthAbiCodec,
703        Default,
704        Debug,
705        PartialEq,
706        Eq,
707        Hash
708    )]
709    pub struct IncreaseAllowanceReturn(pub bool);
710    ///Container type for all return fields from the `name` function with signature `name()` and selector `0x06fdde03`
711    #[derive(
712        Clone,
713        ::ethers_contract::EthAbiType,
714        ::ethers_contract::EthAbiCodec,
715        Default,
716        Debug,
717        PartialEq,
718        Eq,
719        Hash
720    )]
721    pub struct NameReturn(pub ::std::string::String);
722    ///Container type for all return fields from the `symbol` function with signature `symbol()` and selector `0x95d89b41`
723    #[derive(
724        Clone,
725        ::ethers_contract::EthAbiType,
726        ::ethers_contract::EthAbiCodec,
727        Default,
728        Debug,
729        PartialEq,
730        Eq,
731        Hash
732    )]
733    pub struct SymbolReturn(pub ::std::string::String);
734    ///Container type for all return fields from the `totalSupply` function with signature `totalSupply()` and selector `0x18160ddd`
735    #[derive(
736        Clone,
737        ::ethers_contract::EthAbiType,
738        ::ethers_contract::EthAbiCodec,
739        Default,
740        Debug,
741        PartialEq,
742        Eq,
743        Hash
744    )]
745    pub struct TotalSupplyReturn(pub ::ethers_core::types::U256);
746    ///Container type for all return fields from the `transfer` function with signature `transfer(address,uint256)` and selector `0xa9059cbb`
747    #[derive(
748        Clone,
749        ::ethers_contract::EthAbiType,
750        ::ethers_contract::EthAbiCodec,
751        Default,
752        Debug,
753        PartialEq,
754        Eq,
755        Hash
756    )]
757    pub struct TransferReturn(pub bool);
758    ///Container type for all return fields from the `transferFrom` function with signature `transferFrom(address,address,uint256)` and selector `0x23b872dd`
759    #[derive(
760        Clone,
761        ::ethers_contract::EthAbiType,
762        ::ethers_contract::EthAbiCodec,
763        Default,
764        Debug,
765        PartialEq,
766        Eq,
767        Hash
768    )]
769    pub struct TransferFromReturn(pub bool);
770}