1#[allow(
97 non_camel_case_types,
98 non_snake_case,
99 clippy::pub_underscore_fields,
100 clippy::style,
101 clippy::empty_structs_with_brackets
102)]
103pub mod RankedFeed {
104 use super::*;
105 use alloy::sol_types as alloy_sol_types;
106 #[derive(Default, Debug, PartialEq, Eq, Hash)]
107 #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
112 #[derive(Clone)]
113 pub struct AlreadyVoted {}
114 #[allow(
115 non_camel_case_types,
116 non_snake_case,
117 clippy::pub_underscore_fields,
118 clippy::style
119 )]
120 const _: () = {
121 use alloy::sol_types as alloy_sol_types;
122 #[doc(hidden)]
123 type UnderlyingSolTuple<'a> = ();
124 #[doc(hidden)]
125 type UnderlyingRustTuple<'a> = ();
126 #[cfg(test)]
127 #[allow(dead_code, unreachable_patterns)]
128 fn _type_assertion(
129 _t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>,
130 ) {
131 match _t {
132 alloy_sol_types::private::AssertTypeEq::<
133 <UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
134 >(_) => {}
135 }
136 }
137 #[automatically_derived]
138 #[doc(hidden)]
139 impl ::core::convert::From<AlreadyVoted> for UnderlyingRustTuple<'_> {
140 fn from(value: AlreadyVoted) -> Self {
141 ()
142 }
143 }
144 #[automatically_derived]
145 #[doc(hidden)]
146 impl ::core::convert::From<UnderlyingRustTuple<'_>> for AlreadyVoted {
147 fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
148 Self {}
149 }
150 }
151 #[automatically_derived]
152 impl alloy_sol_types::SolError for AlreadyVoted {
153 type Parameters<'a> = UnderlyingSolTuple<'a>;
154 type Token<'a> = <Self::Parameters<
155 'a,
156 > as alloy_sol_types::SolType>::Token<'a>;
157 const SIGNATURE: &'static str = "AlreadyVoted()";
158 const SELECTOR: [u8; 4] = [124u8, 154u8, 28u8, 249u8];
159 #[inline]
160 fn new<'a>(
161 tuple: <Self::Parameters<'a> as alloy_sol_types::SolType>::RustType,
162 ) -> Self {
163 tuple.into()
164 }
165 #[inline]
166 fn tokenize(&self) -> Self::Token<'_> {
167 ()
168 }
169 }
170 };
171 #[derive(Default, Debug, PartialEq, Eq, Hash)]
172 #[allow(
177 non_camel_case_types,
178 non_snake_case,
179 clippy::pub_underscore_fields,
180 clippy::style
181 )]
182 #[derive(Clone)]
183 pub struct PostCreated {
184 #[allow(missing_docs)]
185 pub post_id: alloy::sol_types::private::FixedBytes<32>,
186 #[allow(missing_docs)]
187 pub poster: alloy::sol_types::private::Address,
188 #[allow(missing_docs)]
189 pub post_data: alloy::sol_types::private::Bytes,
190 }
191 #[allow(
192 non_camel_case_types,
193 non_snake_case,
194 clippy::pub_underscore_fields,
195 clippy::style
196 )]
197 const _: () = {
198 use alloy::sol_types as alloy_sol_types;
199 #[automatically_derived]
200 impl alloy_sol_types::SolEvent for PostCreated {
201 type DataTuple<'a> = (alloy::sol_types::sol_data::Bytes,);
202 type DataToken<'a> = <Self::DataTuple<
203 'a,
204 > as alloy_sol_types::SolType>::Token<'a>;
205 type TopicList = (
206 alloy_sol_types::sol_data::FixedBytes<32>,
207 alloy::sol_types::sol_data::FixedBytes<32>,
208 alloy::sol_types::sol_data::Address,
209 );
210 const SIGNATURE: &'static str = "PostCreated(bytes32,address,bytes)";
211 const SIGNATURE_HASH: alloy_sol_types::private::B256 = alloy_sol_types::private::B256::new([
212 237u8, 110u8, 111u8, 223u8, 153u8, 205u8, 94u8, 151u8, 20u8, 92u8, 126u8,
213 89u8, 173u8, 233u8, 57u8, 35u8, 190u8, 25u8, 121u8, 85u8, 122u8, 119u8,
214 230u8, 57u8, 237u8, 149u8, 162u8, 3u8, 199u8, 168u8, 232u8, 97u8,
215 ]);
216 const ANONYMOUS: bool = false;
217 #[allow(unused_variables)]
218 #[inline]
219 fn new(
220 topics: <Self::TopicList as alloy_sol_types::SolType>::RustType,
221 data: <Self::DataTuple<'_> as alloy_sol_types::SolType>::RustType,
222 ) -> Self {
223 Self {
224 post_id: topics.1,
225 poster: topics.2,
226 post_data: data.0,
227 }
228 }
229 #[inline]
230 fn check_signature(
231 topics: &<Self::TopicList as alloy_sol_types::SolType>::RustType,
232 ) -> alloy_sol_types::Result<()> {
233 if topics.0 != Self::SIGNATURE_HASH {
234 return Err(
235 alloy_sol_types::Error::invalid_event_signature_hash(
236 Self::SIGNATURE,
237 topics.0,
238 Self::SIGNATURE_HASH,
239 ),
240 );
241 }
242 Ok(())
243 }
244 #[inline]
245 fn tokenize_body(&self) -> Self::DataToken<'_> {
246 (
247 <alloy::sol_types::sol_data::Bytes as alloy_sol_types::SolType>::tokenize(
248 &self.post_data,
249 ),
250 )
251 }
252 #[inline]
253 fn topics(&self) -> <Self::TopicList as alloy_sol_types::SolType>::RustType {
254 (Self::SIGNATURE_HASH.into(), self.post_id.clone(), self.poster.clone())
255 }
256 #[inline]
257 fn encode_topics_raw(
258 &self,
259 out: &mut [alloy_sol_types::abi::token::WordToken],
260 ) -> alloy_sol_types::Result<()> {
261 if out.len() < <Self::TopicList as alloy_sol_types::TopicList>::COUNT {
262 return Err(alloy_sol_types::Error::Overrun);
263 }
264 out[0usize] = alloy_sol_types::abi::token::WordToken(
265 Self::SIGNATURE_HASH,
266 );
267 out[1usize] = <alloy::sol_types::sol_data::FixedBytes<
268 32,
269 > as alloy_sol_types::EventTopic>::encode_topic(&self.post_id);
270 out[2usize] = <alloy::sol_types::sol_data::Address as alloy_sol_types::EventTopic>::encode_topic(
271 &self.poster,
272 );
273 Ok(())
274 }
275 }
276 #[automatically_derived]
277 impl alloy_sol_types::private::IntoLogData for PostCreated {
278 fn to_log_data(&self) -> alloy_sol_types::private::LogData {
279 From::from(self)
280 }
281 fn into_log_data(self) -> alloy_sol_types::private::LogData {
282 From::from(&self)
283 }
284 }
285 #[automatically_derived]
286 impl From<&PostCreated> for alloy_sol_types::private::LogData {
287 #[inline]
288 fn from(this: &PostCreated) -> alloy_sol_types::private::LogData {
289 alloy_sol_types::SolEvent::encode_log_data(this)
290 }
291 }
292 };
293 #[derive(Default, Debug, PartialEq, Eq, Hash)]
294 #[allow(
299 non_camel_case_types,
300 non_snake_case,
301 clippy::pub_underscore_fields,
302 clippy::style
303 )]
304 #[derive(Clone)]
305 pub struct PostVoted {
306 #[allow(missing_docs)]
307 pub post_id: alloy::sol_types::private::FixedBytes<32>,
308 #[allow(missing_docs)]
309 pub voter: alloy::sol_types::private::Address,
310 }
311 #[allow(
312 non_camel_case_types,
313 non_snake_case,
314 clippy::pub_underscore_fields,
315 clippy::style
316 )]
317 const _: () = {
318 use alloy::sol_types as alloy_sol_types;
319 #[automatically_derived]
320 impl alloy_sol_types::SolEvent for PostVoted {
321 type DataTuple<'a> = ();
322 type DataToken<'a> = <Self::DataTuple<
323 'a,
324 > as alloy_sol_types::SolType>::Token<'a>;
325 type TopicList = (
326 alloy_sol_types::sol_data::FixedBytes<32>,
327 alloy::sol_types::sol_data::FixedBytes<32>,
328 alloy::sol_types::sol_data::Address,
329 );
330 const SIGNATURE: &'static str = "PostVoted(bytes32,address)";
331 const SIGNATURE_HASH: alloy_sol_types::private::B256 = alloy_sol_types::private::B256::new([
332 152u8, 182u8, 177u8, 128u8, 117u8, 108u8, 132u8, 155u8, 91u8, 251u8,
333 189u8, 43u8, 189u8, 9u8, 31u8, 63u8, 230u8, 75u8, 9u8, 53u8, 172u8, 25u8,
334 84u8, 24u8, 192u8, 182u8, 25u8, 185u8, 182u8, 97u8, 199u8, 141u8,
335 ]);
336 const ANONYMOUS: bool = false;
337 #[allow(unused_variables)]
338 #[inline]
339 fn new(
340 topics: <Self::TopicList as alloy_sol_types::SolType>::RustType,
341 data: <Self::DataTuple<'_> as alloy_sol_types::SolType>::RustType,
342 ) -> Self {
343 Self {
344 post_id: topics.1,
345 voter: topics.2,
346 }
347 }
348 #[inline]
349 fn check_signature(
350 topics: &<Self::TopicList as alloy_sol_types::SolType>::RustType,
351 ) -> alloy_sol_types::Result<()> {
352 if topics.0 != Self::SIGNATURE_HASH {
353 return Err(
354 alloy_sol_types::Error::invalid_event_signature_hash(
355 Self::SIGNATURE,
356 topics.0,
357 Self::SIGNATURE_HASH,
358 ),
359 );
360 }
361 Ok(())
362 }
363 #[inline]
364 fn tokenize_body(&self) -> Self::DataToken<'_> {
365 ()
366 }
367 #[inline]
368 fn topics(&self) -> <Self::TopicList as alloy_sol_types::SolType>::RustType {
369 (Self::SIGNATURE_HASH.into(), self.post_id.clone(), self.voter.clone())
370 }
371 #[inline]
372 fn encode_topics_raw(
373 &self,
374 out: &mut [alloy_sol_types::abi::token::WordToken],
375 ) -> alloy_sol_types::Result<()> {
376 if out.len() < <Self::TopicList as alloy_sol_types::TopicList>::COUNT {
377 return Err(alloy_sol_types::Error::Overrun);
378 }
379 out[0usize] = alloy_sol_types::abi::token::WordToken(
380 Self::SIGNATURE_HASH,
381 );
382 out[1usize] = <alloy::sol_types::sol_data::FixedBytes<
383 32,
384 > as alloy_sol_types::EventTopic>::encode_topic(&self.post_id);
385 out[2usize] = <alloy::sol_types::sol_data::Address as alloy_sol_types::EventTopic>::encode_topic(
386 &self.voter,
387 );
388 Ok(())
389 }
390 }
391 #[automatically_derived]
392 impl alloy_sol_types::private::IntoLogData for PostVoted {
393 fn to_log_data(&self) -> alloy_sol_types::private::LogData {
394 From::from(self)
395 }
396 fn into_log_data(self) -> alloy_sol_types::private::LogData {
397 From::from(&self)
398 }
399 }
400 #[automatically_derived]
401 impl From<&PostVoted> for alloy_sol_types::private::LogData {
402 #[inline]
403 fn from(this: &PostVoted) -> alloy_sol_types::private::LogData {
404 alloy_sol_types::SolEvent::encode_log_data(this)
405 }
406 }
407 };
408 #[derive(Default, Debug, PartialEq, Eq, Hash)]
409 #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
414 #[derive(Clone)]
415 pub struct createPostCall {
416 #[allow(missing_docs)]
417 pub post_data: alloy::sol_types::private::Bytes,
418 }
419 #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
421 #[derive(Clone)]
422 pub struct createPostReturn {}
423 #[allow(
424 non_camel_case_types,
425 non_snake_case,
426 clippy::pub_underscore_fields,
427 clippy::style
428 )]
429 const _: () = {
430 use alloy::sol_types as alloy_sol_types;
431 {
432 #[doc(hidden)]
433 type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::Bytes,);
434 #[doc(hidden)]
435 type UnderlyingRustTuple<'a> = (alloy::sol_types::private::Bytes,);
436 #[cfg(test)]
437 #[allow(dead_code, unreachable_patterns)]
438 fn _type_assertion(
439 _t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>,
440 ) {
441 match _t {
442 alloy_sol_types::private::AssertTypeEq::<
443 <UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
444 >(_) => {}
445 }
446 }
447 #[automatically_derived]
448 #[doc(hidden)]
449 impl ::core::convert::From<createPostCall> for UnderlyingRustTuple<'_> {
450 fn from(value: createPostCall) -> Self {
451 (value.post_data,)
452 }
453 }
454 #[automatically_derived]
455 #[doc(hidden)]
456 impl ::core::convert::From<UnderlyingRustTuple<'_>> for createPostCall {
457 fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
458 Self { post_data: tuple.0 }
459 }
460 }
461 }
462 {
463 #[doc(hidden)]
464 type UnderlyingSolTuple<'a> = ();
465 #[doc(hidden)]
466 type UnderlyingRustTuple<'a> = ();
467 #[cfg(test)]
468 #[allow(dead_code, unreachable_patterns)]
469 fn _type_assertion(
470 _t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>,
471 ) {
472 match _t {
473 alloy_sol_types::private::AssertTypeEq::<
474 <UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
475 >(_) => {}
476 }
477 }
478 #[automatically_derived]
479 #[doc(hidden)]
480 impl ::core::convert::From<createPostReturn> for UnderlyingRustTuple<'_> {
481 fn from(value: createPostReturn) -> Self {
482 ()
483 }
484 }
485 #[automatically_derived]
486 #[doc(hidden)]
487 impl ::core::convert::From<UnderlyingRustTuple<'_>> for createPostReturn {
488 fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
489 Self {}
490 }
491 }
492 }
493 #[automatically_derived]
494 impl alloy_sol_types::SolCall for createPostCall {
495 type Parameters<'a> = (alloy::sol_types::sol_data::Bytes,);
496 type Token<'a> = <Self::Parameters<
497 'a,
498 > as alloy_sol_types::SolType>::Token<'a>;
499 type Return = createPostReturn;
500 type ReturnTuple<'a> = ();
501 type ReturnToken<'a> = <Self::ReturnTuple<
502 'a,
503 > as alloy_sol_types::SolType>::Token<'a>;
504 const SIGNATURE: &'static str = "createPost(bytes)";
505 const SELECTOR: [u8; 4] = [223u8, 186u8, 162u8, 251u8];
506 #[inline]
507 fn new<'a>(
508 tuple: <Self::Parameters<'a> as alloy_sol_types::SolType>::RustType,
509 ) -> Self {
510 tuple.into()
511 }
512 #[inline]
513 fn tokenize(&self) -> Self::Token<'_> {
514 (
515 <alloy::sol_types::sol_data::Bytes as alloy_sol_types::SolType>::tokenize(
516 &self.post_data,
517 ),
518 )
519 }
520 #[inline]
521 fn abi_decode_returns(
522 data: &[u8],
523 validate: bool,
524 ) -> alloy_sol_types::Result<Self::Return> {
525 <Self::ReturnTuple<
526 '_,
527 > as alloy_sol_types::SolType>::abi_decode_sequence(data, validate)
528 .map(Into::into)
529 }
530 }
531 };
532 #[derive(Default, Debug, PartialEq, Eq, Hash)]
533 #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
538 #[derive(Clone)]
539 pub struct votePostCall {
540 #[allow(missing_docs)]
541 pub post_id: alloy::sol_types::private::FixedBytes<32>,
542 }
543 #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
545 #[derive(Clone)]
546 pub struct votePostReturn {}
547 #[allow(
548 non_camel_case_types,
549 non_snake_case,
550 clippy::pub_underscore_fields,
551 clippy::style
552 )]
553 const _: () = {
554 use alloy::sol_types as alloy_sol_types;
555 {
556 #[doc(hidden)]
557 type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::FixedBytes<32>,);
558 #[doc(hidden)]
559 type UnderlyingRustTuple<'a> = (alloy::sol_types::private::FixedBytes<32>,);
560 #[cfg(test)]
561 #[allow(dead_code, unreachable_patterns)]
562 fn _type_assertion(
563 _t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>,
564 ) {
565 match _t {
566 alloy_sol_types::private::AssertTypeEq::<
567 <UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
568 >(_) => {}
569 }
570 }
571 #[automatically_derived]
572 #[doc(hidden)]
573 impl ::core::convert::From<votePostCall> for UnderlyingRustTuple<'_> {
574 fn from(value: votePostCall) -> Self {
575 (value.post_id,)
576 }
577 }
578 #[automatically_derived]
579 #[doc(hidden)]
580 impl ::core::convert::From<UnderlyingRustTuple<'_>> for votePostCall {
581 fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
582 Self { post_id: tuple.0 }
583 }
584 }
585 }
586 {
587 #[doc(hidden)]
588 type UnderlyingSolTuple<'a> = ();
589 #[doc(hidden)]
590 type UnderlyingRustTuple<'a> = ();
591 #[cfg(test)]
592 #[allow(dead_code, unreachable_patterns)]
593 fn _type_assertion(
594 _t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>,
595 ) {
596 match _t {
597 alloy_sol_types::private::AssertTypeEq::<
598 <UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
599 >(_) => {}
600 }
601 }
602 #[automatically_derived]
603 #[doc(hidden)]
604 impl ::core::convert::From<votePostReturn> for UnderlyingRustTuple<'_> {
605 fn from(value: votePostReturn) -> Self {
606 ()
607 }
608 }
609 #[automatically_derived]
610 #[doc(hidden)]
611 impl ::core::convert::From<UnderlyingRustTuple<'_>> for votePostReturn {
612 fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
613 Self {}
614 }
615 }
616 }
617 #[automatically_derived]
618 impl alloy_sol_types::SolCall for votePostCall {
619 type Parameters<'a> = (alloy::sol_types::sol_data::FixedBytes<32>,);
620 type Token<'a> = <Self::Parameters<
621 'a,
622 > as alloy_sol_types::SolType>::Token<'a>;
623 type Return = votePostReturn;
624 type ReturnTuple<'a> = ();
625 type ReturnToken<'a> = <Self::ReturnTuple<
626 'a,
627 > as alloy_sol_types::SolType>::Token<'a>;
628 const SIGNATURE: &'static str = "votePost(bytes32)";
629 const SELECTOR: [u8; 4] = [161u8, 152u8, 27u8, 241u8];
630 #[inline]
631 fn new<'a>(
632 tuple: <Self::Parameters<'a> as alloy_sol_types::SolType>::RustType,
633 ) -> Self {
634 tuple.into()
635 }
636 #[inline]
637 fn tokenize(&self) -> Self::Token<'_> {
638 (
639 <alloy::sol_types::sol_data::FixedBytes<
640 32,
641 > as alloy_sol_types::SolType>::tokenize(&self.post_id),
642 )
643 }
644 #[inline]
645 fn abi_decode_returns(
646 data: &[u8],
647 validate: bool,
648 ) -> alloy_sol_types::Result<Self::Return> {
649 <Self::ReturnTuple<
650 '_,
651 > as alloy_sol_types::SolType>::abi_decode_sequence(data, validate)
652 .map(Into::into)
653 }
654 }
655 };
656 #[derive()]
658 pub enum RankedFeedCalls {
659 #[allow(missing_docs)]
660 createPost(createPostCall),
661 #[allow(missing_docs)]
662 votePost(votePostCall),
663 }
664 #[automatically_derived]
665 impl RankedFeedCalls {
666 pub const SELECTORS: &'static [[u8; 4usize]] = &[
673 [161u8, 152u8, 27u8, 241u8],
674 [223u8, 186u8, 162u8, 251u8],
675 ];
676 }
677 #[automatically_derived]
678 impl alloy_sol_types::SolInterface for RankedFeedCalls {
679 const NAME: &'static str = "RankedFeedCalls";
680 const MIN_DATA_LENGTH: usize = 32usize;
681 const COUNT: usize = 2usize;
682 #[inline]
683 fn selector(&self) -> [u8; 4] {
684 match self {
685 Self::createPost(_) => {
686 <createPostCall as alloy_sol_types::SolCall>::SELECTOR
687 }
688 Self::votePost(_) => <votePostCall as alloy_sol_types::SolCall>::SELECTOR,
689 }
690 }
691 #[inline]
692 fn selector_at(i: usize) -> ::core::option::Option<[u8; 4]> {
693 Self::SELECTORS.get(i).copied()
694 }
695 #[inline]
696 fn valid_selector(selector: [u8; 4]) -> bool {
697 Self::SELECTORS.binary_search(&selector).is_ok()
698 }
699 #[inline]
700 #[allow(non_snake_case)]
701 fn abi_decode_raw(
702 selector: [u8; 4],
703 data: &[u8],
704 validate: bool,
705 ) -> alloy_sol_types::Result<Self> {
706 static DECODE_SHIMS: &[fn(
707 &[u8],
708 bool,
709 ) -> alloy_sol_types::Result<RankedFeedCalls>] = &[
710 {
711 fn votePost(
712 data: &[u8],
713 validate: bool,
714 ) -> alloy_sol_types::Result<RankedFeedCalls> {
715 <votePostCall as alloy_sol_types::SolCall>::abi_decode_raw(
716 data,
717 validate,
718 )
719 .map(RankedFeedCalls::votePost)
720 }
721 votePost
722 },
723 {
724 fn createPost(
725 data: &[u8],
726 validate: bool,
727 ) -> alloy_sol_types::Result<RankedFeedCalls> {
728 <createPostCall as alloy_sol_types::SolCall>::abi_decode_raw(
729 data,
730 validate,
731 )
732 .map(RankedFeedCalls::createPost)
733 }
734 createPost
735 },
736 ];
737 let Ok(idx) = Self::SELECTORS.binary_search(&selector) else {
738 return Err(
739 alloy_sol_types::Error::unknown_selector(
740 <Self as alloy_sol_types::SolInterface>::NAME,
741 selector,
742 ),
743 );
744 };
745 DECODE_SHIMS[idx](data, validate)
746 }
747 #[inline]
748 fn abi_encoded_size(&self) -> usize {
749 match self {
750 Self::createPost(inner) => {
751 <createPostCall as alloy_sol_types::SolCall>::abi_encoded_size(inner)
752 }
753 Self::votePost(inner) => {
754 <votePostCall as alloy_sol_types::SolCall>::abi_encoded_size(inner)
755 }
756 }
757 }
758 #[inline]
759 fn abi_encode_raw(&self, out: &mut alloy_sol_types::private::Vec<u8>) {
760 match self {
761 Self::createPost(inner) => {
762 <createPostCall as alloy_sol_types::SolCall>::abi_encode_raw(
763 inner,
764 out,
765 )
766 }
767 Self::votePost(inner) => {
768 <votePostCall as alloy_sol_types::SolCall>::abi_encode_raw(
769 inner,
770 out,
771 )
772 }
773 }
774 }
775 }
776 #[derive(Debug, PartialEq, Eq, Hash)]
778 pub enum RankedFeedErrors {
779 #[allow(missing_docs)]
780 AlreadyVoted(AlreadyVoted),
781 }
782 #[automatically_derived]
783 impl RankedFeedErrors {
784 pub const SELECTORS: &'static [[u8; 4usize]] = &[[124u8, 154u8, 28u8, 249u8]];
791 }
792 #[automatically_derived]
793 impl alloy_sol_types::SolInterface for RankedFeedErrors {
794 const NAME: &'static str = "RankedFeedErrors";
795 const MIN_DATA_LENGTH: usize = 0usize;
796 const COUNT: usize = 1usize;
797 #[inline]
798 fn selector(&self) -> [u8; 4] {
799 match self {
800 Self::AlreadyVoted(_) => {
801 <AlreadyVoted as alloy_sol_types::SolError>::SELECTOR
802 }
803 }
804 }
805 #[inline]
806 fn selector_at(i: usize) -> ::core::option::Option<[u8; 4]> {
807 Self::SELECTORS.get(i).copied()
808 }
809 #[inline]
810 fn valid_selector(selector: [u8; 4]) -> bool {
811 Self::SELECTORS.binary_search(&selector).is_ok()
812 }
813 #[inline]
814 #[allow(non_snake_case)]
815 fn abi_decode_raw(
816 selector: [u8; 4],
817 data: &[u8],
818 validate: bool,
819 ) -> alloy_sol_types::Result<Self> {
820 static DECODE_SHIMS: &[fn(
821 &[u8],
822 bool,
823 ) -> alloy_sol_types::Result<RankedFeedErrors>] = &[
824 {
825 fn AlreadyVoted(
826 data: &[u8],
827 validate: bool,
828 ) -> alloy_sol_types::Result<RankedFeedErrors> {
829 <AlreadyVoted as alloy_sol_types::SolError>::abi_decode_raw(
830 data,
831 validate,
832 )
833 .map(RankedFeedErrors::AlreadyVoted)
834 }
835 AlreadyVoted
836 },
837 ];
838 let Ok(idx) = Self::SELECTORS.binary_search(&selector) else {
839 return Err(
840 alloy_sol_types::Error::unknown_selector(
841 <Self as alloy_sol_types::SolInterface>::NAME,
842 selector,
843 ),
844 );
845 };
846 DECODE_SHIMS[idx](data, validate)
847 }
848 #[inline]
849 fn abi_encoded_size(&self) -> usize {
850 match self {
851 Self::AlreadyVoted(inner) => {
852 <AlreadyVoted as alloy_sol_types::SolError>::abi_encoded_size(inner)
853 }
854 }
855 }
856 #[inline]
857 fn abi_encode_raw(&self, out: &mut alloy_sol_types::private::Vec<u8>) {
858 match self {
859 Self::AlreadyVoted(inner) => {
860 <AlreadyVoted as alloy_sol_types::SolError>::abi_encode_raw(
861 inner,
862 out,
863 )
864 }
865 }
866 }
867 }
868 #[derive(Debug, PartialEq, Eq, Hash)]
870 pub enum RankedFeedEvents {
871 #[allow(missing_docs)]
872 PostCreated(PostCreated),
873 #[allow(missing_docs)]
874 PostVoted(PostVoted),
875 }
876 #[automatically_derived]
877 impl RankedFeedEvents {
878 pub const SELECTORS: &'static [[u8; 32usize]] = &[
885 [
886 152u8, 182u8, 177u8, 128u8, 117u8, 108u8, 132u8, 155u8, 91u8, 251u8,
887 189u8, 43u8, 189u8, 9u8, 31u8, 63u8, 230u8, 75u8, 9u8, 53u8, 172u8, 25u8,
888 84u8, 24u8, 192u8, 182u8, 25u8, 185u8, 182u8, 97u8, 199u8, 141u8,
889 ],
890 [
891 237u8, 110u8, 111u8, 223u8, 153u8, 205u8, 94u8, 151u8, 20u8, 92u8, 126u8,
892 89u8, 173u8, 233u8, 57u8, 35u8, 190u8, 25u8, 121u8, 85u8, 122u8, 119u8,
893 230u8, 57u8, 237u8, 149u8, 162u8, 3u8, 199u8, 168u8, 232u8, 97u8,
894 ],
895 ];
896 }
897 #[automatically_derived]
898 impl alloy_sol_types::SolEventInterface for RankedFeedEvents {
899 const NAME: &'static str = "RankedFeedEvents";
900 const COUNT: usize = 2usize;
901 fn decode_raw_log(
902 topics: &[alloy_sol_types::Word],
903 data: &[u8],
904 validate: bool,
905 ) -> alloy_sol_types::Result<Self> {
906 match topics.first().copied() {
907 Some(<PostCreated as alloy_sol_types::SolEvent>::SIGNATURE_HASH) => {
908 <PostCreated as alloy_sol_types::SolEvent>::decode_raw_log(
909 topics,
910 data,
911 validate,
912 )
913 .map(Self::PostCreated)
914 }
915 Some(<PostVoted as alloy_sol_types::SolEvent>::SIGNATURE_HASH) => {
916 <PostVoted as alloy_sol_types::SolEvent>::decode_raw_log(
917 topics,
918 data,
919 validate,
920 )
921 .map(Self::PostVoted)
922 }
923 _ => {
924 alloy_sol_types::private::Err(alloy_sol_types::Error::InvalidLog {
925 name: <Self as alloy_sol_types::SolEventInterface>::NAME,
926 log: alloy_sol_types::private::Box::new(
927 alloy_sol_types::private::LogData::new_unchecked(
928 topics.to_vec(),
929 data.to_vec().into(),
930 ),
931 ),
932 })
933 }
934 }
935 }
936 }
937 #[automatically_derived]
938 impl alloy_sol_types::private::IntoLogData for RankedFeedEvents {
939 fn to_log_data(&self) -> alloy_sol_types::private::LogData {
940 match self {
941 Self::PostCreated(inner) => {
942 alloy_sol_types::private::IntoLogData::to_log_data(inner)
943 }
944 Self::PostVoted(inner) => {
945 alloy_sol_types::private::IntoLogData::to_log_data(inner)
946 }
947 }
948 }
949 fn into_log_data(self) -> alloy_sol_types::private::LogData {
950 match self {
951 Self::PostCreated(inner) => {
952 alloy_sol_types::private::IntoLogData::into_log_data(inner)
953 }
954 Self::PostVoted(inner) => {
955 alloy_sol_types::private::IntoLogData::into_log_data(inner)
956 }
957 }
958 }
959 }
960 use alloy::contract as alloy_contract;
961 #[inline]
965 pub const fn new<
966 T: alloy_contract::private::Transport + ::core::clone::Clone,
967 P: alloy_contract::private::Provider<T, N>,
968 N: alloy_contract::private::Network,
969 >(
970 address: alloy_sol_types::private::Address,
971 provider: P,
972 ) -> RankedFeedInstance<T, P, N> {
973 RankedFeedInstance::<T, P, N>::new(address, provider)
974 }
975 #[derive(Clone)]
987 pub struct RankedFeedInstance<T, P, N = alloy_contract::private::Ethereum> {
988 address: alloy_sol_types::private::Address,
989 provider: P,
990 _network_transport: ::core::marker::PhantomData<(N, T)>,
991 }
992 #[automatically_derived]
993 impl<T, P, N> ::core::fmt::Debug for RankedFeedInstance<T, P, N> {
994 #[inline]
995 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
996 f.debug_tuple("RankedFeedInstance").field(&self.address).finish()
997 }
998 }
999 #[automatically_derived]
1001 impl<
1002 T: alloy_contract::private::Transport + ::core::clone::Clone,
1003 P: alloy_contract::private::Provider<T, N>,
1004 N: alloy_contract::private::Network,
1005 > RankedFeedInstance<T, P, N> {
1006 #[inline]
1010 pub const fn new(
1011 address: alloy_sol_types::private::Address,
1012 provider: P,
1013 ) -> Self {
1014 Self {
1015 address,
1016 provider,
1017 _network_transport: ::core::marker::PhantomData,
1018 }
1019 }
1020 #[inline]
1022 pub const fn address(&self) -> &alloy_sol_types::private::Address {
1023 &self.address
1024 }
1025 #[inline]
1027 pub fn set_address(&mut self, address: alloy_sol_types::private::Address) {
1028 self.address = address;
1029 }
1030 pub fn at(mut self, address: alloy_sol_types::private::Address) -> Self {
1032 self.set_address(address);
1033 self
1034 }
1035 #[inline]
1037 pub const fn provider(&self) -> &P {
1038 &self.provider
1039 }
1040 }
1041 impl<T, P: ::core::clone::Clone, N> RankedFeedInstance<T, &P, N> {
1042 #[inline]
1044 pub fn with_cloned_provider(self) -> RankedFeedInstance<T, P, N> {
1045 RankedFeedInstance {
1046 address: self.address,
1047 provider: ::core::clone::Clone::clone(&self.provider),
1048 _network_transport: ::core::marker::PhantomData,
1049 }
1050 }
1051 }
1052 #[automatically_derived]
1054 impl<
1055 T: alloy_contract::private::Transport + ::core::clone::Clone,
1056 P: alloy_contract::private::Provider<T, N>,
1057 N: alloy_contract::private::Network,
1058 > RankedFeedInstance<T, P, N> {
1059 pub fn call_builder<C: alloy_sol_types::SolCall>(
1064 &self,
1065 call: &C,
1066 ) -> alloy_contract::SolCallBuilder<T, &P, C, N> {
1067 alloy_contract::SolCallBuilder::new_sol(&self.provider, &self.address, call)
1068 }
1069 pub fn createPost(
1071 &self,
1072 post_data: alloy::sol_types::private::Bytes,
1073 ) -> alloy_contract::SolCallBuilder<T, &P, createPostCall, N> {
1074 self.call_builder(&createPostCall { post_data })
1075 }
1076 pub fn votePost(
1078 &self,
1079 post_id: alloy::sol_types::private::FixedBytes<32>,
1080 ) -> alloy_contract::SolCallBuilder<T, &P, votePostCall, N> {
1081 self.call_builder(&votePostCall { post_id })
1082 }
1083 }
1084 #[automatically_derived]
1086 impl<
1087 T: alloy_contract::private::Transport + ::core::clone::Clone,
1088 P: alloy_contract::private::Provider<T, N>,
1089 N: alloy_contract::private::Network,
1090 > RankedFeedInstance<T, P, N> {
1091 pub fn event_filter<E: alloy_sol_types::SolEvent>(
1096 &self,
1097 ) -> alloy_contract::Event<T, &P, E, N> {
1098 alloy_contract::Event::new_sol(&self.provider, &self.address)
1099 }
1100 pub fn PostCreated_filter(
1102 &self,
1103 ) -> alloy_contract::Event<T, &P, PostCreated, N> {
1104 self.event_filter::<PostCreated>()
1105 }
1106 pub fn PostVoted_filter(&self) -> alloy_contract::Event<T, &P, PostVoted, N> {
1108 self.event_filter::<PostVoted>()
1109 }
1110 }
1111}