openzeppelin_rs/contracts/
ERC1820Implementer.rs

1pub use erc1820_implementer::*;
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 erc1820_implementer {
13    #[rustfmt::skip]
14    const __ABI: &str = "[{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"interfaceHash\",\"type\":\"bytes32\",\"components\":[]},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"canImplementInterfaceForAddress\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\",\"components\":[]}]}]";
15    ///The parsed JSON ABI of the contract.
16    pub static ERC1820IMPLEMENTER_ABI: ::ethers_contract::Lazy<
17        ::ethers_core::abi::Abi,
18    > = ::ethers_contract::Lazy::new(|| {
19        ::ethers_core::utils::__serde_json::from_str(__ABI).expect("ABI is always valid")
20    });
21    #[rustfmt::skip]
22    const __BYTECODE: &[u8] = &[
23        96,
24        128,
25        96,
26        64,
27        82,
28        52,
29        128,
30        21,
31        97,
32        0,
33        16,
34        87,
35        96,
36        0,
37        128,
38        253,
39        91,
40        80,
41        97,
42        1,
43        20,
44        128,
45        97,
46        0,
47        32,
48        96,
49        0,
50        57,
51        96,
52        0,
53        243,
54        254,
55        96,
56        128,
57        96,
58        64,
59        82,
60        52,
61        128,
62        21,
63        96,
64        15,
65        87,
66        96,
67        0,
68        128,
69        253,
70        91,
71        80,
72        96,
73        4,
74        54,
75        16,
76        96,
77        40,
78        87,
79        96,
80        0,
81        53,
82        96,
83        224,
84        28,
85        128,
86        99,
87        36,
88        156,
89        179,
90        250,
91        20,
92        96,
93        45,
94        87,
95        91,
96        96,
97        0,
98        128,
99        253,
100        91,
101        96,
102        60,
103        96,
104        56,
105        54,
106        96,
107        4,
108        96,
109        164,
110        86,
111        91,
112        96,
113        78,
114        86,
115        91,
116        96,
117        64,
118        81,
119        144,
120        129,
121        82,
122        96,
123        32,
124        1,
125        96,
126        64,
127        81,
128        128,
129        145,
130        3,
131        144,
132        243,
133        91,
134        96,
135        0,
136        130,
137        129,
138        82,
139        96,
140        32,
141        129,
142        129,
143        82,
144        96,
145        64,
146        128,
147        131,
148        32,
149        96,
150        1,
151        96,
152        1,
153        96,
154        160,
155        27,
156        3,
157        133,
158        22,
159        132,
160        82,
161        144,
162        145,
163        82,
164        129,
165        32,
166        84,
167        96,
168        255,
169        22,
170        96,
171        123,
172        87,
173        96,
174        0,
175        96,
176        157,
177        86,
178        91,
179        127,
180        162,
181        239,
182        70,
183        0,
184        215,
185        66,
186        2,
187        45,
188        83,
189        45,
190        71,
191        71,
192        203,
193        53,
194        71,
195        71,
196        70,
197        103,
198        214,
199        241,
200        56,
201        4,
202        144,
203        37,
204        19,
205        178,
206        236,
207        1,
208        200,
209        72,
210        244,
211        180,
212        91,
213        147,
214        146,
215        80,
216        80,
217        80,
218        86,
219        91,
220        96,
221        0,
222        128,
223        96,
224        64,
225        131,
226        133,
227        3,
228        18,
229        21,
230        96,
231        182,
232        87,
233        96,
234        0,
235        128,
236        253,
237        91,
238        130,
239        53,
240        145,
241        80,
242        96,
243        32,
244        131,
245        1,
246        53,
247        96,
248        1,
249        96,
250        1,
251        96,
252        160,
253        27,
254        3,
255        129,
256        22,
257        129,
258        20,
259        96,
260        211,
261        87,
262        96,
263        0,
264        128,
265        253,
266        91,
267        128,
268        145,
269        80,
270        80,
271        146,
272        80,
273        146,
274        144,
275        80,
276        86,
277        254,
278        162,
279        100,
280        105,
281        112,
282        102,
283        115,
284        88,
285        34,
286        18,
287        32,
288        165,
289        151,
290        157,
291        46,
292        239,
293        137,
294        22,
295        254,
296        231,
297        41,
298        210,
299        69,
300        248,
301        135,
302        208,
303        172,
304        171,
305        79,
306        236,
307        137,
308        121,
309        197,
310        55,
311        244,
312        210,
313        99,
314        49,
315        162,
316        39,
317        151,
318        70,
319        25,
320        100,
321        115,
322        111,
323        108,
324        99,
325        67,
326        0,
327        8,
328        13,
329        0,
330        51,
331    ];
332    ///The bytecode of the contract.
333    pub static ERC1820IMPLEMENTER_BYTECODE: ::ethers_core::types::Bytes = ::ethers_core::types::Bytes::from_static(
334        __BYTECODE,
335    );
336    #[rustfmt::skip]
337    const __DEPLOYED_BYTECODE: &[u8] = &[
338        96,
339        128,
340        96,
341        64,
342        82,
343        52,
344        128,
345        21,
346        96,
347        15,
348        87,
349        96,
350        0,
351        128,
352        253,
353        91,
354        80,
355        96,
356        4,
357        54,
358        16,
359        96,
360        40,
361        87,
362        96,
363        0,
364        53,
365        96,
366        224,
367        28,
368        128,
369        99,
370        36,
371        156,
372        179,
373        250,
374        20,
375        96,
376        45,
377        87,
378        91,
379        96,
380        0,
381        128,
382        253,
383        91,
384        96,
385        60,
386        96,
387        56,
388        54,
389        96,
390        4,
391        96,
392        164,
393        86,
394        91,
395        96,
396        78,
397        86,
398        91,
399        96,
400        64,
401        81,
402        144,
403        129,
404        82,
405        96,
406        32,
407        1,
408        96,
409        64,
410        81,
411        128,
412        145,
413        3,
414        144,
415        243,
416        91,
417        96,
418        0,
419        130,
420        129,
421        82,
422        96,
423        32,
424        129,
425        129,
426        82,
427        96,
428        64,
429        128,
430        131,
431        32,
432        96,
433        1,
434        96,
435        1,
436        96,
437        160,
438        27,
439        3,
440        133,
441        22,
442        132,
443        82,
444        144,
445        145,
446        82,
447        129,
448        32,
449        84,
450        96,
451        255,
452        22,
453        96,
454        123,
455        87,
456        96,
457        0,
458        96,
459        157,
460        86,
461        91,
462        127,
463        162,
464        239,
465        70,
466        0,
467        215,
468        66,
469        2,
470        45,
471        83,
472        45,
473        71,
474        71,
475        203,
476        53,
477        71,
478        71,
479        70,
480        103,
481        214,
482        241,
483        56,
484        4,
485        144,
486        37,
487        19,
488        178,
489        236,
490        1,
491        200,
492        72,
493        244,
494        180,
495        91,
496        147,
497        146,
498        80,
499        80,
500        80,
501        86,
502        91,
503        96,
504        0,
505        128,
506        96,
507        64,
508        131,
509        133,
510        3,
511        18,
512        21,
513        96,
514        182,
515        87,
516        96,
517        0,
518        128,
519        253,
520        91,
521        130,
522        53,
523        145,
524        80,
525        96,
526        32,
527        131,
528        1,
529        53,
530        96,
531        1,
532        96,
533        1,
534        96,
535        160,
536        27,
537        3,
538        129,
539        22,
540        129,
541        20,
542        96,
543        211,
544        87,
545        96,
546        0,
547        128,
548        253,
549        91,
550        128,
551        145,
552        80,
553        80,
554        146,
555        80,
556        146,
557        144,
558        80,
559        86,
560        254,
561        162,
562        100,
563        105,
564        112,
565        102,
566        115,
567        88,
568        34,
569        18,
570        32,
571        165,
572        151,
573        157,
574        46,
575        239,
576        137,
577        22,
578        254,
579        231,
580        41,
581        210,
582        69,
583        248,
584        135,
585        208,
586        172,
587        171,
588        79,
589        236,
590        137,
591        121,
592        197,
593        55,
594        244,
595        210,
596        99,
597        49,
598        162,
599        39,
600        151,
601        70,
602        25,
603        100,
604        115,
605        111,
606        108,
607        99,
608        67,
609        0,
610        8,
611        13,
612        0,
613        51,
614    ];
615    ///The deployed bytecode of the contract.
616    pub static ERC1820IMPLEMENTER_DEPLOYED_BYTECODE: ::ethers_core::types::Bytes = ::ethers_core::types::Bytes::from_static(
617        __DEPLOYED_BYTECODE,
618    );
619    pub struct ERC1820Implementer<M>(::ethers_contract::Contract<M>);
620    impl<M> ::core::clone::Clone for ERC1820Implementer<M> {
621        fn clone(&self) -> Self {
622            Self(::core::clone::Clone::clone(&self.0))
623        }
624    }
625    impl<M> ::core::ops::Deref for ERC1820Implementer<M> {
626        type Target = ::ethers_contract::Contract<M>;
627        fn deref(&self) -> &Self::Target {
628            &self.0
629        }
630    }
631    impl<M> ::core::ops::DerefMut for ERC1820Implementer<M> {
632        fn deref_mut(&mut self) -> &mut Self::Target {
633            &mut self.0
634        }
635    }
636    impl<M> ::core::fmt::Debug for ERC1820Implementer<M> {
637        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
638            f.debug_tuple(stringify!(ERC1820Implementer)).field(&self.address()).finish()
639        }
640    }
641    impl<M: ::ethers_providers::Middleware> ERC1820Implementer<M> {
642        /// Creates a new contract instance with the specified `ethers` client at
643        /// `address`. The contract derefs to a `ethers::Contract` object.
644        pub fn new<T: Into<::ethers_core::types::Address>>(
645            address: T,
646            client: ::std::sync::Arc<M>,
647        ) -> Self {
648            Self(
649                ::ethers_contract::Contract::new(
650                    address.into(),
651                    ERC1820IMPLEMENTER_ABI.clone(),
652                    client,
653                ),
654            )
655        }
656        /// Constructs the general purpose `Deployer` instance based on the provided constructor arguments and sends it.
657        /// Returns a new instance of a deployer that returns an instance of this contract after sending the transaction
658        ///
659        /// Notes:
660        /// - If there are no constructor arguments, you should pass `()` as the argument.
661        /// - The default poll duration is 7 seconds.
662        /// - The default number of confirmations is 1 block.
663        ///
664        ///
665        /// # Example
666        ///
667        /// Generate contract bindings with `abigen!` and deploy a new contract instance.
668        ///
669        /// *Note*: this requires a `bytecode` and `abi` object in the `greeter.json` artifact.
670        ///
671        /// ```ignore
672        /// # async fn deploy<M: ethers::providers::Middleware>(client: ::std::sync::Arc<M>) {
673        ///     abigen!(Greeter, "../greeter.json");
674        ///
675        ///    let greeter_contract = Greeter::deploy(client, "Hello world!".to_string()).unwrap().send().await.unwrap();
676        ///    let msg = greeter_contract.greet().call().await.unwrap();
677        /// # }
678        /// ```
679        pub fn deploy<T: ::ethers_core::abi::Tokenize>(
680            client: ::std::sync::Arc<M>,
681            constructor_args: T,
682        ) -> ::core::result::Result<
683            ::ethers_contract::builders::ContractDeployer<M, Self>,
684            ::ethers_contract::ContractError<M>,
685        > {
686            let factory = ::ethers_contract::ContractFactory::new(
687                ERC1820IMPLEMENTER_ABI.clone(),
688                ERC1820IMPLEMENTER_BYTECODE.clone().into(),
689                client,
690            );
691            let deployer = factory.deploy(constructor_args)?;
692            let deployer = ::ethers_contract::ContractDeployer::new(deployer);
693            Ok(deployer)
694        }
695        ///Calls the contract's `canImplementInterfaceForAddress` (0x249cb3fa) function
696        pub fn can_implement_interface_for_address(
697            &self,
698            interface_hash: [u8; 32],
699            account: ::ethers_core::types::Address,
700        ) -> ::ethers_contract::builders::ContractCall<M, [u8; 32]> {
701            self.0
702                .method_hash([36, 156, 179, 250], (interface_hash, account))
703                .expect("method not found (this should never happen)")
704        }
705    }
706    impl<M: ::ethers_providers::Middleware> From<::ethers_contract::Contract<M>>
707    for ERC1820Implementer<M> {
708        fn from(contract: ::ethers_contract::Contract<M>) -> Self {
709            Self::new(contract.address(), contract.client())
710        }
711    }
712    ///Container type for all input parameters for the `canImplementInterfaceForAddress` function with signature `canImplementInterfaceForAddress(bytes32,address)` and selector `0x249cb3fa`
713    #[derive(
714        Clone,
715        ::ethers_contract::EthCall,
716        ::ethers_contract::EthDisplay,
717        Default,
718        Debug,
719        PartialEq,
720        Eq,
721        Hash
722    )]
723    #[ethcall(
724        name = "canImplementInterfaceForAddress",
725        abi = "canImplementInterfaceForAddress(bytes32,address)"
726    )]
727    pub struct CanImplementInterfaceForAddressCall {
728        pub interface_hash: [u8; 32],
729        pub account: ::ethers_core::types::Address,
730    }
731    ///Container type for all return fields from the `canImplementInterfaceForAddress` function with signature `canImplementInterfaceForAddress(bytes32,address)` and selector `0x249cb3fa`
732    #[derive(
733        Clone,
734        ::ethers_contract::EthAbiType,
735        ::ethers_contract::EthAbiCodec,
736        Default,
737        Debug,
738        PartialEq,
739        Eq,
740        Hash
741    )]
742    pub struct CanImplementInterfaceForAddressReturn(pub [u8; 32]);
743}