openzeppelin_rs/contracts/
ERC721Holder.rs

1pub use erc721_holder::*;
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 erc721_holder {
13    #[rustfmt::skip]
14    const __ABI: &str = "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\",\"components\":[]},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"onERC721Received\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\",\"components\":[]}]}]";
15    ///The parsed JSON ABI of the contract.
16    pub static ERC721HOLDER_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    #[rustfmt::skip]
19    const __BYTECODE: &[u8] = &[
20        96,
21        128,
22        96,
23        64,
24        82,
25        52,
26        128,
27        21,
28        97,
29        0,
30        16,
31        87,
32        96,
33        0,
34        128,
35        253,
36        91,
37        80,
38        97,
39        1,
40        175,
41        128,
42        97,
43        0,
44        32,
45        96,
46        0,
47        57,
48        96,
49        0,
50        243,
51        254,
52        96,
53        128,
54        96,
55        64,
56        82,
57        52,
58        128,
59        21,
60        97,
61        0,
62        16,
63        87,
64        96,
65        0,
66        128,
67        253,
68        91,
69        80,
70        96,
71        4,
72        54,
73        16,
74        97,
75        0,
76        43,
77        87,
78        96,
79        0,
80        53,
81        96,
82        224,
83        28,
84        128,
85        99,
86        21,
87        11,
88        122,
89        2,
90        20,
91        97,
92        0,
93        48,
94        87,
95        91,
96        96,
97        0,
98        128,
99        253,
100        91,
101        97,
102        0,
103        78,
104        97,
105        0,
106        62,
107        54,
108        96,
109        4,
110        97,
111        0,
112        157,
113        86,
114        91,
115        99,
116        10,
117        133,
118        189,
119        1,
120        96,
121        225,
122        27,
123        148,
124        147,
125        80,
126        80,
127        80,
128        80,
129        86,
130        91,
131        96,
132        64,
133        81,
134        96,
135        1,
136        96,
137        1,
138        96,
139        224,
140        27,
141        3,
142        25,
143        144,
144        145,
145        22,
146        129,
147        82,
148        96,
149        32,
150        1,
151        96,
152        64,
153        81,
154        128,
155        145,
156        3,
157        144,
158        243,
159        91,
160        128,
161        53,
162        96,
163        1,
164        96,
165        1,
166        96,
167        160,
168        27,
169        3,
170        129,
171        22,
172        129,
173        20,
174        97,
175        0,
176        130,
177        87,
178        96,
179        0,
180        128,
181        253,
182        91,
183        145,
184        144,
185        80,
186        86,
187        91,
188        99,
189        78,
190        72,
191        123,
192        113,
193        96,
194        224,
195        27,
196        96,
197        0,
198        82,
199        96,
200        65,
201        96,
202        4,
203        82,
204        96,
205        36,
206        96,
207        0,
208        253,
209        91,
210        96,
211        0,
212        128,
213        96,
214        0,
215        128,
216        96,
217        128,
218        133,
219        135,
220        3,
221        18,
222        21,
223        97,
224        0,
225        179,
226        87,
227        96,
228        0,
229        128,
230        253,
231        91,
232        97,
233        0,
234        188,
235        133,
236        97,
237        0,
238        107,
239        86,
240        91,
241        147,
242        80,
243        97,
244        0,
245        202,
246        96,
247        32,
248        134,
249        1,
250        97,
251        0,
252        107,
253        86,
254        91,
255        146,
256        80,
257        96,
258        64,
259        133,
260        1,
261        53,
262        145,
263        80,
264        96,
265        96,
266        133,
267        1,
268        53,
269        103,
270        255,
271        255,
272        255,
273        255,
274        255,
275        255,
276        255,
277        255,
278        128,
279        130,
280        17,
281        21,
282        97,
283        0,
284        238,
285        87,
286        96,
287        0,
288        128,
289        253,
290        91,
291        129,
292        135,
293        1,
294        145,
295        80,
296        135,
297        96,
298        31,
299        131,
300        1,
301        18,
302        97,
303        1,
304        2,
305        87,
306        96,
307        0,
308        128,
309        253,
310        91,
311        129,
312        53,
313        129,
314        129,
315        17,
316        21,
317        97,
318        1,
319        20,
320        87,
321        97,
322        1,
323        20,
324        97,
325        0,
326        135,
327        86,
328        91,
329        96,
330        64,
331        81,
332        96,
333        31,
334        130,
335        1,
336        96,
337        31,
338        25,
339        144,
340        129,
341        22,
342        96,
343        63,
344        1,
345        22,
346        129,
347        1,
348        144,
349        131,
350        130,
351        17,
352        129,
353        131,
354        16,
355        23,
356        21,
357        97,
358        1,
359        60,
360        87,
361        97,
362        1,
363        60,
364        97,
365        0,
366        135,
367        86,
368        91,
369        129,
370        96,
371        64,
372        82,
373        130,
374        129,
375        82,
376        138,
377        96,
378        32,
379        132,
380        135,
381        1,
382        1,
383        17,
384        21,
385        97,
386        1,
387        85,
388        87,
389        96,
390        0,
391        128,
392        253,
393        91,
394        130,
395        96,
396        32,
397        134,
398        1,
399        96,
400        32,
401        131,
402        1,
403        55,
404        96,
405        0,
406        96,
407        32,
408        132,
409        131,
410        1,
411        1,
412        82,
413        128,
414        149,
415        80,
416        80,
417        80,
418        80,
419        80,
420        80,
421        146,
422        149,
423        145,
424        148,
425        80,
426        146,
427        80,
428        86,
429        254,
430        162,
431        100,
432        105,
433        112,
434        102,
435        115,
436        88,
437        34,
438        18,
439        32,
440        147,
441        126,
442        126,
443        122,
444        202,
445        62,
446        210,
447        224,
448        50,
449        102,
450        178,
451        220,
452        153,
453        83,
454        0,
455        191,
456        4,
457        224,
458        241,
459        88,
460        220,
461        1,
462        85,
463        2,
464        215,
465        80,
466        64,
467        78,
468        3,
469        41,
470        48,
471        93,
472        100,
473        115,
474        111,
475        108,
476        99,
477        67,
478        0,
479        8,
480        13,
481        0,
482        51,
483    ];
484    ///The bytecode of the contract.
485    pub static ERC721HOLDER_BYTECODE: ::ethers_core::types::Bytes = ::ethers_core::types::Bytes::from_static(
486        __BYTECODE,
487    );
488    #[rustfmt::skip]
489    const __DEPLOYED_BYTECODE: &[u8] = &[
490        96,
491        128,
492        96,
493        64,
494        82,
495        52,
496        128,
497        21,
498        97,
499        0,
500        16,
501        87,
502        96,
503        0,
504        128,
505        253,
506        91,
507        80,
508        96,
509        4,
510        54,
511        16,
512        97,
513        0,
514        43,
515        87,
516        96,
517        0,
518        53,
519        96,
520        224,
521        28,
522        128,
523        99,
524        21,
525        11,
526        122,
527        2,
528        20,
529        97,
530        0,
531        48,
532        87,
533        91,
534        96,
535        0,
536        128,
537        253,
538        91,
539        97,
540        0,
541        78,
542        97,
543        0,
544        62,
545        54,
546        96,
547        4,
548        97,
549        0,
550        157,
551        86,
552        91,
553        99,
554        10,
555        133,
556        189,
557        1,
558        96,
559        225,
560        27,
561        148,
562        147,
563        80,
564        80,
565        80,
566        80,
567        86,
568        91,
569        96,
570        64,
571        81,
572        96,
573        1,
574        96,
575        1,
576        96,
577        224,
578        27,
579        3,
580        25,
581        144,
582        145,
583        22,
584        129,
585        82,
586        96,
587        32,
588        1,
589        96,
590        64,
591        81,
592        128,
593        145,
594        3,
595        144,
596        243,
597        91,
598        128,
599        53,
600        96,
601        1,
602        96,
603        1,
604        96,
605        160,
606        27,
607        3,
608        129,
609        22,
610        129,
611        20,
612        97,
613        0,
614        130,
615        87,
616        96,
617        0,
618        128,
619        253,
620        91,
621        145,
622        144,
623        80,
624        86,
625        91,
626        99,
627        78,
628        72,
629        123,
630        113,
631        96,
632        224,
633        27,
634        96,
635        0,
636        82,
637        96,
638        65,
639        96,
640        4,
641        82,
642        96,
643        36,
644        96,
645        0,
646        253,
647        91,
648        96,
649        0,
650        128,
651        96,
652        0,
653        128,
654        96,
655        128,
656        133,
657        135,
658        3,
659        18,
660        21,
661        97,
662        0,
663        179,
664        87,
665        96,
666        0,
667        128,
668        253,
669        91,
670        97,
671        0,
672        188,
673        133,
674        97,
675        0,
676        107,
677        86,
678        91,
679        147,
680        80,
681        97,
682        0,
683        202,
684        96,
685        32,
686        134,
687        1,
688        97,
689        0,
690        107,
691        86,
692        91,
693        146,
694        80,
695        96,
696        64,
697        133,
698        1,
699        53,
700        145,
701        80,
702        96,
703        96,
704        133,
705        1,
706        53,
707        103,
708        255,
709        255,
710        255,
711        255,
712        255,
713        255,
714        255,
715        255,
716        128,
717        130,
718        17,
719        21,
720        97,
721        0,
722        238,
723        87,
724        96,
725        0,
726        128,
727        253,
728        91,
729        129,
730        135,
731        1,
732        145,
733        80,
734        135,
735        96,
736        31,
737        131,
738        1,
739        18,
740        97,
741        1,
742        2,
743        87,
744        96,
745        0,
746        128,
747        253,
748        91,
749        129,
750        53,
751        129,
752        129,
753        17,
754        21,
755        97,
756        1,
757        20,
758        87,
759        97,
760        1,
761        20,
762        97,
763        0,
764        135,
765        86,
766        91,
767        96,
768        64,
769        81,
770        96,
771        31,
772        130,
773        1,
774        96,
775        31,
776        25,
777        144,
778        129,
779        22,
780        96,
781        63,
782        1,
783        22,
784        129,
785        1,
786        144,
787        131,
788        130,
789        17,
790        129,
791        131,
792        16,
793        23,
794        21,
795        97,
796        1,
797        60,
798        87,
799        97,
800        1,
801        60,
802        97,
803        0,
804        135,
805        86,
806        91,
807        129,
808        96,
809        64,
810        82,
811        130,
812        129,
813        82,
814        138,
815        96,
816        32,
817        132,
818        135,
819        1,
820        1,
821        17,
822        21,
823        97,
824        1,
825        85,
826        87,
827        96,
828        0,
829        128,
830        253,
831        91,
832        130,
833        96,
834        32,
835        134,
836        1,
837        96,
838        32,
839        131,
840        1,
841        55,
842        96,
843        0,
844        96,
845        32,
846        132,
847        131,
848        1,
849        1,
850        82,
851        128,
852        149,
853        80,
854        80,
855        80,
856        80,
857        80,
858        80,
859        146,
860        149,
861        145,
862        148,
863        80,
864        146,
865        80,
866        86,
867        254,
868        162,
869        100,
870        105,
871        112,
872        102,
873        115,
874        88,
875        34,
876        18,
877        32,
878        147,
879        126,
880        126,
881        122,
882        202,
883        62,
884        210,
885        224,
886        50,
887        102,
888        178,
889        220,
890        153,
891        83,
892        0,
893        191,
894        4,
895        224,
896        241,
897        88,
898        220,
899        1,
900        85,
901        2,
902        215,
903        80,
904        64,
905        78,
906        3,
907        41,
908        48,
909        93,
910        100,
911        115,
912        111,
913        108,
914        99,
915        67,
916        0,
917        8,
918        13,
919        0,
920        51,
921    ];
922    ///The deployed bytecode of the contract.
923    pub static ERC721HOLDER_DEPLOYED_BYTECODE: ::ethers_core::types::Bytes = ::ethers_core::types::Bytes::from_static(
924        __DEPLOYED_BYTECODE,
925    );
926    pub struct ERC721Holder<M>(::ethers_contract::Contract<M>);
927    impl<M> ::core::clone::Clone for ERC721Holder<M> {
928        fn clone(&self) -> Self {
929            Self(::core::clone::Clone::clone(&self.0))
930        }
931    }
932    impl<M> ::core::ops::Deref for ERC721Holder<M> {
933        type Target = ::ethers_contract::Contract<M>;
934        fn deref(&self) -> &Self::Target {
935            &self.0
936        }
937    }
938    impl<M> ::core::ops::DerefMut for ERC721Holder<M> {
939        fn deref_mut(&mut self) -> &mut Self::Target {
940            &mut self.0
941        }
942    }
943    impl<M> ::core::fmt::Debug for ERC721Holder<M> {
944        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
945            f.debug_tuple(stringify!(ERC721Holder)).field(&self.address()).finish()
946        }
947    }
948    impl<M: ::ethers_providers::Middleware> ERC721Holder<M> {
949        /// Creates a new contract instance with the specified `ethers` client at
950        /// `address`. The contract derefs to a `ethers::Contract` object.
951        pub fn new<T: Into<::ethers_core::types::Address>>(
952            address: T,
953            client: ::std::sync::Arc<M>,
954        ) -> Self {
955            Self(
956                ::ethers_contract::Contract::new(
957                    address.into(),
958                    ERC721HOLDER_ABI.clone(),
959                    client,
960                ),
961            )
962        }
963        /// Constructs the general purpose `Deployer` instance based on the provided constructor arguments and sends it.
964        /// Returns a new instance of a deployer that returns an instance of this contract after sending the transaction
965        ///
966        /// Notes:
967        /// - If there are no constructor arguments, you should pass `()` as the argument.
968        /// - The default poll duration is 7 seconds.
969        /// - The default number of confirmations is 1 block.
970        ///
971        ///
972        /// # Example
973        ///
974        /// Generate contract bindings with `abigen!` and deploy a new contract instance.
975        ///
976        /// *Note*: this requires a `bytecode` and `abi` object in the `greeter.json` artifact.
977        ///
978        /// ```ignore
979        /// # async fn deploy<M: ethers::providers::Middleware>(client: ::std::sync::Arc<M>) {
980        ///     abigen!(Greeter, "../greeter.json");
981        ///
982        ///    let greeter_contract = Greeter::deploy(client, "Hello world!".to_string()).unwrap().send().await.unwrap();
983        ///    let msg = greeter_contract.greet().call().await.unwrap();
984        /// # }
985        /// ```
986        pub fn deploy<T: ::ethers_core::abi::Tokenize>(
987            client: ::std::sync::Arc<M>,
988            constructor_args: T,
989        ) -> ::core::result::Result<
990            ::ethers_contract::builders::ContractDeployer<M, Self>,
991            ::ethers_contract::ContractError<M>,
992        > {
993            let factory = ::ethers_contract::ContractFactory::new(
994                ERC721HOLDER_ABI.clone(),
995                ERC721HOLDER_BYTECODE.clone().into(),
996                client,
997            );
998            let deployer = factory.deploy(constructor_args)?;
999            let deployer = ::ethers_contract::ContractDeployer::new(deployer);
1000            Ok(deployer)
1001        }
1002        ///Calls the contract's `onERC721Received` (0x150b7a02) function
1003        pub fn on_erc721_received(
1004            &self,
1005            p0: ::ethers_core::types::Address,
1006            p1: ::ethers_core::types::Address,
1007            p2: ::ethers_core::types::U256,
1008            p3: ::ethers_core::types::Bytes,
1009        ) -> ::ethers_contract::builders::ContractCall<M, [u8; 4]> {
1010            self.0
1011                .method_hash([21, 11, 122, 2], (p0, p1, p2, p3))
1012                .expect("method not found (this should never happen)")
1013        }
1014    }
1015    impl<M: ::ethers_providers::Middleware> From<::ethers_contract::Contract<M>>
1016    for ERC721Holder<M> {
1017        fn from(contract: ::ethers_contract::Contract<M>) -> Self {
1018            Self::new(contract.address(), contract.client())
1019        }
1020    }
1021    ///Container type for all input parameters for the `onERC721Received` function with signature `onERC721Received(address,address,uint256,bytes)` and selector `0x150b7a02`
1022    #[derive(
1023        Clone,
1024        ::ethers_contract::EthCall,
1025        ::ethers_contract::EthDisplay,
1026        Default,
1027        Debug,
1028        PartialEq,
1029        Eq,
1030        Hash
1031    )]
1032    #[ethcall(
1033        name = "onERC721Received",
1034        abi = "onERC721Received(address,address,uint256,bytes)"
1035    )]
1036    pub struct OnERC721ReceivedCall(
1037        pub ::ethers_core::types::Address,
1038        pub ::ethers_core::types::Address,
1039        pub ::ethers_core::types::U256,
1040        pub ::ethers_core::types::Bytes,
1041    );
1042    ///Container type for all return fields from the `onERC721Received` function with signature `onERC721Received(address,address,uint256,bytes)` and selector `0x150b7a02`
1043    #[derive(
1044        Clone,
1045        ::ethers_contract::EthAbiType,
1046        ::ethers_contract::EthAbiCodec,
1047        Default,
1048        Debug,
1049        PartialEq,
1050        Eq,
1051        Hash
1052    )]
1053    pub struct OnERC721ReceivedReturn(pub [u8; 4]);
1054}