pod_contracts/
voting.rs

1/**
2
3Generated by the following Solidity interface...
4```solidity
5interface Voting {
6    struct VotingInfo {
7        uint256 threshold;
8        uint256 deadline;
9        uint256 nonce;
10        address owner;
11    }
12
13    event Voted(bytes32 indexed votingId, address indexed voter, uint256 indexed choice);
14    event Winner(bytes32 indexed votingId, uint256 indexed choice);
15
16    function register(VotingInfo memory v) external;
17    function setWinner(VotingInfo memory v, uint256 choice) external;
18    function vote(VotingInfo memory v, uint256 choice) external;
19    function votingId(VotingInfo memory v) external pure returns (bytes32);
20}
21```
22
23...which was generated by the following JSON ABI:
24```json
25[
26  {
27    "type": "function",
28    "name": "register",
29    "inputs": [
30      {
31        "name": "v",
32        "type": "tuple",
33        "internalType": "struct Voting.VotingInfo",
34        "components": [
35          {
36            "name": "threshold",
37            "type": "uint256",
38            "internalType": "uint256"
39          },
40          {
41            "name": "deadline",
42            "type": "uint256",
43            "internalType": "uint256"
44          },
45          {
46            "name": "nonce",
47            "type": "uint256",
48            "internalType": "uint256"
49          },
50          {
51            "name": "owner",
52            "type": "address",
53            "internalType": "address"
54          }
55        ]
56      }
57    ],
58    "outputs": [],
59    "stateMutability": "nonpayable"
60  },
61  {
62    "type": "function",
63    "name": "setWinner",
64    "inputs": [
65      {
66        "name": "v",
67        "type": "tuple",
68        "internalType": "struct Voting.VotingInfo",
69        "components": [
70          {
71            "name": "threshold",
72            "type": "uint256",
73            "internalType": "uint256"
74          },
75          {
76            "name": "deadline",
77            "type": "uint256",
78            "internalType": "uint256"
79          },
80          {
81            "name": "nonce",
82            "type": "uint256",
83            "internalType": "uint256"
84          },
85          {
86            "name": "owner",
87            "type": "address",
88            "internalType": "address"
89          }
90        ]
91      },
92      {
93        "name": "choice",
94        "type": "uint256",
95        "internalType": "uint256"
96      }
97    ],
98    "outputs": [],
99    "stateMutability": "nonpayable"
100  },
101  {
102    "type": "function",
103    "name": "vote",
104    "inputs": [
105      {
106        "name": "v",
107        "type": "tuple",
108        "internalType": "struct Voting.VotingInfo",
109        "components": [
110          {
111            "name": "threshold",
112            "type": "uint256",
113            "internalType": "uint256"
114          },
115          {
116            "name": "deadline",
117            "type": "uint256",
118            "internalType": "uint256"
119          },
120          {
121            "name": "nonce",
122            "type": "uint256",
123            "internalType": "uint256"
124          },
125          {
126            "name": "owner",
127            "type": "address",
128            "internalType": "address"
129          }
130        ]
131      },
132      {
133        "name": "choice",
134        "type": "uint256",
135        "internalType": "uint256"
136      }
137    ],
138    "outputs": [],
139    "stateMutability": "nonpayable"
140  },
141  {
142    "type": "function",
143    "name": "votingId",
144    "inputs": [
145      {
146        "name": "v",
147        "type": "tuple",
148        "internalType": "struct Voting.VotingInfo",
149        "components": [
150          {
151            "name": "threshold",
152            "type": "uint256",
153            "internalType": "uint256"
154          },
155          {
156            "name": "deadline",
157            "type": "uint256",
158            "internalType": "uint256"
159          },
160          {
161            "name": "nonce",
162            "type": "uint256",
163            "internalType": "uint256"
164          },
165          {
166            "name": "owner",
167            "type": "address",
168            "internalType": "address"
169          }
170        ]
171      }
172    ],
173    "outputs": [
174      {
175        "name": "",
176        "type": "bytes32",
177        "internalType": "bytes32"
178      }
179    ],
180    "stateMutability": "pure"
181  },
182  {
183    "type": "event",
184    "name": "Voted",
185    "inputs": [
186      {
187        "name": "votingId",
188        "type": "bytes32",
189        "indexed": true,
190        "internalType": "bytes32"
191      },
192      {
193        "name": "voter",
194        "type": "address",
195        "indexed": true,
196        "internalType": "address"
197      },
198      {
199        "name": "choice",
200        "type": "uint256",
201        "indexed": true,
202        "internalType": "uint256"
203      }
204    ],
205    "anonymous": false
206  },
207  {
208    "type": "event",
209    "name": "Winner",
210    "inputs": [
211      {
212        "name": "votingId",
213        "type": "bytes32",
214        "indexed": true,
215        "internalType": "bytes32"
216      },
217      {
218        "name": "choice",
219        "type": "uint256",
220        "indexed": true,
221        "internalType": "uint256"
222      }
223    ],
224    "anonymous": false
225  }
226]
227```*/
228#[allow(
229    non_camel_case_types,
230    non_snake_case,
231    clippy::pub_underscore_fields,
232    clippy::style,
233    clippy::empty_structs_with_brackets
234)]
235pub mod Voting {
236    use super::*;
237    use alloy::sol_types as alloy_sol_types;
238    #[derive(Default, Debug, PartialEq, Eq, Hash)]
239    /**```solidity
240struct VotingInfo { uint256 threshold; uint256 deadline; uint256 nonce; address owner; }
241```*/
242    #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
243    #[derive(Clone)]
244    pub struct VotingInfo {
245        #[allow(missing_docs)]
246        pub threshold: alloy::sol_types::private::primitives::aliases::U256,
247        #[allow(missing_docs)]
248        pub deadline: alloy::sol_types::private::primitives::aliases::U256,
249        #[allow(missing_docs)]
250        pub nonce: alloy::sol_types::private::primitives::aliases::U256,
251        #[allow(missing_docs)]
252        pub owner: alloy::sol_types::private::Address,
253    }
254    #[allow(
255        non_camel_case_types,
256        non_snake_case,
257        clippy::pub_underscore_fields,
258        clippy::style
259    )]
260    const _: () = {
261        use alloy::sol_types as alloy_sol_types;
262        #[doc(hidden)]
263        type UnderlyingSolTuple<'a> = (
264            alloy::sol_types::sol_data::Uint<256>,
265            alloy::sol_types::sol_data::Uint<256>,
266            alloy::sol_types::sol_data::Uint<256>,
267            alloy::sol_types::sol_data::Address,
268        );
269        #[doc(hidden)]
270        type UnderlyingRustTuple<'a> = (
271            alloy::sol_types::private::primitives::aliases::U256,
272            alloy::sol_types::private::primitives::aliases::U256,
273            alloy::sol_types::private::primitives::aliases::U256,
274            alloy::sol_types::private::Address,
275        );
276        #[cfg(test)]
277        #[allow(dead_code, unreachable_patterns)]
278        fn _type_assertion(
279            _t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>,
280        ) {
281            match _t {
282                alloy_sol_types::private::AssertTypeEq::<
283                    <UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
284                >(_) => {}
285            }
286        }
287        #[automatically_derived]
288        #[doc(hidden)]
289        impl ::core::convert::From<VotingInfo> for UnderlyingRustTuple<'_> {
290            fn from(value: VotingInfo) -> Self {
291                (value.threshold, value.deadline, value.nonce, value.owner)
292            }
293        }
294        #[automatically_derived]
295        #[doc(hidden)]
296        impl ::core::convert::From<UnderlyingRustTuple<'_>> for VotingInfo {
297            fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
298                Self {
299                    threshold: tuple.0,
300                    deadline: tuple.1,
301                    nonce: tuple.2,
302                    owner: tuple.3,
303                }
304            }
305        }
306        #[automatically_derived]
307        impl alloy_sol_types::SolValue for VotingInfo {
308            type SolType = Self;
309        }
310        #[automatically_derived]
311        impl alloy_sol_types::private::SolTypeValue<Self> for VotingInfo {
312            #[inline]
313            fn stv_to_tokens(&self) -> <Self as alloy_sol_types::SolType>::Token<'_> {
314                (
315                    <alloy::sol_types::sol_data::Uint<
316                        256,
317                    > as alloy_sol_types::SolType>::tokenize(&self.threshold),
318                    <alloy::sol_types::sol_data::Uint<
319                        256,
320                    > as alloy_sol_types::SolType>::tokenize(&self.deadline),
321                    <alloy::sol_types::sol_data::Uint<
322                        256,
323                    > as alloy_sol_types::SolType>::tokenize(&self.nonce),
324                    <alloy::sol_types::sol_data::Address as alloy_sol_types::SolType>::tokenize(
325                        &self.owner,
326                    ),
327                )
328            }
329            #[inline]
330            fn stv_abi_encoded_size(&self) -> usize {
331                if let Some(size) = <Self as alloy_sol_types::SolType>::ENCODED_SIZE {
332                    return size;
333                }
334                let tuple = <UnderlyingRustTuple<
335                    '_,
336                > as ::core::convert::From<Self>>::from(self.clone());
337                <UnderlyingSolTuple<
338                    '_,
339                > as alloy_sol_types::SolType>::abi_encoded_size(&tuple)
340            }
341            #[inline]
342            fn stv_eip712_data_word(&self) -> alloy_sol_types::Word {
343                <Self as alloy_sol_types::SolStruct>::eip712_hash_struct(self)
344            }
345            #[inline]
346            fn stv_abi_encode_packed_to(
347                &self,
348                out: &mut alloy_sol_types::private::Vec<u8>,
349            ) {
350                let tuple = <UnderlyingRustTuple<
351                    '_,
352                > as ::core::convert::From<Self>>::from(self.clone());
353                <UnderlyingSolTuple<
354                    '_,
355                > as alloy_sol_types::SolType>::abi_encode_packed_to(&tuple, out)
356            }
357            #[inline]
358            fn stv_abi_packed_encoded_size(&self) -> usize {
359                if let Some(size) = <Self as alloy_sol_types::SolType>::PACKED_ENCODED_SIZE {
360                    return size;
361                }
362                let tuple = <UnderlyingRustTuple<
363                    '_,
364                > as ::core::convert::From<Self>>::from(self.clone());
365                <UnderlyingSolTuple<
366                    '_,
367                > as alloy_sol_types::SolType>::abi_packed_encoded_size(&tuple)
368            }
369        }
370        #[automatically_derived]
371        impl alloy_sol_types::SolType for VotingInfo {
372            type RustType = Self;
373            type Token<'a> = <UnderlyingSolTuple<
374                'a,
375            > as alloy_sol_types::SolType>::Token<'a>;
376            const SOL_NAME: &'static str = <Self as alloy_sol_types::SolStruct>::NAME;
377            const ENCODED_SIZE: Option<usize> = <UnderlyingSolTuple<
378                '_,
379            > as alloy_sol_types::SolType>::ENCODED_SIZE;
380            const PACKED_ENCODED_SIZE: Option<usize> = <UnderlyingSolTuple<
381                '_,
382            > as alloy_sol_types::SolType>::PACKED_ENCODED_SIZE;
383            #[inline]
384            fn valid_token(token: &Self::Token<'_>) -> bool {
385                <UnderlyingSolTuple<'_> as alloy_sol_types::SolType>::valid_token(token)
386            }
387            #[inline]
388            fn detokenize(token: Self::Token<'_>) -> Self::RustType {
389                let tuple = <UnderlyingSolTuple<
390                    '_,
391                > as alloy_sol_types::SolType>::detokenize(token);
392                <Self as ::core::convert::From<UnderlyingRustTuple<'_>>>::from(tuple)
393            }
394        }
395        #[automatically_derived]
396        impl alloy_sol_types::SolStruct for VotingInfo {
397            const NAME: &'static str = "VotingInfo";
398            #[inline]
399            fn eip712_root_type() -> alloy_sol_types::private::Cow<'static, str> {
400                alloy_sol_types::private::Cow::Borrowed(
401                    "VotingInfo(uint256 threshold,uint256 deadline,uint256 nonce,address owner)",
402                )
403            }
404            #[inline]
405            fn eip712_components() -> alloy_sol_types::private::Vec<
406                alloy_sol_types::private::Cow<'static, str>,
407            > {
408                alloy_sol_types::private::Vec::new()
409            }
410            #[inline]
411            fn eip712_encode_type() -> alloy_sol_types::private::Cow<'static, str> {
412                <Self as alloy_sol_types::SolStruct>::eip712_root_type()
413            }
414            #[inline]
415            fn eip712_encode_data(&self) -> alloy_sol_types::private::Vec<u8> {
416                [
417                    <alloy::sol_types::sol_data::Uint<
418                        256,
419                    > as alloy_sol_types::SolType>::eip712_data_word(&self.threshold)
420                        .0,
421                    <alloy::sol_types::sol_data::Uint<
422                        256,
423                    > as alloy_sol_types::SolType>::eip712_data_word(&self.deadline)
424                        .0,
425                    <alloy::sol_types::sol_data::Uint<
426                        256,
427                    > as alloy_sol_types::SolType>::eip712_data_word(&self.nonce)
428                        .0,
429                    <alloy::sol_types::sol_data::Address as alloy_sol_types::SolType>::eip712_data_word(
430                            &self.owner,
431                        )
432                        .0,
433                ]
434                    .concat()
435            }
436        }
437        #[automatically_derived]
438        impl alloy_sol_types::EventTopic for VotingInfo {
439            #[inline]
440            fn topic_preimage_length(rust: &Self::RustType) -> usize {
441                0usize
442                    + <alloy::sol_types::sol_data::Uint<
443                        256,
444                    > as alloy_sol_types::EventTopic>::topic_preimage_length(
445                        &rust.threshold,
446                    )
447                    + <alloy::sol_types::sol_data::Uint<
448                        256,
449                    > as alloy_sol_types::EventTopic>::topic_preimage_length(
450                        &rust.deadline,
451                    )
452                    + <alloy::sol_types::sol_data::Uint<
453                        256,
454                    > as alloy_sol_types::EventTopic>::topic_preimage_length(&rust.nonce)
455                    + <alloy::sol_types::sol_data::Address as alloy_sol_types::EventTopic>::topic_preimage_length(
456                        &rust.owner,
457                    )
458            }
459            #[inline]
460            fn encode_topic_preimage(
461                rust: &Self::RustType,
462                out: &mut alloy_sol_types::private::Vec<u8>,
463            ) {
464                out.reserve(
465                    <Self as alloy_sol_types::EventTopic>::topic_preimage_length(rust),
466                );
467                <alloy::sol_types::sol_data::Uint<
468                    256,
469                > as alloy_sol_types::EventTopic>::encode_topic_preimage(
470                    &rust.threshold,
471                    out,
472                );
473                <alloy::sol_types::sol_data::Uint<
474                    256,
475                > as alloy_sol_types::EventTopic>::encode_topic_preimage(
476                    &rust.deadline,
477                    out,
478                );
479                <alloy::sol_types::sol_data::Uint<
480                    256,
481                > as alloy_sol_types::EventTopic>::encode_topic_preimage(
482                    &rust.nonce,
483                    out,
484                );
485                <alloy::sol_types::sol_data::Address as alloy_sol_types::EventTopic>::encode_topic_preimage(
486                    &rust.owner,
487                    out,
488                );
489            }
490            #[inline]
491            fn encode_topic(
492                rust: &Self::RustType,
493            ) -> alloy_sol_types::abi::token::WordToken {
494                let mut out = alloy_sol_types::private::Vec::new();
495                <Self as alloy_sol_types::EventTopic>::encode_topic_preimage(
496                    rust,
497                    &mut out,
498                );
499                alloy_sol_types::abi::token::WordToken(
500                    alloy_sol_types::private::keccak256(out),
501                )
502            }
503        }
504    };
505    #[derive(Default, Debug, PartialEq, Eq, Hash)]
506    /**Event with signature `Voted(bytes32,address,uint256)` and selector `0xe4abc5380fa6939d1dc23b5e90b3a8a0e328f0f1a82a5f42bfb795bf9c717505`.
507```solidity
508event Voted(bytes32 indexed votingId, address indexed voter, uint256 indexed choice);
509```*/
510    #[allow(
511        non_camel_case_types,
512        non_snake_case,
513        clippy::pub_underscore_fields,
514        clippy::style
515    )]
516    #[derive(Clone)]
517    pub struct Voted {
518        #[allow(missing_docs)]
519        pub votingId: alloy::sol_types::private::FixedBytes<32>,
520        #[allow(missing_docs)]
521        pub voter: alloy::sol_types::private::Address,
522        #[allow(missing_docs)]
523        pub choice: alloy::sol_types::private::primitives::aliases::U256,
524    }
525    #[allow(
526        non_camel_case_types,
527        non_snake_case,
528        clippy::pub_underscore_fields,
529        clippy::style
530    )]
531    const _: () = {
532        use alloy::sol_types as alloy_sol_types;
533        #[automatically_derived]
534        impl alloy_sol_types::SolEvent for Voted {
535            type DataTuple<'a> = ();
536            type DataToken<'a> = <Self::DataTuple<
537                'a,
538            > as alloy_sol_types::SolType>::Token<'a>;
539            type TopicList = (
540                alloy_sol_types::sol_data::FixedBytes<32>,
541                alloy::sol_types::sol_data::FixedBytes<32>,
542                alloy::sol_types::sol_data::Address,
543                alloy::sol_types::sol_data::Uint<256>,
544            );
545            const SIGNATURE: &'static str = "Voted(bytes32,address,uint256)";
546            const SIGNATURE_HASH: alloy_sol_types::private::B256 = alloy_sol_types::private::B256::new([
547                228u8, 171u8, 197u8, 56u8, 15u8, 166u8, 147u8, 157u8, 29u8, 194u8, 59u8,
548                94u8, 144u8, 179u8, 168u8, 160u8, 227u8, 40u8, 240u8, 241u8, 168u8, 42u8,
549                95u8, 66u8, 191u8, 183u8, 149u8, 191u8, 156u8, 113u8, 117u8, 5u8,
550            ]);
551            const ANONYMOUS: bool = false;
552            #[allow(unused_variables)]
553            #[inline]
554            fn new(
555                topics: <Self::TopicList as alloy_sol_types::SolType>::RustType,
556                data: <Self::DataTuple<'_> as alloy_sol_types::SolType>::RustType,
557            ) -> Self {
558                Self {
559                    votingId: topics.1,
560                    voter: topics.2,
561                    choice: topics.3,
562                }
563            }
564            #[inline]
565            fn check_signature(
566                topics: &<Self::TopicList as alloy_sol_types::SolType>::RustType,
567            ) -> alloy_sol_types::Result<()> {
568                if topics.0 != Self::SIGNATURE_HASH {
569                    return Err(
570                        alloy_sol_types::Error::invalid_event_signature_hash(
571                            Self::SIGNATURE,
572                            topics.0,
573                            Self::SIGNATURE_HASH,
574                        ),
575                    );
576                }
577                Ok(())
578            }
579            #[inline]
580            fn tokenize_body(&self) -> Self::DataToken<'_> {
581                ()
582            }
583            #[inline]
584            fn topics(&self) -> <Self::TopicList as alloy_sol_types::SolType>::RustType {
585                (
586                    Self::SIGNATURE_HASH.into(),
587                    self.votingId.clone(),
588                    self.voter.clone(),
589                    self.choice.clone(),
590                )
591            }
592            #[inline]
593            fn encode_topics_raw(
594                &self,
595                out: &mut [alloy_sol_types::abi::token::WordToken],
596            ) -> alloy_sol_types::Result<()> {
597                if out.len() < <Self::TopicList as alloy_sol_types::TopicList>::COUNT {
598                    return Err(alloy_sol_types::Error::Overrun);
599                }
600                out[0usize] = alloy_sol_types::abi::token::WordToken(
601                    Self::SIGNATURE_HASH,
602                );
603                out[1usize] = <alloy::sol_types::sol_data::FixedBytes<
604                    32,
605                > as alloy_sol_types::EventTopic>::encode_topic(&self.votingId);
606                out[2usize] = <alloy::sol_types::sol_data::Address as alloy_sol_types::EventTopic>::encode_topic(
607                    &self.voter,
608                );
609                out[3usize] = <alloy::sol_types::sol_data::Uint<
610                    256,
611                > as alloy_sol_types::EventTopic>::encode_topic(&self.choice);
612                Ok(())
613            }
614        }
615        #[automatically_derived]
616        impl alloy_sol_types::private::IntoLogData for Voted {
617            fn to_log_data(&self) -> alloy_sol_types::private::LogData {
618                From::from(self)
619            }
620            fn into_log_data(self) -> alloy_sol_types::private::LogData {
621                From::from(&self)
622            }
623        }
624        #[automatically_derived]
625        impl From<&Voted> for alloy_sol_types::private::LogData {
626            #[inline]
627            fn from(this: &Voted) -> alloy_sol_types::private::LogData {
628                alloy_sol_types::SolEvent::encode_log_data(this)
629            }
630        }
631    };
632    #[derive(Default, Debug, PartialEq, Eq, Hash)]
633    /**Event with signature `Winner(bytes32,uint256)` and selector `0x269d3a24712436f77df15d63de7d2337a060c9102dee6f46c909fb0fa2d52f0c`.
634```solidity
635event Winner(bytes32 indexed votingId, uint256 indexed choice);
636```*/
637    #[allow(
638        non_camel_case_types,
639        non_snake_case,
640        clippy::pub_underscore_fields,
641        clippy::style
642    )]
643    #[derive(Clone)]
644    pub struct Winner {
645        #[allow(missing_docs)]
646        pub votingId: alloy::sol_types::private::FixedBytes<32>,
647        #[allow(missing_docs)]
648        pub choice: alloy::sol_types::private::primitives::aliases::U256,
649    }
650    #[allow(
651        non_camel_case_types,
652        non_snake_case,
653        clippy::pub_underscore_fields,
654        clippy::style
655    )]
656    const _: () = {
657        use alloy::sol_types as alloy_sol_types;
658        #[automatically_derived]
659        impl alloy_sol_types::SolEvent for Winner {
660            type DataTuple<'a> = ();
661            type DataToken<'a> = <Self::DataTuple<
662                'a,
663            > as alloy_sol_types::SolType>::Token<'a>;
664            type TopicList = (
665                alloy_sol_types::sol_data::FixedBytes<32>,
666                alloy::sol_types::sol_data::FixedBytes<32>,
667                alloy::sol_types::sol_data::Uint<256>,
668            );
669            const SIGNATURE: &'static str = "Winner(bytes32,uint256)";
670            const SIGNATURE_HASH: alloy_sol_types::private::B256 = alloy_sol_types::private::B256::new([
671                38u8, 157u8, 58u8, 36u8, 113u8, 36u8, 54u8, 247u8, 125u8, 241u8, 93u8,
672                99u8, 222u8, 125u8, 35u8, 55u8, 160u8, 96u8, 201u8, 16u8, 45u8, 238u8,
673                111u8, 70u8, 201u8, 9u8, 251u8, 15u8, 162u8, 213u8, 47u8, 12u8,
674            ]);
675            const ANONYMOUS: bool = false;
676            #[allow(unused_variables)]
677            #[inline]
678            fn new(
679                topics: <Self::TopicList as alloy_sol_types::SolType>::RustType,
680                data: <Self::DataTuple<'_> as alloy_sol_types::SolType>::RustType,
681            ) -> Self {
682                Self {
683                    votingId: topics.1,
684                    choice: topics.2,
685                }
686            }
687            #[inline]
688            fn check_signature(
689                topics: &<Self::TopicList as alloy_sol_types::SolType>::RustType,
690            ) -> alloy_sol_types::Result<()> {
691                if topics.0 != Self::SIGNATURE_HASH {
692                    return Err(
693                        alloy_sol_types::Error::invalid_event_signature_hash(
694                            Self::SIGNATURE,
695                            topics.0,
696                            Self::SIGNATURE_HASH,
697                        ),
698                    );
699                }
700                Ok(())
701            }
702            #[inline]
703            fn tokenize_body(&self) -> Self::DataToken<'_> {
704                ()
705            }
706            #[inline]
707            fn topics(&self) -> <Self::TopicList as alloy_sol_types::SolType>::RustType {
708                (Self::SIGNATURE_HASH.into(), self.votingId.clone(), self.choice.clone())
709            }
710            #[inline]
711            fn encode_topics_raw(
712                &self,
713                out: &mut [alloy_sol_types::abi::token::WordToken],
714            ) -> alloy_sol_types::Result<()> {
715                if out.len() < <Self::TopicList as alloy_sol_types::TopicList>::COUNT {
716                    return Err(alloy_sol_types::Error::Overrun);
717                }
718                out[0usize] = alloy_sol_types::abi::token::WordToken(
719                    Self::SIGNATURE_HASH,
720                );
721                out[1usize] = <alloy::sol_types::sol_data::FixedBytes<
722                    32,
723                > as alloy_sol_types::EventTopic>::encode_topic(&self.votingId);
724                out[2usize] = <alloy::sol_types::sol_data::Uint<
725                    256,
726                > as alloy_sol_types::EventTopic>::encode_topic(&self.choice);
727                Ok(())
728            }
729        }
730        #[automatically_derived]
731        impl alloy_sol_types::private::IntoLogData for Winner {
732            fn to_log_data(&self) -> alloy_sol_types::private::LogData {
733                From::from(self)
734            }
735            fn into_log_data(self) -> alloy_sol_types::private::LogData {
736                From::from(&self)
737            }
738        }
739        #[automatically_derived]
740        impl From<&Winner> for alloy_sol_types::private::LogData {
741            #[inline]
742            fn from(this: &Winner) -> alloy_sol_types::private::LogData {
743                alloy_sol_types::SolEvent::encode_log_data(this)
744            }
745        }
746    };
747    #[derive(Default, Debug, PartialEq, Eq, Hash)]
748    /**Function with signature `register((uint256,uint256,uint256,address))` and selector `0x8f253c75`.
749```solidity
750function register(VotingInfo memory v) external;
751```*/
752    #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
753    #[derive(Clone)]
754    pub struct registerCall {
755        #[allow(missing_docs)]
756        pub v: <VotingInfo as alloy::sol_types::SolType>::RustType,
757    }
758    ///Container type for the return parameters of the [`register((uint256,uint256,uint256,address))`](registerCall) function.
759    #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
760    #[derive(Clone)]
761    pub struct registerReturn {}
762    #[allow(
763        non_camel_case_types,
764        non_snake_case,
765        clippy::pub_underscore_fields,
766        clippy::style
767    )]
768    const _: () = {
769        use alloy::sol_types as alloy_sol_types;
770        {
771            #[doc(hidden)]
772            type UnderlyingSolTuple<'a> = (VotingInfo,);
773            #[doc(hidden)]
774            type UnderlyingRustTuple<'a> = (
775                <VotingInfo as alloy::sol_types::SolType>::RustType,
776            );
777            #[cfg(test)]
778            #[allow(dead_code, unreachable_patterns)]
779            fn _type_assertion(
780                _t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>,
781            ) {
782                match _t {
783                    alloy_sol_types::private::AssertTypeEq::<
784                        <UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
785                    >(_) => {}
786                }
787            }
788            #[automatically_derived]
789            #[doc(hidden)]
790            impl ::core::convert::From<registerCall> for UnderlyingRustTuple<'_> {
791                fn from(value: registerCall) -> Self {
792                    (value.v,)
793                }
794            }
795            #[automatically_derived]
796            #[doc(hidden)]
797            impl ::core::convert::From<UnderlyingRustTuple<'_>> for registerCall {
798                fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
799                    Self { v: tuple.0 }
800                }
801            }
802        }
803        {
804            #[doc(hidden)]
805            type UnderlyingSolTuple<'a> = ();
806            #[doc(hidden)]
807            type UnderlyingRustTuple<'a> = ();
808            #[cfg(test)]
809            #[allow(dead_code, unreachable_patterns)]
810            fn _type_assertion(
811                _t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>,
812            ) {
813                match _t {
814                    alloy_sol_types::private::AssertTypeEq::<
815                        <UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
816                    >(_) => {}
817                }
818            }
819            #[automatically_derived]
820            #[doc(hidden)]
821            impl ::core::convert::From<registerReturn> for UnderlyingRustTuple<'_> {
822                fn from(value: registerReturn) -> Self {
823                    ()
824                }
825            }
826            #[automatically_derived]
827            #[doc(hidden)]
828            impl ::core::convert::From<UnderlyingRustTuple<'_>> for registerReturn {
829                fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
830                    Self {}
831                }
832            }
833        }
834        #[automatically_derived]
835        impl alloy_sol_types::SolCall for registerCall {
836            type Parameters<'a> = (VotingInfo,);
837            type Token<'a> = <Self::Parameters<
838                'a,
839            > as alloy_sol_types::SolType>::Token<'a>;
840            type Return = registerReturn;
841            type ReturnTuple<'a> = ();
842            type ReturnToken<'a> = <Self::ReturnTuple<
843                'a,
844            > as alloy_sol_types::SolType>::Token<'a>;
845            const SIGNATURE: &'static str = "register((uint256,uint256,uint256,address))";
846            const SELECTOR: [u8; 4] = [143u8, 37u8, 60u8, 117u8];
847            #[inline]
848            fn new<'a>(
849                tuple: <Self::Parameters<'a> as alloy_sol_types::SolType>::RustType,
850            ) -> Self {
851                tuple.into()
852            }
853            #[inline]
854            fn tokenize(&self) -> Self::Token<'_> {
855                (<VotingInfo as alloy_sol_types::SolType>::tokenize(&self.v),)
856            }
857            #[inline]
858            fn abi_decode_returns(
859                data: &[u8],
860                validate: bool,
861            ) -> alloy_sol_types::Result<Self::Return> {
862                <Self::ReturnTuple<
863                    '_,
864                > as alloy_sol_types::SolType>::abi_decode_sequence(data, validate)
865                    .map(Into::into)
866            }
867        }
868    };
869    #[derive(Default, Debug, PartialEq, Eq, Hash)]
870    /**Function with signature `setWinner((uint256,uint256,uint256,address),uint256)` and selector `0x9747a952`.
871```solidity
872function setWinner(VotingInfo memory v, uint256 choice) external;
873```*/
874    #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
875    #[derive(Clone)]
876    pub struct setWinnerCall {
877        #[allow(missing_docs)]
878        pub v: <VotingInfo as alloy::sol_types::SolType>::RustType,
879        #[allow(missing_docs)]
880        pub choice: alloy::sol_types::private::primitives::aliases::U256,
881    }
882    ///Container type for the return parameters of the [`setWinner((uint256,uint256,uint256,address),uint256)`](setWinnerCall) function.
883    #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
884    #[derive(Clone)]
885    pub struct setWinnerReturn {}
886    #[allow(
887        non_camel_case_types,
888        non_snake_case,
889        clippy::pub_underscore_fields,
890        clippy::style
891    )]
892    const _: () = {
893        use alloy::sol_types as alloy_sol_types;
894        {
895            #[doc(hidden)]
896            type UnderlyingSolTuple<'a> = (
897                VotingInfo,
898                alloy::sol_types::sol_data::Uint<256>,
899            );
900            #[doc(hidden)]
901            type UnderlyingRustTuple<'a> = (
902                <VotingInfo as alloy::sol_types::SolType>::RustType,
903                alloy::sol_types::private::primitives::aliases::U256,
904            );
905            #[cfg(test)]
906            #[allow(dead_code, unreachable_patterns)]
907            fn _type_assertion(
908                _t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>,
909            ) {
910                match _t {
911                    alloy_sol_types::private::AssertTypeEq::<
912                        <UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
913                    >(_) => {}
914                }
915            }
916            #[automatically_derived]
917            #[doc(hidden)]
918            impl ::core::convert::From<setWinnerCall> for UnderlyingRustTuple<'_> {
919                fn from(value: setWinnerCall) -> Self {
920                    (value.v, value.choice)
921                }
922            }
923            #[automatically_derived]
924            #[doc(hidden)]
925            impl ::core::convert::From<UnderlyingRustTuple<'_>> for setWinnerCall {
926                fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
927                    Self {
928                        v: tuple.0,
929                        choice: tuple.1,
930                    }
931                }
932            }
933        }
934        {
935            #[doc(hidden)]
936            type UnderlyingSolTuple<'a> = ();
937            #[doc(hidden)]
938            type UnderlyingRustTuple<'a> = ();
939            #[cfg(test)]
940            #[allow(dead_code, unreachable_patterns)]
941            fn _type_assertion(
942                _t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>,
943            ) {
944                match _t {
945                    alloy_sol_types::private::AssertTypeEq::<
946                        <UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
947                    >(_) => {}
948                }
949            }
950            #[automatically_derived]
951            #[doc(hidden)]
952            impl ::core::convert::From<setWinnerReturn> for UnderlyingRustTuple<'_> {
953                fn from(value: setWinnerReturn) -> Self {
954                    ()
955                }
956            }
957            #[automatically_derived]
958            #[doc(hidden)]
959            impl ::core::convert::From<UnderlyingRustTuple<'_>> for setWinnerReturn {
960                fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
961                    Self {}
962                }
963            }
964        }
965        #[automatically_derived]
966        impl alloy_sol_types::SolCall for setWinnerCall {
967            type Parameters<'a> = (VotingInfo, alloy::sol_types::sol_data::Uint<256>);
968            type Token<'a> = <Self::Parameters<
969                'a,
970            > as alloy_sol_types::SolType>::Token<'a>;
971            type Return = setWinnerReturn;
972            type ReturnTuple<'a> = ();
973            type ReturnToken<'a> = <Self::ReturnTuple<
974                'a,
975            > as alloy_sol_types::SolType>::Token<'a>;
976            const SIGNATURE: &'static str = "setWinner((uint256,uint256,uint256,address),uint256)";
977            const SELECTOR: [u8; 4] = [151u8, 71u8, 169u8, 82u8];
978            #[inline]
979            fn new<'a>(
980                tuple: <Self::Parameters<'a> as alloy_sol_types::SolType>::RustType,
981            ) -> Self {
982                tuple.into()
983            }
984            #[inline]
985            fn tokenize(&self) -> Self::Token<'_> {
986                (
987                    <VotingInfo as alloy_sol_types::SolType>::tokenize(&self.v),
988                    <alloy::sol_types::sol_data::Uint<
989                        256,
990                    > as alloy_sol_types::SolType>::tokenize(&self.choice),
991                )
992            }
993            #[inline]
994            fn abi_decode_returns(
995                data: &[u8],
996                validate: bool,
997            ) -> alloy_sol_types::Result<Self::Return> {
998                <Self::ReturnTuple<
999                    '_,
1000                > as alloy_sol_types::SolType>::abi_decode_sequence(data, validate)
1001                    .map(Into::into)
1002            }
1003        }
1004    };
1005    #[derive(Default, Debug, PartialEq, Eq, Hash)]
1006    /**Function with signature `vote((uint256,uint256,uint256,address),uint256)` and selector `0x152d18c4`.
1007```solidity
1008function vote(VotingInfo memory v, uint256 choice) external;
1009```*/
1010    #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
1011    #[derive(Clone)]
1012    pub struct voteCall {
1013        #[allow(missing_docs)]
1014        pub v: <VotingInfo as alloy::sol_types::SolType>::RustType,
1015        #[allow(missing_docs)]
1016        pub choice: alloy::sol_types::private::primitives::aliases::U256,
1017    }
1018    ///Container type for the return parameters of the [`vote((uint256,uint256,uint256,address),uint256)`](voteCall) function.
1019    #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
1020    #[derive(Clone)]
1021    pub struct voteReturn {}
1022    #[allow(
1023        non_camel_case_types,
1024        non_snake_case,
1025        clippy::pub_underscore_fields,
1026        clippy::style
1027    )]
1028    const _: () = {
1029        use alloy::sol_types as alloy_sol_types;
1030        {
1031            #[doc(hidden)]
1032            type UnderlyingSolTuple<'a> = (
1033                VotingInfo,
1034                alloy::sol_types::sol_data::Uint<256>,
1035            );
1036            #[doc(hidden)]
1037            type UnderlyingRustTuple<'a> = (
1038                <VotingInfo as alloy::sol_types::SolType>::RustType,
1039                alloy::sol_types::private::primitives::aliases::U256,
1040            );
1041            #[cfg(test)]
1042            #[allow(dead_code, unreachable_patterns)]
1043            fn _type_assertion(
1044                _t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>,
1045            ) {
1046                match _t {
1047                    alloy_sol_types::private::AssertTypeEq::<
1048                        <UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
1049                    >(_) => {}
1050                }
1051            }
1052            #[automatically_derived]
1053            #[doc(hidden)]
1054            impl ::core::convert::From<voteCall> for UnderlyingRustTuple<'_> {
1055                fn from(value: voteCall) -> Self {
1056                    (value.v, value.choice)
1057                }
1058            }
1059            #[automatically_derived]
1060            #[doc(hidden)]
1061            impl ::core::convert::From<UnderlyingRustTuple<'_>> for voteCall {
1062                fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
1063                    Self {
1064                        v: tuple.0,
1065                        choice: tuple.1,
1066                    }
1067                }
1068            }
1069        }
1070        {
1071            #[doc(hidden)]
1072            type UnderlyingSolTuple<'a> = ();
1073            #[doc(hidden)]
1074            type UnderlyingRustTuple<'a> = ();
1075            #[cfg(test)]
1076            #[allow(dead_code, unreachable_patterns)]
1077            fn _type_assertion(
1078                _t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>,
1079            ) {
1080                match _t {
1081                    alloy_sol_types::private::AssertTypeEq::<
1082                        <UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
1083                    >(_) => {}
1084                }
1085            }
1086            #[automatically_derived]
1087            #[doc(hidden)]
1088            impl ::core::convert::From<voteReturn> for UnderlyingRustTuple<'_> {
1089                fn from(value: voteReturn) -> Self {
1090                    ()
1091                }
1092            }
1093            #[automatically_derived]
1094            #[doc(hidden)]
1095            impl ::core::convert::From<UnderlyingRustTuple<'_>> for voteReturn {
1096                fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
1097                    Self {}
1098                }
1099            }
1100        }
1101        #[automatically_derived]
1102        impl alloy_sol_types::SolCall for voteCall {
1103            type Parameters<'a> = (VotingInfo, alloy::sol_types::sol_data::Uint<256>);
1104            type Token<'a> = <Self::Parameters<
1105                'a,
1106            > as alloy_sol_types::SolType>::Token<'a>;
1107            type Return = voteReturn;
1108            type ReturnTuple<'a> = ();
1109            type ReturnToken<'a> = <Self::ReturnTuple<
1110                'a,
1111            > as alloy_sol_types::SolType>::Token<'a>;
1112            const SIGNATURE: &'static str = "vote((uint256,uint256,uint256,address),uint256)";
1113            const SELECTOR: [u8; 4] = [21u8, 45u8, 24u8, 196u8];
1114            #[inline]
1115            fn new<'a>(
1116                tuple: <Self::Parameters<'a> as alloy_sol_types::SolType>::RustType,
1117            ) -> Self {
1118                tuple.into()
1119            }
1120            #[inline]
1121            fn tokenize(&self) -> Self::Token<'_> {
1122                (
1123                    <VotingInfo as alloy_sol_types::SolType>::tokenize(&self.v),
1124                    <alloy::sol_types::sol_data::Uint<
1125                        256,
1126                    > as alloy_sol_types::SolType>::tokenize(&self.choice),
1127                )
1128            }
1129            #[inline]
1130            fn abi_decode_returns(
1131                data: &[u8],
1132                validate: bool,
1133            ) -> alloy_sol_types::Result<Self::Return> {
1134                <Self::ReturnTuple<
1135                    '_,
1136                > as alloy_sol_types::SolType>::abi_decode_sequence(data, validate)
1137                    .map(Into::into)
1138            }
1139        }
1140    };
1141    #[derive(Default, Debug, PartialEq, Eq, Hash)]
1142    /**Function with signature `votingId((uint256,uint256,uint256,address))` and selector `0x39db6659`.
1143```solidity
1144function votingId(VotingInfo memory v) external pure returns (bytes32);
1145```*/
1146    #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
1147    #[derive(Clone)]
1148    pub struct votingIdCall {
1149        #[allow(missing_docs)]
1150        pub v: <VotingInfo as alloy::sol_types::SolType>::RustType,
1151    }
1152    #[derive(Default, Debug, PartialEq, Eq, Hash)]
1153    ///Container type for the return parameters of the [`votingId((uint256,uint256,uint256,address))`](votingIdCall) function.
1154    #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
1155    #[derive(Clone)]
1156    pub struct votingIdReturn {
1157        #[allow(missing_docs)]
1158        pub _0: alloy::sol_types::private::FixedBytes<32>,
1159    }
1160    #[allow(
1161        non_camel_case_types,
1162        non_snake_case,
1163        clippy::pub_underscore_fields,
1164        clippy::style
1165    )]
1166    const _: () = {
1167        use alloy::sol_types as alloy_sol_types;
1168        {
1169            #[doc(hidden)]
1170            type UnderlyingSolTuple<'a> = (VotingInfo,);
1171            #[doc(hidden)]
1172            type UnderlyingRustTuple<'a> = (
1173                <VotingInfo as alloy::sol_types::SolType>::RustType,
1174            );
1175            #[cfg(test)]
1176            #[allow(dead_code, unreachable_patterns)]
1177            fn _type_assertion(
1178                _t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>,
1179            ) {
1180                match _t {
1181                    alloy_sol_types::private::AssertTypeEq::<
1182                        <UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
1183                    >(_) => {}
1184                }
1185            }
1186            #[automatically_derived]
1187            #[doc(hidden)]
1188            impl ::core::convert::From<votingIdCall> for UnderlyingRustTuple<'_> {
1189                fn from(value: votingIdCall) -> Self {
1190                    (value.v,)
1191                }
1192            }
1193            #[automatically_derived]
1194            #[doc(hidden)]
1195            impl ::core::convert::From<UnderlyingRustTuple<'_>> for votingIdCall {
1196                fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
1197                    Self { v: tuple.0 }
1198                }
1199            }
1200        }
1201        {
1202            #[doc(hidden)]
1203            type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::FixedBytes<32>,);
1204            #[doc(hidden)]
1205            type UnderlyingRustTuple<'a> = (alloy::sol_types::private::FixedBytes<32>,);
1206            #[cfg(test)]
1207            #[allow(dead_code, unreachable_patterns)]
1208            fn _type_assertion(
1209                _t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>,
1210            ) {
1211                match _t {
1212                    alloy_sol_types::private::AssertTypeEq::<
1213                        <UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
1214                    >(_) => {}
1215                }
1216            }
1217            #[automatically_derived]
1218            #[doc(hidden)]
1219            impl ::core::convert::From<votingIdReturn> for UnderlyingRustTuple<'_> {
1220                fn from(value: votingIdReturn) -> Self {
1221                    (value._0,)
1222                }
1223            }
1224            #[automatically_derived]
1225            #[doc(hidden)]
1226            impl ::core::convert::From<UnderlyingRustTuple<'_>> for votingIdReturn {
1227                fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
1228                    Self { _0: tuple.0 }
1229                }
1230            }
1231        }
1232        #[automatically_derived]
1233        impl alloy_sol_types::SolCall for votingIdCall {
1234            type Parameters<'a> = (VotingInfo,);
1235            type Token<'a> = <Self::Parameters<
1236                'a,
1237            > as alloy_sol_types::SolType>::Token<'a>;
1238            type Return = votingIdReturn;
1239            type ReturnTuple<'a> = (alloy::sol_types::sol_data::FixedBytes<32>,);
1240            type ReturnToken<'a> = <Self::ReturnTuple<
1241                'a,
1242            > as alloy_sol_types::SolType>::Token<'a>;
1243            const SIGNATURE: &'static str = "votingId((uint256,uint256,uint256,address))";
1244            const SELECTOR: [u8; 4] = [57u8, 219u8, 102u8, 89u8];
1245            #[inline]
1246            fn new<'a>(
1247                tuple: <Self::Parameters<'a> as alloy_sol_types::SolType>::RustType,
1248            ) -> Self {
1249                tuple.into()
1250            }
1251            #[inline]
1252            fn tokenize(&self) -> Self::Token<'_> {
1253                (<VotingInfo as alloy_sol_types::SolType>::tokenize(&self.v),)
1254            }
1255            #[inline]
1256            fn abi_decode_returns(
1257                data: &[u8],
1258                validate: bool,
1259            ) -> alloy_sol_types::Result<Self::Return> {
1260                <Self::ReturnTuple<
1261                    '_,
1262                > as alloy_sol_types::SolType>::abi_decode_sequence(data, validate)
1263                    .map(Into::into)
1264            }
1265        }
1266    };
1267    ///Container for all the [`Voting`](self) function calls.
1268    #[derive()]
1269    pub enum VotingCalls {
1270        #[allow(missing_docs)]
1271        register(registerCall),
1272        #[allow(missing_docs)]
1273        setWinner(setWinnerCall),
1274        #[allow(missing_docs)]
1275        vote(voteCall),
1276        #[allow(missing_docs)]
1277        votingId(votingIdCall),
1278    }
1279    #[automatically_derived]
1280    impl VotingCalls {
1281        /// All the selectors of this enum.
1282        ///
1283        /// Note that the selectors might not be in the same order as the variants.
1284        /// No guarantees are made about the order of the selectors.
1285        ///
1286        /// Prefer using `SolInterface` methods instead.
1287        pub const SELECTORS: &'static [[u8; 4usize]] = &[
1288            [21u8, 45u8, 24u8, 196u8],
1289            [57u8, 219u8, 102u8, 89u8],
1290            [143u8, 37u8, 60u8, 117u8],
1291            [151u8, 71u8, 169u8, 82u8],
1292        ];
1293    }
1294    #[automatically_derived]
1295    impl alloy_sol_types::SolInterface for VotingCalls {
1296        const NAME: &'static str = "VotingCalls";
1297        const MIN_DATA_LENGTH: usize = 128usize;
1298        const COUNT: usize = 4usize;
1299        #[inline]
1300        fn selector(&self) -> [u8; 4] {
1301            match self {
1302                Self::register(_) => <registerCall as alloy_sol_types::SolCall>::SELECTOR,
1303                Self::setWinner(_) => {
1304                    <setWinnerCall as alloy_sol_types::SolCall>::SELECTOR
1305                }
1306                Self::vote(_) => <voteCall as alloy_sol_types::SolCall>::SELECTOR,
1307                Self::votingId(_) => <votingIdCall as alloy_sol_types::SolCall>::SELECTOR,
1308            }
1309        }
1310        #[inline]
1311        fn selector_at(i: usize) -> ::core::option::Option<[u8; 4]> {
1312            Self::SELECTORS.get(i).copied()
1313        }
1314        #[inline]
1315        fn valid_selector(selector: [u8; 4]) -> bool {
1316            Self::SELECTORS.binary_search(&selector).is_ok()
1317        }
1318        #[inline]
1319        #[allow(non_snake_case)]
1320        fn abi_decode_raw(
1321            selector: [u8; 4],
1322            data: &[u8],
1323            validate: bool,
1324        ) -> alloy_sol_types::Result<Self> {
1325            static DECODE_SHIMS: &[fn(
1326                &[u8],
1327                bool,
1328            ) -> alloy_sol_types::Result<VotingCalls>] = &[
1329                {
1330                    fn vote(
1331                        data: &[u8],
1332                        validate: bool,
1333                    ) -> alloy_sol_types::Result<VotingCalls> {
1334                        <voteCall as alloy_sol_types::SolCall>::abi_decode_raw(
1335                                data,
1336                                validate,
1337                            )
1338                            .map(VotingCalls::vote)
1339                    }
1340                    vote
1341                },
1342                {
1343                    fn votingId(
1344                        data: &[u8],
1345                        validate: bool,
1346                    ) -> alloy_sol_types::Result<VotingCalls> {
1347                        <votingIdCall as alloy_sol_types::SolCall>::abi_decode_raw(
1348                                data,
1349                                validate,
1350                            )
1351                            .map(VotingCalls::votingId)
1352                    }
1353                    votingId
1354                },
1355                {
1356                    fn register(
1357                        data: &[u8],
1358                        validate: bool,
1359                    ) -> alloy_sol_types::Result<VotingCalls> {
1360                        <registerCall as alloy_sol_types::SolCall>::abi_decode_raw(
1361                                data,
1362                                validate,
1363                            )
1364                            .map(VotingCalls::register)
1365                    }
1366                    register
1367                },
1368                {
1369                    fn setWinner(
1370                        data: &[u8],
1371                        validate: bool,
1372                    ) -> alloy_sol_types::Result<VotingCalls> {
1373                        <setWinnerCall as alloy_sol_types::SolCall>::abi_decode_raw(
1374                                data,
1375                                validate,
1376                            )
1377                            .map(VotingCalls::setWinner)
1378                    }
1379                    setWinner
1380                },
1381            ];
1382            let Ok(idx) = Self::SELECTORS.binary_search(&selector) else {
1383                return Err(
1384                    alloy_sol_types::Error::unknown_selector(
1385                        <Self as alloy_sol_types::SolInterface>::NAME,
1386                        selector,
1387                    ),
1388                );
1389            };
1390            DECODE_SHIMS[idx](data, validate)
1391        }
1392        #[inline]
1393        fn abi_encoded_size(&self) -> usize {
1394            match self {
1395                Self::register(inner) => {
1396                    <registerCall as alloy_sol_types::SolCall>::abi_encoded_size(inner)
1397                }
1398                Self::setWinner(inner) => {
1399                    <setWinnerCall as alloy_sol_types::SolCall>::abi_encoded_size(inner)
1400                }
1401                Self::vote(inner) => {
1402                    <voteCall as alloy_sol_types::SolCall>::abi_encoded_size(inner)
1403                }
1404                Self::votingId(inner) => {
1405                    <votingIdCall as alloy_sol_types::SolCall>::abi_encoded_size(inner)
1406                }
1407            }
1408        }
1409        #[inline]
1410        fn abi_encode_raw(&self, out: &mut alloy_sol_types::private::Vec<u8>) {
1411            match self {
1412                Self::register(inner) => {
1413                    <registerCall as alloy_sol_types::SolCall>::abi_encode_raw(
1414                        inner,
1415                        out,
1416                    )
1417                }
1418                Self::setWinner(inner) => {
1419                    <setWinnerCall as alloy_sol_types::SolCall>::abi_encode_raw(
1420                        inner,
1421                        out,
1422                    )
1423                }
1424                Self::vote(inner) => {
1425                    <voteCall as alloy_sol_types::SolCall>::abi_encode_raw(inner, out)
1426                }
1427                Self::votingId(inner) => {
1428                    <votingIdCall as alloy_sol_types::SolCall>::abi_encode_raw(
1429                        inner,
1430                        out,
1431                    )
1432                }
1433            }
1434        }
1435    }
1436    ///Container for all the [`Voting`](self) events.
1437    #[derive(Debug, PartialEq, Eq, Hash)]
1438    pub enum VotingEvents {
1439        #[allow(missing_docs)]
1440        Voted(Voted),
1441        #[allow(missing_docs)]
1442        Winner(Winner),
1443    }
1444    #[automatically_derived]
1445    impl VotingEvents {
1446        /// All the selectors of this enum.
1447        ///
1448        /// Note that the selectors might not be in the same order as the variants.
1449        /// No guarantees are made about the order of the selectors.
1450        ///
1451        /// Prefer using `SolInterface` methods instead.
1452        pub const SELECTORS: &'static [[u8; 32usize]] = &[
1453            [
1454                38u8, 157u8, 58u8, 36u8, 113u8, 36u8, 54u8, 247u8, 125u8, 241u8, 93u8,
1455                99u8, 222u8, 125u8, 35u8, 55u8, 160u8, 96u8, 201u8, 16u8, 45u8, 238u8,
1456                111u8, 70u8, 201u8, 9u8, 251u8, 15u8, 162u8, 213u8, 47u8, 12u8,
1457            ],
1458            [
1459                228u8, 171u8, 197u8, 56u8, 15u8, 166u8, 147u8, 157u8, 29u8, 194u8, 59u8,
1460                94u8, 144u8, 179u8, 168u8, 160u8, 227u8, 40u8, 240u8, 241u8, 168u8, 42u8,
1461                95u8, 66u8, 191u8, 183u8, 149u8, 191u8, 156u8, 113u8, 117u8, 5u8,
1462            ],
1463        ];
1464    }
1465    #[automatically_derived]
1466    impl alloy_sol_types::SolEventInterface for VotingEvents {
1467        const NAME: &'static str = "VotingEvents";
1468        const COUNT: usize = 2usize;
1469        fn decode_raw_log(
1470            topics: &[alloy_sol_types::Word],
1471            data: &[u8],
1472            validate: bool,
1473        ) -> alloy_sol_types::Result<Self> {
1474            match topics.first().copied() {
1475                Some(<Voted as alloy_sol_types::SolEvent>::SIGNATURE_HASH) => {
1476                    <Voted as alloy_sol_types::SolEvent>::decode_raw_log(
1477                            topics,
1478                            data,
1479                            validate,
1480                        )
1481                        .map(Self::Voted)
1482                }
1483                Some(<Winner as alloy_sol_types::SolEvent>::SIGNATURE_HASH) => {
1484                    <Winner as alloy_sol_types::SolEvent>::decode_raw_log(
1485                            topics,
1486                            data,
1487                            validate,
1488                        )
1489                        .map(Self::Winner)
1490                }
1491                _ => {
1492                    alloy_sol_types::private::Err(alloy_sol_types::Error::InvalidLog {
1493                        name: <Self as alloy_sol_types::SolEventInterface>::NAME,
1494                        log: alloy_sol_types::private::Box::new(
1495                            alloy_sol_types::private::LogData::new_unchecked(
1496                                topics.to_vec(),
1497                                data.to_vec().into(),
1498                            ),
1499                        ),
1500                    })
1501                }
1502            }
1503        }
1504    }
1505    #[automatically_derived]
1506    impl alloy_sol_types::private::IntoLogData for VotingEvents {
1507        fn to_log_data(&self) -> alloy_sol_types::private::LogData {
1508            match self {
1509                Self::Voted(inner) => {
1510                    alloy_sol_types::private::IntoLogData::to_log_data(inner)
1511                }
1512                Self::Winner(inner) => {
1513                    alloy_sol_types::private::IntoLogData::to_log_data(inner)
1514                }
1515            }
1516        }
1517        fn into_log_data(self) -> alloy_sol_types::private::LogData {
1518            match self {
1519                Self::Voted(inner) => {
1520                    alloy_sol_types::private::IntoLogData::into_log_data(inner)
1521                }
1522                Self::Winner(inner) => {
1523                    alloy_sol_types::private::IntoLogData::into_log_data(inner)
1524                }
1525            }
1526        }
1527    }
1528    use alloy::contract as alloy_contract;
1529    /**Creates a new wrapper around an on-chain [`Voting`](self) contract instance.
1530
1531See the [wrapper's documentation](`VotingInstance`) for more details.*/
1532    #[inline]
1533    pub const fn new<
1534        T: alloy_contract::private::Transport + ::core::clone::Clone,
1535        P: alloy_contract::private::Provider<T, N>,
1536        N: alloy_contract::private::Network,
1537    >(
1538        address: alloy_sol_types::private::Address,
1539        provider: P,
1540    ) -> VotingInstance<T, P, N> {
1541        VotingInstance::<T, P, N>::new(address, provider)
1542    }
1543    /**A [`Voting`](self) instance.
1544
1545Contains type-safe methods for interacting with an on-chain instance of the
1546[`Voting`](self) contract located at a given `address`, using a given
1547provider `P`.
1548
1549If the contract bytecode is available (see the [`sol!`](alloy_sol_types::sol!)
1550documentation on how to provide it), the `deploy` and `deploy_builder` methods can
1551be used to deploy a new instance of the contract.
1552
1553See the [module-level documentation](self) for all the available methods.*/
1554    #[derive(Clone)]
1555    pub struct VotingInstance<T, P, N = alloy_contract::private::Ethereum> {
1556        address: alloy_sol_types::private::Address,
1557        provider: P,
1558        _network_transport: ::core::marker::PhantomData<(N, T)>,
1559    }
1560    #[automatically_derived]
1561    impl<T, P, N> ::core::fmt::Debug for VotingInstance<T, P, N> {
1562        #[inline]
1563        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1564            f.debug_tuple("VotingInstance").field(&self.address).finish()
1565        }
1566    }
1567    /// Instantiation and getters/setters.
1568    #[automatically_derived]
1569    impl<
1570        T: alloy_contract::private::Transport + ::core::clone::Clone,
1571        P: alloy_contract::private::Provider<T, N>,
1572        N: alloy_contract::private::Network,
1573    > VotingInstance<T, P, N> {
1574        /**Creates a new wrapper around an on-chain [`Voting`](self) contract instance.
1575
1576See the [wrapper's documentation](`VotingInstance`) for more details.*/
1577        #[inline]
1578        pub const fn new(
1579            address: alloy_sol_types::private::Address,
1580            provider: P,
1581        ) -> Self {
1582            Self {
1583                address,
1584                provider,
1585                _network_transport: ::core::marker::PhantomData,
1586            }
1587        }
1588        /// Returns a reference to the address.
1589        #[inline]
1590        pub const fn address(&self) -> &alloy_sol_types::private::Address {
1591            &self.address
1592        }
1593        /// Sets the address.
1594        #[inline]
1595        pub fn set_address(&mut self, address: alloy_sol_types::private::Address) {
1596            self.address = address;
1597        }
1598        /// Sets the address and returns `self`.
1599        pub fn at(mut self, address: alloy_sol_types::private::Address) -> Self {
1600            self.set_address(address);
1601            self
1602        }
1603        /// Returns a reference to the provider.
1604        #[inline]
1605        pub const fn provider(&self) -> &P {
1606            &self.provider
1607        }
1608    }
1609    impl<T, P: ::core::clone::Clone, N> VotingInstance<T, &P, N> {
1610        /// Clones the provider and returns a new instance with the cloned provider.
1611        #[inline]
1612        pub fn with_cloned_provider(self) -> VotingInstance<T, P, N> {
1613            VotingInstance {
1614                address: self.address,
1615                provider: ::core::clone::Clone::clone(&self.provider),
1616                _network_transport: ::core::marker::PhantomData,
1617            }
1618        }
1619    }
1620    /// Function calls.
1621    #[automatically_derived]
1622    impl<
1623        T: alloy_contract::private::Transport + ::core::clone::Clone,
1624        P: alloy_contract::private::Provider<T, N>,
1625        N: alloy_contract::private::Network,
1626    > VotingInstance<T, P, N> {
1627        /// Creates a new call builder using this contract instance's provider and address.
1628        ///
1629        /// Note that the call can be any function call, not just those defined in this
1630        /// contract. Prefer using the other methods for building type-safe contract calls.
1631        pub fn call_builder<C: alloy_sol_types::SolCall>(
1632            &self,
1633            call: &C,
1634        ) -> alloy_contract::SolCallBuilder<T, &P, C, N> {
1635            alloy_contract::SolCallBuilder::new_sol(&self.provider, &self.address, call)
1636        }
1637        ///Creates a new call builder for the [`register`] function.
1638        pub fn register(
1639            &self,
1640            v: <VotingInfo as alloy::sol_types::SolType>::RustType,
1641        ) -> alloy_contract::SolCallBuilder<T, &P, registerCall, N> {
1642            self.call_builder(&registerCall { v })
1643        }
1644        ///Creates a new call builder for the [`setWinner`] function.
1645        pub fn setWinner(
1646            &self,
1647            v: <VotingInfo as alloy::sol_types::SolType>::RustType,
1648            choice: alloy::sol_types::private::primitives::aliases::U256,
1649        ) -> alloy_contract::SolCallBuilder<T, &P, setWinnerCall, N> {
1650            self.call_builder(&setWinnerCall { v, choice })
1651        }
1652        ///Creates a new call builder for the [`vote`] function.
1653        pub fn vote(
1654            &self,
1655            v: <VotingInfo as alloy::sol_types::SolType>::RustType,
1656            choice: alloy::sol_types::private::primitives::aliases::U256,
1657        ) -> alloy_contract::SolCallBuilder<T, &P, voteCall, N> {
1658            self.call_builder(&voteCall { v, choice })
1659        }
1660        ///Creates a new call builder for the [`votingId`] function.
1661        pub fn votingId(
1662            &self,
1663            v: <VotingInfo as alloy::sol_types::SolType>::RustType,
1664        ) -> alloy_contract::SolCallBuilder<T, &P, votingIdCall, N> {
1665            self.call_builder(&votingIdCall { v })
1666        }
1667    }
1668    /// Event filters.
1669    #[automatically_derived]
1670    impl<
1671        T: alloy_contract::private::Transport + ::core::clone::Clone,
1672        P: alloy_contract::private::Provider<T, N>,
1673        N: alloy_contract::private::Network,
1674    > VotingInstance<T, P, N> {
1675        /// Creates a new event filter using this contract instance's provider and address.
1676        ///
1677        /// Note that the type can be any event, not just those defined in this contract.
1678        /// Prefer using the other methods for building type-safe event filters.
1679        pub fn event_filter<E: alloy_sol_types::SolEvent>(
1680            &self,
1681        ) -> alloy_contract::Event<T, &P, E, N> {
1682            alloy_contract::Event::new_sol(&self.provider, &self.address)
1683        }
1684        ///Creates a new event filter for the [`Voted`] event.
1685        pub fn Voted_filter(&self) -> alloy_contract::Event<T, &P, Voted, N> {
1686            self.event_filter::<Voted>()
1687        }
1688        ///Creates a new event filter for the [`Winner`] event.
1689        pub fn Winner_filter(&self) -> alloy_contract::Event<T, &P, Winner, N> {
1690            self.event_filter::<Winner>()
1691        }
1692    }
1693}