1#[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 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 #[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 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 #[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 #[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 #[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 #[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 #[inline]
1590 pub const fn address(&self) -> &alloy_sol_types::private::Address {
1591 &self.address
1592 }
1593 #[inline]
1595 pub fn set_address(&mut self, address: alloy_sol_types::private::Address) {
1596 self.address = address;
1597 }
1598 pub fn at(mut self, address: alloy_sol_types::private::Address) -> Self {
1600 self.set_address(address);
1601 self
1602 }
1603 #[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 #[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 #[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 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 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(®isterCall { v })
1643 }
1644 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 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 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 #[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 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 pub fn Voted_filter(&self) -> alloy_contract::Event<T, &P, Voted, N> {
1686 self.event_filter::<Voted>()
1687 }
1688 pub fn Winner_filter(&self) -> alloy_contract::Event<T, &P, Winner, N> {
1690 self.event_filter::<Winner>()
1691 }
1692 }
1693}