fluence_marketplace_api_draft/
ierc20errors.rs

1/**
2
3Generated by the following Solidity interface...
4```solidity
5interface IERC20Errors {
6    error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);
7    error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);
8    error ERC20InvalidApprover(address approver);
9    error ERC20InvalidReceiver(address receiver);
10    error ERC20InvalidSender(address sender);
11    error ERC20InvalidSpender(address spender);
12}
13```
14
15...which was generated by the following JSON ABI:
16```json
17[
18  {
19    "type": "error",
20    "name": "ERC20InsufficientAllowance",
21    "inputs": [
22      {
23        "name": "spender",
24        "type": "address",
25        "internalType": "address"
26      },
27      {
28        "name": "allowance",
29        "type": "uint256",
30        "internalType": "uint256"
31      },
32      {
33        "name": "needed",
34        "type": "uint256",
35        "internalType": "uint256"
36      }
37    ]
38  },
39  {
40    "type": "error",
41    "name": "ERC20InsufficientBalance",
42    "inputs": [
43      {
44        "name": "sender",
45        "type": "address",
46        "internalType": "address"
47      },
48      {
49        "name": "balance",
50        "type": "uint256",
51        "internalType": "uint256"
52      },
53      {
54        "name": "needed",
55        "type": "uint256",
56        "internalType": "uint256"
57      }
58    ]
59  },
60  {
61    "type": "error",
62    "name": "ERC20InvalidApprover",
63    "inputs": [
64      {
65        "name": "approver",
66        "type": "address",
67        "internalType": "address"
68      }
69    ]
70  },
71  {
72    "type": "error",
73    "name": "ERC20InvalidReceiver",
74    "inputs": [
75      {
76        "name": "receiver",
77        "type": "address",
78        "internalType": "address"
79      }
80    ]
81  },
82  {
83    "type": "error",
84    "name": "ERC20InvalidSender",
85    "inputs": [
86      {
87        "name": "sender",
88        "type": "address",
89        "internalType": "address"
90      }
91    ]
92  },
93  {
94    "type": "error",
95    "name": "ERC20InvalidSpender",
96    "inputs": [
97      {
98        "name": "spender",
99        "type": "address",
100        "internalType": "address"
101      }
102    ]
103  }
104]
105```*/
106#[allow(
107    non_camel_case_types,
108    non_snake_case,
109    clippy::pub_underscore_fields,
110    clippy::style,
111    clippy::empty_structs_with_brackets
112)]
113pub mod IERC20Errors {
114    use super::*;
115    use alloy::sol_types as alloy_sol_types;
116    /// The creation / init bytecode of the contract.
117    ///
118    /// ```text
119    ///0x
120    /// ```
121    #[rustfmt::skip]
122    #[allow(clippy::all)]
123    pub static BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
124        b"",
125    );
126    /// The runtime bytecode of the contract, as deployed on the network.
127    ///
128    /// ```text
129    ///0x
130    /// ```
131    #[rustfmt::skip]
132    #[allow(clippy::all)]
133    pub static DEPLOYED_BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
134        b"",
135    );
136    /**Custom error with signature `ERC20InsufficientAllowance(address,uint256,uint256)` and selector `0xfb8f41b2`.
137```solidity
138error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);
139```*/
140    #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
141    #[derive(Clone)]
142    pub struct ERC20InsufficientAllowance {
143        #[allow(missing_docs)]
144        pub spender: alloy::sol_types::private::Address,
145        #[allow(missing_docs)]
146        pub allowance: alloy::sol_types::private::primitives::aliases::U256,
147        #[allow(missing_docs)]
148        pub needed: alloy::sol_types::private::primitives::aliases::U256,
149    }
150    #[allow(
151        non_camel_case_types,
152        non_snake_case,
153        clippy::pub_underscore_fields,
154        clippy::style
155    )]
156    const _: () = {
157        use alloy::sol_types as alloy_sol_types;
158        #[doc(hidden)]
159        type UnderlyingSolTuple<'a> = (
160            alloy::sol_types::sol_data::Address,
161            alloy::sol_types::sol_data::Uint<256>,
162            alloy::sol_types::sol_data::Uint<256>,
163        );
164        #[doc(hidden)]
165        type UnderlyingRustTuple<'a> = (
166            alloy::sol_types::private::Address,
167            alloy::sol_types::private::primitives::aliases::U256,
168            alloy::sol_types::private::primitives::aliases::U256,
169        );
170        #[cfg(test)]
171        #[allow(dead_code, unreachable_patterns)]
172        fn _type_assertion(
173            _t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>,
174        ) {
175            match _t {
176                alloy_sol_types::private::AssertTypeEq::<
177                    <UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
178                >(_) => {}
179            }
180        }
181        #[automatically_derived]
182        #[doc(hidden)]
183        impl ::core::convert::From<ERC20InsufficientAllowance>
184        for UnderlyingRustTuple<'_> {
185            fn from(value: ERC20InsufficientAllowance) -> Self {
186                (value.spender, value.allowance, value.needed)
187            }
188        }
189        #[automatically_derived]
190        #[doc(hidden)]
191        impl ::core::convert::From<UnderlyingRustTuple<'_>>
192        for ERC20InsufficientAllowance {
193            fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
194                Self {
195                    spender: tuple.0,
196                    allowance: tuple.1,
197                    needed: tuple.2,
198                }
199            }
200        }
201        #[automatically_derived]
202        impl alloy_sol_types::SolError for ERC20InsufficientAllowance {
203            type Parameters<'a> = UnderlyingSolTuple<'a>;
204            type Token<'a> = <Self::Parameters<
205                'a,
206            > as alloy_sol_types::SolType>::Token<'a>;
207            const SIGNATURE: &'static str = "ERC20InsufficientAllowance(address,uint256,uint256)";
208            const SELECTOR: [u8; 4] = [251u8, 143u8, 65u8, 178u8];
209            #[inline]
210            fn new<'a>(
211                tuple: <Self::Parameters<'a> as alloy_sol_types::SolType>::RustType,
212            ) -> Self {
213                tuple.into()
214            }
215            #[inline]
216            fn tokenize(&self) -> Self::Token<'_> {
217                (
218                    <alloy::sol_types::sol_data::Address as alloy_sol_types::SolType>::tokenize(
219                        &self.spender,
220                    ),
221                    <alloy::sol_types::sol_data::Uint<
222                        256,
223                    > as alloy_sol_types::SolType>::tokenize(&self.allowance),
224                    <alloy::sol_types::sol_data::Uint<
225                        256,
226                    > as alloy_sol_types::SolType>::tokenize(&self.needed),
227                )
228            }
229        }
230    };
231    /**Custom error with signature `ERC20InsufficientBalance(address,uint256,uint256)` and selector `0xe450d38c`.
232```solidity
233error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);
234```*/
235    #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
236    #[derive(Clone)]
237    pub struct ERC20InsufficientBalance {
238        #[allow(missing_docs)]
239        pub sender: alloy::sol_types::private::Address,
240        #[allow(missing_docs)]
241        pub balance: alloy::sol_types::private::primitives::aliases::U256,
242        #[allow(missing_docs)]
243        pub needed: alloy::sol_types::private::primitives::aliases::U256,
244    }
245    #[allow(
246        non_camel_case_types,
247        non_snake_case,
248        clippy::pub_underscore_fields,
249        clippy::style
250    )]
251    const _: () = {
252        use alloy::sol_types as alloy_sol_types;
253        #[doc(hidden)]
254        type UnderlyingSolTuple<'a> = (
255            alloy::sol_types::sol_data::Address,
256            alloy::sol_types::sol_data::Uint<256>,
257            alloy::sol_types::sol_data::Uint<256>,
258        );
259        #[doc(hidden)]
260        type UnderlyingRustTuple<'a> = (
261            alloy::sol_types::private::Address,
262            alloy::sol_types::private::primitives::aliases::U256,
263            alloy::sol_types::private::primitives::aliases::U256,
264        );
265        #[cfg(test)]
266        #[allow(dead_code, unreachable_patterns)]
267        fn _type_assertion(
268            _t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>,
269        ) {
270            match _t {
271                alloy_sol_types::private::AssertTypeEq::<
272                    <UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
273                >(_) => {}
274            }
275        }
276        #[automatically_derived]
277        #[doc(hidden)]
278        impl ::core::convert::From<ERC20InsufficientBalance>
279        for UnderlyingRustTuple<'_> {
280            fn from(value: ERC20InsufficientBalance) -> Self {
281                (value.sender, value.balance, value.needed)
282            }
283        }
284        #[automatically_derived]
285        #[doc(hidden)]
286        impl ::core::convert::From<UnderlyingRustTuple<'_>>
287        for ERC20InsufficientBalance {
288            fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
289                Self {
290                    sender: tuple.0,
291                    balance: tuple.1,
292                    needed: tuple.2,
293                }
294            }
295        }
296        #[automatically_derived]
297        impl alloy_sol_types::SolError for ERC20InsufficientBalance {
298            type Parameters<'a> = UnderlyingSolTuple<'a>;
299            type Token<'a> = <Self::Parameters<
300                'a,
301            > as alloy_sol_types::SolType>::Token<'a>;
302            const SIGNATURE: &'static str = "ERC20InsufficientBalance(address,uint256,uint256)";
303            const SELECTOR: [u8; 4] = [228u8, 80u8, 211u8, 140u8];
304            #[inline]
305            fn new<'a>(
306                tuple: <Self::Parameters<'a> as alloy_sol_types::SolType>::RustType,
307            ) -> Self {
308                tuple.into()
309            }
310            #[inline]
311            fn tokenize(&self) -> Self::Token<'_> {
312                (
313                    <alloy::sol_types::sol_data::Address as alloy_sol_types::SolType>::tokenize(
314                        &self.sender,
315                    ),
316                    <alloy::sol_types::sol_data::Uint<
317                        256,
318                    > as alloy_sol_types::SolType>::tokenize(&self.balance),
319                    <alloy::sol_types::sol_data::Uint<
320                        256,
321                    > as alloy_sol_types::SolType>::tokenize(&self.needed),
322                )
323            }
324        }
325    };
326    /**Custom error with signature `ERC20InvalidApprover(address)` and selector `0xe602df05`.
327```solidity
328error ERC20InvalidApprover(address approver);
329```*/
330    #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
331    #[derive(Clone)]
332    pub struct ERC20InvalidApprover {
333        #[allow(missing_docs)]
334        pub approver: alloy::sol_types::private::Address,
335    }
336    #[allow(
337        non_camel_case_types,
338        non_snake_case,
339        clippy::pub_underscore_fields,
340        clippy::style
341    )]
342    const _: () = {
343        use alloy::sol_types as alloy_sol_types;
344        #[doc(hidden)]
345        type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::Address,);
346        #[doc(hidden)]
347        type UnderlyingRustTuple<'a> = (alloy::sol_types::private::Address,);
348        #[cfg(test)]
349        #[allow(dead_code, unreachable_patterns)]
350        fn _type_assertion(
351            _t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>,
352        ) {
353            match _t {
354                alloy_sol_types::private::AssertTypeEq::<
355                    <UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
356                >(_) => {}
357            }
358        }
359        #[automatically_derived]
360        #[doc(hidden)]
361        impl ::core::convert::From<ERC20InvalidApprover> for UnderlyingRustTuple<'_> {
362            fn from(value: ERC20InvalidApprover) -> Self {
363                (value.approver,)
364            }
365        }
366        #[automatically_derived]
367        #[doc(hidden)]
368        impl ::core::convert::From<UnderlyingRustTuple<'_>> for ERC20InvalidApprover {
369            fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
370                Self { approver: tuple.0 }
371            }
372        }
373        #[automatically_derived]
374        impl alloy_sol_types::SolError for ERC20InvalidApprover {
375            type Parameters<'a> = UnderlyingSolTuple<'a>;
376            type Token<'a> = <Self::Parameters<
377                'a,
378            > as alloy_sol_types::SolType>::Token<'a>;
379            const SIGNATURE: &'static str = "ERC20InvalidApprover(address)";
380            const SELECTOR: [u8; 4] = [230u8, 2u8, 223u8, 5u8];
381            #[inline]
382            fn new<'a>(
383                tuple: <Self::Parameters<'a> as alloy_sol_types::SolType>::RustType,
384            ) -> Self {
385                tuple.into()
386            }
387            #[inline]
388            fn tokenize(&self) -> Self::Token<'_> {
389                (
390                    <alloy::sol_types::sol_data::Address as alloy_sol_types::SolType>::tokenize(
391                        &self.approver,
392                    ),
393                )
394            }
395        }
396    };
397    /**Custom error with signature `ERC20InvalidReceiver(address)` and selector `0xec442f05`.
398```solidity
399error ERC20InvalidReceiver(address receiver);
400```*/
401    #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
402    #[derive(Clone)]
403    pub struct ERC20InvalidReceiver {
404        #[allow(missing_docs)]
405        pub receiver: alloy::sol_types::private::Address,
406    }
407    #[allow(
408        non_camel_case_types,
409        non_snake_case,
410        clippy::pub_underscore_fields,
411        clippy::style
412    )]
413    const _: () = {
414        use alloy::sol_types as alloy_sol_types;
415        #[doc(hidden)]
416        type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::Address,);
417        #[doc(hidden)]
418        type UnderlyingRustTuple<'a> = (alloy::sol_types::private::Address,);
419        #[cfg(test)]
420        #[allow(dead_code, unreachable_patterns)]
421        fn _type_assertion(
422            _t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>,
423        ) {
424            match _t {
425                alloy_sol_types::private::AssertTypeEq::<
426                    <UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
427                >(_) => {}
428            }
429        }
430        #[automatically_derived]
431        #[doc(hidden)]
432        impl ::core::convert::From<ERC20InvalidReceiver> for UnderlyingRustTuple<'_> {
433            fn from(value: ERC20InvalidReceiver) -> Self {
434                (value.receiver,)
435            }
436        }
437        #[automatically_derived]
438        #[doc(hidden)]
439        impl ::core::convert::From<UnderlyingRustTuple<'_>> for ERC20InvalidReceiver {
440            fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
441                Self { receiver: tuple.0 }
442            }
443        }
444        #[automatically_derived]
445        impl alloy_sol_types::SolError for ERC20InvalidReceiver {
446            type Parameters<'a> = UnderlyingSolTuple<'a>;
447            type Token<'a> = <Self::Parameters<
448                'a,
449            > as alloy_sol_types::SolType>::Token<'a>;
450            const SIGNATURE: &'static str = "ERC20InvalidReceiver(address)";
451            const SELECTOR: [u8; 4] = [236u8, 68u8, 47u8, 5u8];
452            #[inline]
453            fn new<'a>(
454                tuple: <Self::Parameters<'a> as alloy_sol_types::SolType>::RustType,
455            ) -> Self {
456                tuple.into()
457            }
458            #[inline]
459            fn tokenize(&self) -> Self::Token<'_> {
460                (
461                    <alloy::sol_types::sol_data::Address as alloy_sol_types::SolType>::tokenize(
462                        &self.receiver,
463                    ),
464                )
465            }
466        }
467    };
468    /**Custom error with signature `ERC20InvalidSender(address)` and selector `0x96c6fd1e`.
469```solidity
470error ERC20InvalidSender(address sender);
471```*/
472    #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
473    #[derive(Clone)]
474    pub struct ERC20InvalidSender {
475        #[allow(missing_docs)]
476        pub sender: alloy::sol_types::private::Address,
477    }
478    #[allow(
479        non_camel_case_types,
480        non_snake_case,
481        clippy::pub_underscore_fields,
482        clippy::style
483    )]
484    const _: () = {
485        use alloy::sol_types as alloy_sol_types;
486        #[doc(hidden)]
487        type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::Address,);
488        #[doc(hidden)]
489        type UnderlyingRustTuple<'a> = (alloy::sol_types::private::Address,);
490        #[cfg(test)]
491        #[allow(dead_code, unreachable_patterns)]
492        fn _type_assertion(
493            _t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>,
494        ) {
495            match _t {
496                alloy_sol_types::private::AssertTypeEq::<
497                    <UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
498                >(_) => {}
499            }
500        }
501        #[automatically_derived]
502        #[doc(hidden)]
503        impl ::core::convert::From<ERC20InvalidSender> for UnderlyingRustTuple<'_> {
504            fn from(value: ERC20InvalidSender) -> Self {
505                (value.sender,)
506            }
507        }
508        #[automatically_derived]
509        #[doc(hidden)]
510        impl ::core::convert::From<UnderlyingRustTuple<'_>> for ERC20InvalidSender {
511            fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
512                Self { sender: tuple.0 }
513            }
514        }
515        #[automatically_derived]
516        impl alloy_sol_types::SolError for ERC20InvalidSender {
517            type Parameters<'a> = UnderlyingSolTuple<'a>;
518            type Token<'a> = <Self::Parameters<
519                'a,
520            > as alloy_sol_types::SolType>::Token<'a>;
521            const SIGNATURE: &'static str = "ERC20InvalidSender(address)";
522            const SELECTOR: [u8; 4] = [150u8, 198u8, 253u8, 30u8];
523            #[inline]
524            fn new<'a>(
525                tuple: <Self::Parameters<'a> as alloy_sol_types::SolType>::RustType,
526            ) -> Self {
527                tuple.into()
528            }
529            #[inline]
530            fn tokenize(&self) -> Self::Token<'_> {
531                (
532                    <alloy::sol_types::sol_data::Address as alloy_sol_types::SolType>::tokenize(
533                        &self.sender,
534                    ),
535                )
536            }
537        }
538    };
539    /**Custom error with signature `ERC20InvalidSpender(address)` and selector `0x94280d62`.
540```solidity
541error ERC20InvalidSpender(address spender);
542```*/
543    #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
544    #[derive(Clone)]
545    pub struct ERC20InvalidSpender {
546        #[allow(missing_docs)]
547        pub spender: alloy::sol_types::private::Address,
548    }
549    #[allow(
550        non_camel_case_types,
551        non_snake_case,
552        clippy::pub_underscore_fields,
553        clippy::style
554    )]
555    const _: () = {
556        use alloy::sol_types as alloy_sol_types;
557        #[doc(hidden)]
558        type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::Address,);
559        #[doc(hidden)]
560        type UnderlyingRustTuple<'a> = (alloy::sol_types::private::Address,);
561        #[cfg(test)]
562        #[allow(dead_code, unreachable_patterns)]
563        fn _type_assertion(
564            _t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>,
565        ) {
566            match _t {
567                alloy_sol_types::private::AssertTypeEq::<
568                    <UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
569                >(_) => {}
570            }
571        }
572        #[automatically_derived]
573        #[doc(hidden)]
574        impl ::core::convert::From<ERC20InvalidSpender> for UnderlyingRustTuple<'_> {
575            fn from(value: ERC20InvalidSpender) -> Self {
576                (value.spender,)
577            }
578        }
579        #[automatically_derived]
580        #[doc(hidden)]
581        impl ::core::convert::From<UnderlyingRustTuple<'_>> for ERC20InvalidSpender {
582            fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
583                Self { spender: tuple.0 }
584            }
585        }
586        #[automatically_derived]
587        impl alloy_sol_types::SolError for ERC20InvalidSpender {
588            type Parameters<'a> = UnderlyingSolTuple<'a>;
589            type Token<'a> = <Self::Parameters<
590                'a,
591            > as alloy_sol_types::SolType>::Token<'a>;
592            const SIGNATURE: &'static str = "ERC20InvalidSpender(address)";
593            const SELECTOR: [u8; 4] = [148u8, 40u8, 13u8, 98u8];
594            #[inline]
595            fn new<'a>(
596                tuple: <Self::Parameters<'a> as alloy_sol_types::SolType>::RustType,
597            ) -> Self {
598                tuple.into()
599            }
600            #[inline]
601            fn tokenize(&self) -> Self::Token<'_> {
602                (
603                    <alloy::sol_types::sol_data::Address as alloy_sol_types::SolType>::tokenize(
604                        &self.spender,
605                    ),
606                )
607            }
608        }
609    };
610    ///Container for all the [`IERC20Errors`](self) custom errors.
611    pub enum IERC20ErrorsErrors {
612        #[allow(missing_docs)]
613        ERC20InsufficientAllowance(ERC20InsufficientAllowance),
614        #[allow(missing_docs)]
615        ERC20InsufficientBalance(ERC20InsufficientBalance),
616        #[allow(missing_docs)]
617        ERC20InvalidApprover(ERC20InvalidApprover),
618        #[allow(missing_docs)]
619        ERC20InvalidReceiver(ERC20InvalidReceiver),
620        #[allow(missing_docs)]
621        ERC20InvalidSender(ERC20InvalidSender),
622        #[allow(missing_docs)]
623        ERC20InvalidSpender(ERC20InvalidSpender),
624    }
625    #[automatically_derived]
626    impl IERC20ErrorsErrors {
627        /// All the selectors of this enum.
628        ///
629        /// Note that the selectors might not be in the same order as the variants.
630        /// No guarantees are made about the order of the selectors.
631        ///
632        /// Prefer using `SolInterface` methods instead.
633        pub const SELECTORS: &'static [[u8; 4usize]] = &[
634            [148u8, 40u8, 13u8, 98u8],
635            [150u8, 198u8, 253u8, 30u8],
636            [228u8, 80u8, 211u8, 140u8],
637            [230u8, 2u8, 223u8, 5u8],
638            [236u8, 68u8, 47u8, 5u8],
639            [251u8, 143u8, 65u8, 178u8],
640        ];
641    }
642    #[automatically_derived]
643    impl alloy_sol_types::SolInterface for IERC20ErrorsErrors {
644        const NAME: &'static str = "IERC20ErrorsErrors";
645        const MIN_DATA_LENGTH: usize = 32usize;
646        const COUNT: usize = 6usize;
647        #[inline]
648        fn selector(&self) -> [u8; 4] {
649            match self {
650                Self::ERC20InsufficientAllowance(_) => {
651                    <ERC20InsufficientAllowance as alloy_sol_types::SolError>::SELECTOR
652                }
653                Self::ERC20InsufficientBalance(_) => {
654                    <ERC20InsufficientBalance as alloy_sol_types::SolError>::SELECTOR
655                }
656                Self::ERC20InvalidApprover(_) => {
657                    <ERC20InvalidApprover as alloy_sol_types::SolError>::SELECTOR
658                }
659                Self::ERC20InvalidReceiver(_) => {
660                    <ERC20InvalidReceiver as alloy_sol_types::SolError>::SELECTOR
661                }
662                Self::ERC20InvalidSender(_) => {
663                    <ERC20InvalidSender as alloy_sol_types::SolError>::SELECTOR
664                }
665                Self::ERC20InvalidSpender(_) => {
666                    <ERC20InvalidSpender as alloy_sol_types::SolError>::SELECTOR
667                }
668            }
669        }
670        #[inline]
671        fn selector_at(i: usize) -> ::core::option::Option<[u8; 4]> {
672            Self::SELECTORS.get(i).copied()
673        }
674        #[inline]
675        fn valid_selector(selector: [u8; 4]) -> bool {
676            Self::SELECTORS.binary_search(&selector).is_ok()
677        }
678        #[inline]
679        #[allow(non_snake_case)]
680        fn abi_decode_raw(
681            selector: [u8; 4],
682            data: &[u8],
683            validate: bool,
684        ) -> alloy_sol_types::Result<Self> {
685            static DECODE_SHIMS: &[fn(
686                &[u8],
687                bool,
688            ) -> alloy_sol_types::Result<IERC20ErrorsErrors>] = &[
689                {
690                    fn ERC20InvalidSpender(
691                        data: &[u8],
692                        validate: bool,
693                    ) -> alloy_sol_types::Result<IERC20ErrorsErrors> {
694                        <ERC20InvalidSpender as alloy_sol_types::SolError>::abi_decode_raw(
695                                data,
696                                validate,
697                            )
698                            .map(IERC20ErrorsErrors::ERC20InvalidSpender)
699                    }
700                    ERC20InvalidSpender
701                },
702                {
703                    fn ERC20InvalidSender(
704                        data: &[u8],
705                        validate: bool,
706                    ) -> alloy_sol_types::Result<IERC20ErrorsErrors> {
707                        <ERC20InvalidSender as alloy_sol_types::SolError>::abi_decode_raw(
708                                data,
709                                validate,
710                            )
711                            .map(IERC20ErrorsErrors::ERC20InvalidSender)
712                    }
713                    ERC20InvalidSender
714                },
715                {
716                    fn ERC20InsufficientBalance(
717                        data: &[u8],
718                        validate: bool,
719                    ) -> alloy_sol_types::Result<IERC20ErrorsErrors> {
720                        <ERC20InsufficientBalance as alloy_sol_types::SolError>::abi_decode_raw(
721                                data,
722                                validate,
723                            )
724                            .map(IERC20ErrorsErrors::ERC20InsufficientBalance)
725                    }
726                    ERC20InsufficientBalance
727                },
728                {
729                    fn ERC20InvalidApprover(
730                        data: &[u8],
731                        validate: bool,
732                    ) -> alloy_sol_types::Result<IERC20ErrorsErrors> {
733                        <ERC20InvalidApprover as alloy_sol_types::SolError>::abi_decode_raw(
734                                data,
735                                validate,
736                            )
737                            .map(IERC20ErrorsErrors::ERC20InvalidApprover)
738                    }
739                    ERC20InvalidApprover
740                },
741                {
742                    fn ERC20InvalidReceiver(
743                        data: &[u8],
744                        validate: bool,
745                    ) -> alloy_sol_types::Result<IERC20ErrorsErrors> {
746                        <ERC20InvalidReceiver as alloy_sol_types::SolError>::abi_decode_raw(
747                                data,
748                                validate,
749                            )
750                            .map(IERC20ErrorsErrors::ERC20InvalidReceiver)
751                    }
752                    ERC20InvalidReceiver
753                },
754                {
755                    fn ERC20InsufficientAllowance(
756                        data: &[u8],
757                        validate: bool,
758                    ) -> alloy_sol_types::Result<IERC20ErrorsErrors> {
759                        <ERC20InsufficientAllowance as alloy_sol_types::SolError>::abi_decode_raw(
760                                data,
761                                validate,
762                            )
763                            .map(IERC20ErrorsErrors::ERC20InsufficientAllowance)
764                    }
765                    ERC20InsufficientAllowance
766                },
767            ];
768            let Ok(idx) = Self::SELECTORS.binary_search(&selector) else {
769                return Err(
770                    alloy_sol_types::Error::unknown_selector(
771                        <Self as alloy_sol_types::SolInterface>::NAME,
772                        selector,
773                    ),
774                );
775            };
776            DECODE_SHIMS[idx](data, validate)
777        }
778        #[inline]
779        fn abi_encoded_size(&self) -> usize {
780            match self {
781                Self::ERC20InsufficientAllowance(inner) => {
782                    <ERC20InsufficientAllowance as alloy_sol_types::SolError>::abi_encoded_size(
783                        inner,
784                    )
785                }
786                Self::ERC20InsufficientBalance(inner) => {
787                    <ERC20InsufficientBalance as alloy_sol_types::SolError>::abi_encoded_size(
788                        inner,
789                    )
790                }
791                Self::ERC20InvalidApprover(inner) => {
792                    <ERC20InvalidApprover as alloy_sol_types::SolError>::abi_encoded_size(
793                        inner,
794                    )
795                }
796                Self::ERC20InvalidReceiver(inner) => {
797                    <ERC20InvalidReceiver as alloy_sol_types::SolError>::abi_encoded_size(
798                        inner,
799                    )
800                }
801                Self::ERC20InvalidSender(inner) => {
802                    <ERC20InvalidSender as alloy_sol_types::SolError>::abi_encoded_size(
803                        inner,
804                    )
805                }
806                Self::ERC20InvalidSpender(inner) => {
807                    <ERC20InvalidSpender as alloy_sol_types::SolError>::abi_encoded_size(
808                        inner,
809                    )
810                }
811            }
812        }
813        #[inline]
814        fn abi_encode_raw(&self, out: &mut alloy_sol_types::private::Vec<u8>) {
815            match self {
816                Self::ERC20InsufficientAllowance(inner) => {
817                    <ERC20InsufficientAllowance as alloy_sol_types::SolError>::abi_encode_raw(
818                        inner,
819                        out,
820                    )
821                }
822                Self::ERC20InsufficientBalance(inner) => {
823                    <ERC20InsufficientBalance as alloy_sol_types::SolError>::abi_encode_raw(
824                        inner,
825                        out,
826                    )
827                }
828                Self::ERC20InvalidApprover(inner) => {
829                    <ERC20InvalidApprover as alloy_sol_types::SolError>::abi_encode_raw(
830                        inner,
831                        out,
832                    )
833                }
834                Self::ERC20InvalidReceiver(inner) => {
835                    <ERC20InvalidReceiver as alloy_sol_types::SolError>::abi_encode_raw(
836                        inner,
837                        out,
838                    )
839                }
840                Self::ERC20InvalidSender(inner) => {
841                    <ERC20InvalidSender as alloy_sol_types::SolError>::abi_encode_raw(
842                        inner,
843                        out,
844                    )
845                }
846                Self::ERC20InvalidSpender(inner) => {
847                    <ERC20InvalidSpender as alloy_sol_types::SolError>::abi_encode_raw(
848                        inner,
849                        out,
850                    )
851                }
852            }
853        }
854    }
855    use alloy::contract as alloy_contract;
856    /**Creates a new wrapper around an on-chain [`IERC20Errors`](self) contract instance.
857
858See the [wrapper's documentation](`IERC20ErrorsInstance`) for more details.*/
859    #[inline]
860    pub const fn new<
861        T: alloy_contract::private::Transport + ::core::clone::Clone,
862        P: alloy_contract::private::Provider<T, N>,
863        N: alloy_contract::private::Network,
864    >(
865        address: alloy_sol_types::private::Address,
866        provider: P,
867    ) -> IERC20ErrorsInstance<T, P, N> {
868        IERC20ErrorsInstance::<T, P, N>::new(address, provider)
869    }
870    /**Deploys this contract using the given `provider` and constructor arguments, if any.
871
872Returns a new instance of the contract, if the deployment was successful.
873
874For more fine-grained control over the deployment process, use [`deploy_builder`] instead.*/
875    #[inline]
876    pub fn deploy<
877        T: alloy_contract::private::Transport + ::core::clone::Clone,
878        P: alloy_contract::private::Provider<T, N>,
879        N: alloy_contract::private::Network,
880    >(
881        provider: P,
882    ) -> impl ::core::future::Future<
883        Output = alloy_contract::Result<IERC20ErrorsInstance<T, P, N>>,
884    > {
885        IERC20ErrorsInstance::<T, P, N>::deploy(provider)
886    }
887    /**Creates a `RawCallBuilder` for deploying this contract using the given `provider`
888and constructor arguments, if any.
889
890This is a simple wrapper around creating a `RawCallBuilder` with the data set to
891the bytecode concatenated with the constructor's ABI-encoded arguments.*/
892    #[inline]
893    pub fn deploy_builder<
894        T: alloy_contract::private::Transport + ::core::clone::Clone,
895        P: alloy_contract::private::Provider<T, N>,
896        N: alloy_contract::private::Network,
897    >(provider: P) -> alloy_contract::RawCallBuilder<T, P, N> {
898        IERC20ErrorsInstance::<T, P, N>::deploy_builder(provider)
899    }
900    /**A [`IERC20Errors`](self) instance.
901
902Contains type-safe methods for interacting with an on-chain instance of the
903[`IERC20Errors`](self) contract located at a given `address`, using a given
904provider `P`.
905
906If the contract bytecode is available (see the [`sol!`](alloy_sol_types::sol!)
907documentation on how to provide it), the `deploy` and `deploy_builder` methods can
908be used to deploy a new instance of the contract.
909
910See the [module-level documentation](self) for all the available methods.*/
911    #[derive(Clone)]
912    pub struct IERC20ErrorsInstance<T, P, N = alloy_contract::private::Ethereum> {
913        address: alloy_sol_types::private::Address,
914        provider: P,
915        _network_transport: ::core::marker::PhantomData<(N, T)>,
916    }
917    #[automatically_derived]
918    impl<T, P, N> ::core::fmt::Debug for IERC20ErrorsInstance<T, P, N> {
919        #[inline]
920        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
921            f.debug_tuple("IERC20ErrorsInstance").field(&self.address).finish()
922        }
923    }
924    /// Instantiation and getters/setters.
925    #[automatically_derived]
926    impl<
927        T: alloy_contract::private::Transport + ::core::clone::Clone,
928        P: alloy_contract::private::Provider<T, N>,
929        N: alloy_contract::private::Network,
930    > IERC20ErrorsInstance<T, P, N> {
931        /**Creates a new wrapper around an on-chain [`IERC20Errors`](self) contract instance.
932
933See the [wrapper's documentation](`IERC20ErrorsInstance`) for more details.*/
934        #[inline]
935        pub const fn new(
936            address: alloy_sol_types::private::Address,
937            provider: P,
938        ) -> Self {
939            Self {
940                address,
941                provider,
942                _network_transport: ::core::marker::PhantomData,
943            }
944        }
945        /**Deploys this contract using the given `provider` and constructor arguments, if any.
946
947Returns a new instance of the contract, if the deployment was successful.
948
949For more fine-grained control over the deployment process, use [`deploy_builder`] instead.*/
950        #[inline]
951        pub async fn deploy(
952            provider: P,
953        ) -> alloy_contract::Result<IERC20ErrorsInstance<T, P, N>> {
954            let call_builder = Self::deploy_builder(provider);
955            let contract_address = call_builder.deploy().await?;
956            Ok(Self::new(contract_address, call_builder.provider))
957        }
958        /**Creates a `RawCallBuilder` for deploying this contract using the given `provider`
959and constructor arguments, if any.
960
961This is a simple wrapper around creating a `RawCallBuilder` with the data set to
962the bytecode concatenated with the constructor's ABI-encoded arguments.*/
963        #[inline]
964        pub fn deploy_builder(provider: P) -> alloy_contract::RawCallBuilder<T, P, N> {
965            alloy_contract::RawCallBuilder::new_raw_deploy(
966                provider,
967                ::core::clone::Clone::clone(&BYTECODE),
968            )
969        }
970        /// Returns a reference to the address.
971        #[inline]
972        pub const fn address(&self) -> &alloy_sol_types::private::Address {
973            &self.address
974        }
975        /// Sets the address.
976        #[inline]
977        pub fn set_address(&mut self, address: alloy_sol_types::private::Address) {
978            self.address = address;
979        }
980        /// Sets the address and returns `self`.
981        pub fn at(mut self, address: alloy_sol_types::private::Address) -> Self {
982            self.set_address(address);
983            self
984        }
985        /// Returns a reference to the provider.
986        #[inline]
987        pub const fn provider(&self) -> &P {
988            &self.provider
989        }
990    }
991    impl<T, P: ::core::clone::Clone, N> IERC20ErrorsInstance<T, &P, N> {
992        /// Clones the provider and returns a new instance with the cloned provider.
993        #[inline]
994        pub fn with_cloned_provider(self) -> IERC20ErrorsInstance<T, P, N> {
995            IERC20ErrorsInstance {
996                address: self.address,
997                provider: ::core::clone::Clone::clone(&self.provider),
998                _network_transport: ::core::marker::PhantomData,
999            }
1000        }
1001    }
1002    /// Function calls.
1003    #[automatically_derived]
1004    impl<
1005        T: alloy_contract::private::Transport + ::core::clone::Clone,
1006        P: alloy_contract::private::Provider<T, N>,
1007        N: alloy_contract::private::Network,
1008    > IERC20ErrorsInstance<T, P, N> {
1009        /// Creates a new call builder using this contract instance's provider and address.
1010        ///
1011        /// Note that the call can be any function call, not just those defined in this
1012        /// contract. Prefer using the other methods for building type-safe contract calls.
1013        pub fn call_builder<C: alloy_sol_types::SolCall>(
1014            &self,
1015            call: &C,
1016        ) -> alloy_contract::SolCallBuilder<T, &P, C, N> {
1017            alloy_contract::SolCallBuilder::new_sol(&self.provider, &self.address, call)
1018        }
1019    }
1020    /// Event filters.
1021    #[automatically_derived]
1022    impl<
1023        T: alloy_contract::private::Transport + ::core::clone::Clone,
1024        P: alloy_contract::private::Provider<T, N>,
1025        N: alloy_contract::private::Network,
1026    > IERC20ErrorsInstance<T, P, N> {
1027        /// Creates a new event filter using this contract instance's provider and address.
1028        ///
1029        /// Note that the type can be any event, not just those defined in this contract.
1030        /// Prefer using the other methods for building type-safe event filters.
1031        pub fn event_filter<E: alloy_sol_types::SolEvent>(
1032            &self,
1033        ) -> alloy_contract::Event<T, &P, E, N> {
1034            alloy_contract::Event::new_sol(&self.provider, &self.address)
1035        }
1036    }
1037}