1#[allow(
57 non_camel_case_types,
58 non_snake_case,
59 clippy::pub_underscore_fields,
60 clippy::style,
61 clippy::empty_structs_with_brackets
62)]
63pub mod ERC1967Utils {
64 use super::*;
65 use alloy::sol_types as alloy_sol_types;
66 #[rustfmt::skip]
72 #[allow(clippy::all)]
73 pub static BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
74 b"`\x80\x80`@R4`\x17W`9\x90\x81`\x1C\x8290\x81PP\xF3[_\x80\xFD\xFE_\x80\xFD\xFE\xA2dipfsX\"\x12 \xCB~ \xF5b[\x97\x10\x94\xA7\xB0\x14k\x14\x8AK)\x93\xCBGE\xCE\xE5\xE1\xED\xE1[\x7F\xEDP\xC3\xF8dsolcC\0\x08\x1C\x003",
75 );
76 #[rustfmt::skip]
82 #[allow(clippy::all)]
83 pub static DEPLOYED_BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
84 b"_\x80\xFD\xFE\xA2dipfsX\"\x12 \xCB~ \xF5b[\x97\x10\x94\xA7\xB0\x14k\x14\x8AK)\x93\xCBGE\xCE\xE5\xE1\xED\xE1[\x7F\xEDP\xC3\xF8dsolcC\0\x08\x1C\x003",
85 );
86 #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
91 #[derive(Clone)]
92 pub struct ERC1967InvalidAdmin {
93 #[allow(missing_docs)]
94 pub admin: alloy::sol_types::private::Address,
95 }
96 #[allow(
97 non_camel_case_types,
98 non_snake_case,
99 clippy::pub_underscore_fields,
100 clippy::style
101 )]
102 const _: () = {
103 use alloy::sol_types as alloy_sol_types;
104 #[doc(hidden)]
105 type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::Address,);
106 #[doc(hidden)]
107 type UnderlyingRustTuple<'a> = (alloy::sol_types::private::Address,);
108 #[cfg(test)]
109 #[allow(dead_code, unreachable_patterns)]
110 fn _type_assertion(
111 _t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>,
112 ) {
113 match _t {
114 alloy_sol_types::private::AssertTypeEq::<
115 <UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
116 >(_) => {}
117 }
118 }
119 #[automatically_derived]
120 #[doc(hidden)]
121 impl ::core::convert::From<ERC1967InvalidAdmin> for UnderlyingRustTuple<'_> {
122 fn from(value: ERC1967InvalidAdmin) -> Self {
123 (value.admin,)
124 }
125 }
126 #[automatically_derived]
127 #[doc(hidden)]
128 impl ::core::convert::From<UnderlyingRustTuple<'_>> for ERC1967InvalidAdmin {
129 fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
130 Self { admin: tuple.0 }
131 }
132 }
133 #[automatically_derived]
134 impl alloy_sol_types::SolError for ERC1967InvalidAdmin {
135 type Parameters<'a> = UnderlyingSolTuple<'a>;
136 type Token<'a> = <Self::Parameters<
137 'a,
138 > as alloy_sol_types::SolType>::Token<'a>;
139 const SIGNATURE: &'static str = "ERC1967InvalidAdmin(address)";
140 const SELECTOR: [u8; 4] = [98u8, 231u8, 123u8, 162u8];
141 #[inline]
142 fn new<'a>(
143 tuple: <Self::Parameters<'a> as alloy_sol_types::SolType>::RustType,
144 ) -> Self {
145 tuple.into()
146 }
147 #[inline]
148 fn tokenize(&self) -> Self::Token<'_> {
149 (
150 <alloy::sol_types::sol_data::Address as alloy_sol_types::SolType>::tokenize(
151 &self.admin,
152 ),
153 )
154 }
155 }
156 };
157 #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
162 #[derive(Clone)]
163 pub struct ERC1967InvalidBeacon {
164 #[allow(missing_docs)]
165 pub beacon: alloy::sol_types::private::Address,
166 }
167 #[allow(
168 non_camel_case_types,
169 non_snake_case,
170 clippy::pub_underscore_fields,
171 clippy::style
172 )]
173 const _: () = {
174 use alloy::sol_types as alloy_sol_types;
175 #[doc(hidden)]
176 type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::Address,);
177 #[doc(hidden)]
178 type UnderlyingRustTuple<'a> = (alloy::sol_types::private::Address,);
179 #[cfg(test)]
180 #[allow(dead_code, unreachable_patterns)]
181 fn _type_assertion(
182 _t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>,
183 ) {
184 match _t {
185 alloy_sol_types::private::AssertTypeEq::<
186 <UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
187 >(_) => {}
188 }
189 }
190 #[automatically_derived]
191 #[doc(hidden)]
192 impl ::core::convert::From<ERC1967InvalidBeacon> for UnderlyingRustTuple<'_> {
193 fn from(value: ERC1967InvalidBeacon) -> Self {
194 (value.beacon,)
195 }
196 }
197 #[automatically_derived]
198 #[doc(hidden)]
199 impl ::core::convert::From<UnderlyingRustTuple<'_>> for ERC1967InvalidBeacon {
200 fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
201 Self { beacon: tuple.0 }
202 }
203 }
204 #[automatically_derived]
205 impl alloy_sol_types::SolError for ERC1967InvalidBeacon {
206 type Parameters<'a> = UnderlyingSolTuple<'a>;
207 type Token<'a> = <Self::Parameters<
208 'a,
209 > as alloy_sol_types::SolType>::Token<'a>;
210 const SIGNATURE: &'static str = "ERC1967InvalidBeacon(address)";
211 const SELECTOR: [u8; 4] = [100u8, 206u8, 208u8, 236u8];
212 #[inline]
213 fn new<'a>(
214 tuple: <Self::Parameters<'a> as alloy_sol_types::SolType>::RustType,
215 ) -> Self {
216 tuple.into()
217 }
218 #[inline]
219 fn tokenize(&self) -> Self::Token<'_> {
220 (
221 <alloy::sol_types::sol_data::Address as alloy_sol_types::SolType>::tokenize(
222 &self.beacon,
223 ),
224 )
225 }
226 }
227 };
228 #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
233 #[derive(Clone)]
234 pub struct ERC1967InvalidImplementation {
235 #[allow(missing_docs)]
236 pub implementation: alloy::sol_types::private::Address,
237 }
238 #[allow(
239 non_camel_case_types,
240 non_snake_case,
241 clippy::pub_underscore_fields,
242 clippy::style
243 )]
244 const _: () = {
245 use alloy::sol_types as alloy_sol_types;
246 #[doc(hidden)]
247 type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::Address,);
248 #[doc(hidden)]
249 type UnderlyingRustTuple<'a> = (alloy::sol_types::private::Address,);
250 #[cfg(test)]
251 #[allow(dead_code, unreachable_patterns)]
252 fn _type_assertion(
253 _t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>,
254 ) {
255 match _t {
256 alloy_sol_types::private::AssertTypeEq::<
257 <UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
258 >(_) => {}
259 }
260 }
261 #[automatically_derived]
262 #[doc(hidden)]
263 impl ::core::convert::From<ERC1967InvalidImplementation>
264 for UnderlyingRustTuple<'_> {
265 fn from(value: ERC1967InvalidImplementation) -> Self {
266 (value.implementation,)
267 }
268 }
269 #[automatically_derived]
270 #[doc(hidden)]
271 impl ::core::convert::From<UnderlyingRustTuple<'_>>
272 for ERC1967InvalidImplementation {
273 fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
274 Self { implementation: tuple.0 }
275 }
276 }
277 #[automatically_derived]
278 impl alloy_sol_types::SolError for ERC1967InvalidImplementation {
279 type Parameters<'a> = UnderlyingSolTuple<'a>;
280 type Token<'a> = <Self::Parameters<
281 'a,
282 > as alloy_sol_types::SolType>::Token<'a>;
283 const SIGNATURE: &'static str = "ERC1967InvalidImplementation(address)";
284 const SELECTOR: [u8; 4] = [76u8, 156u8, 140u8, 227u8];
285 #[inline]
286 fn new<'a>(
287 tuple: <Self::Parameters<'a> as alloy_sol_types::SolType>::RustType,
288 ) -> Self {
289 tuple.into()
290 }
291 #[inline]
292 fn tokenize(&self) -> Self::Token<'_> {
293 (
294 <alloy::sol_types::sol_data::Address as alloy_sol_types::SolType>::tokenize(
295 &self.implementation,
296 ),
297 )
298 }
299 }
300 };
301 #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
306 #[derive(Clone)]
307 pub struct ERC1967NonPayable {}
308 #[allow(
309 non_camel_case_types,
310 non_snake_case,
311 clippy::pub_underscore_fields,
312 clippy::style
313 )]
314 const _: () = {
315 use alloy::sol_types as alloy_sol_types;
316 #[doc(hidden)]
317 type UnderlyingSolTuple<'a> = ();
318 #[doc(hidden)]
319 type UnderlyingRustTuple<'a> = ();
320 #[cfg(test)]
321 #[allow(dead_code, unreachable_patterns)]
322 fn _type_assertion(
323 _t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>,
324 ) {
325 match _t {
326 alloy_sol_types::private::AssertTypeEq::<
327 <UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
328 >(_) => {}
329 }
330 }
331 #[automatically_derived]
332 #[doc(hidden)]
333 impl ::core::convert::From<ERC1967NonPayable> for UnderlyingRustTuple<'_> {
334 fn from(value: ERC1967NonPayable) -> Self {
335 ()
336 }
337 }
338 #[automatically_derived]
339 #[doc(hidden)]
340 impl ::core::convert::From<UnderlyingRustTuple<'_>> for ERC1967NonPayable {
341 fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
342 Self {}
343 }
344 }
345 #[automatically_derived]
346 impl alloy_sol_types::SolError for ERC1967NonPayable {
347 type Parameters<'a> = UnderlyingSolTuple<'a>;
348 type Token<'a> = <Self::Parameters<
349 'a,
350 > as alloy_sol_types::SolType>::Token<'a>;
351 const SIGNATURE: &'static str = "ERC1967NonPayable()";
352 const SELECTOR: [u8; 4] = [179u8, 152u8, 151u8, 159u8];
353 #[inline]
354 fn new<'a>(
355 tuple: <Self::Parameters<'a> as alloy_sol_types::SolType>::RustType,
356 ) -> Self {
357 tuple.into()
358 }
359 #[inline]
360 fn tokenize(&self) -> Self::Token<'_> {
361 ()
362 }
363 }
364 };
365 pub enum ERC1967UtilsErrors {
367 #[allow(missing_docs)]
368 ERC1967InvalidAdmin(ERC1967InvalidAdmin),
369 #[allow(missing_docs)]
370 ERC1967InvalidBeacon(ERC1967InvalidBeacon),
371 #[allow(missing_docs)]
372 ERC1967InvalidImplementation(ERC1967InvalidImplementation),
373 #[allow(missing_docs)]
374 ERC1967NonPayable(ERC1967NonPayable),
375 }
376 #[automatically_derived]
377 impl ERC1967UtilsErrors {
378 pub const SELECTORS: &'static [[u8; 4usize]] = &[
385 [76u8, 156u8, 140u8, 227u8],
386 [98u8, 231u8, 123u8, 162u8],
387 [100u8, 206u8, 208u8, 236u8],
388 [179u8, 152u8, 151u8, 159u8],
389 ];
390 }
391 #[automatically_derived]
392 impl alloy_sol_types::SolInterface for ERC1967UtilsErrors {
393 const NAME: &'static str = "ERC1967UtilsErrors";
394 const MIN_DATA_LENGTH: usize = 0usize;
395 const COUNT: usize = 4usize;
396 #[inline]
397 fn selector(&self) -> [u8; 4] {
398 match self {
399 Self::ERC1967InvalidAdmin(_) => {
400 <ERC1967InvalidAdmin as alloy_sol_types::SolError>::SELECTOR
401 }
402 Self::ERC1967InvalidBeacon(_) => {
403 <ERC1967InvalidBeacon as alloy_sol_types::SolError>::SELECTOR
404 }
405 Self::ERC1967InvalidImplementation(_) => {
406 <ERC1967InvalidImplementation as alloy_sol_types::SolError>::SELECTOR
407 }
408 Self::ERC1967NonPayable(_) => {
409 <ERC1967NonPayable as alloy_sol_types::SolError>::SELECTOR
410 }
411 }
412 }
413 #[inline]
414 fn selector_at(i: usize) -> ::core::option::Option<[u8; 4]> {
415 Self::SELECTORS.get(i).copied()
416 }
417 #[inline]
418 fn valid_selector(selector: [u8; 4]) -> bool {
419 Self::SELECTORS.binary_search(&selector).is_ok()
420 }
421 #[inline]
422 #[allow(non_snake_case)]
423 fn abi_decode_raw(
424 selector: [u8; 4],
425 data: &[u8],
426 validate: bool,
427 ) -> alloy_sol_types::Result<Self> {
428 static DECODE_SHIMS: &[fn(
429 &[u8],
430 bool,
431 ) -> alloy_sol_types::Result<ERC1967UtilsErrors>] = &[
432 {
433 fn ERC1967InvalidImplementation(
434 data: &[u8],
435 validate: bool,
436 ) -> alloy_sol_types::Result<ERC1967UtilsErrors> {
437 <ERC1967InvalidImplementation as alloy_sol_types::SolError>::abi_decode_raw(
438 data,
439 validate,
440 )
441 .map(ERC1967UtilsErrors::ERC1967InvalidImplementation)
442 }
443 ERC1967InvalidImplementation
444 },
445 {
446 fn ERC1967InvalidAdmin(
447 data: &[u8],
448 validate: bool,
449 ) -> alloy_sol_types::Result<ERC1967UtilsErrors> {
450 <ERC1967InvalidAdmin as alloy_sol_types::SolError>::abi_decode_raw(
451 data,
452 validate,
453 )
454 .map(ERC1967UtilsErrors::ERC1967InvalidAdmin)
455 }
456 ERC1967InvalidAdmin
457 },
458 {
459 fn ERC1967InvalidBeacon(
460 data: &[u8],
461 validate: bool,
462 ) -> alloy_sol_types::Result<ERC1967UtilsErrors> {
463 <ERC1967InvalidBeacon as alloy_sol_types::SolError>::abi_decode_raw(
464 data,
465 validate,
466 )
467 .map(ERC1967UtilsErrors::ERC1967InvalidBeacon)
468 }
469 ERC1967InvalidBeacon
470 },
471 {
472 fn ERC1967NonPayable(
473 data: &[u8],
474 validate: bool,
475 ) -> alloy_sol_types::Result<ERC1967UtilsErrors> {
476 <ERC1967NonPayable as alloy_sol_types::SolError>::abi_decode_raw(
477 data,
478 validate,
479 )
480 .map(ERC1967UtilsErrors::ERC1967NonPayable)
481 }
482 ERC1967NonPayable
483 },
484 ];
485 let Ok(idx) = Self::SELECTORS.binary_search(&selector) else {
486 return Err(
487 alloy_sol_types::Error::unknown_selector(
488 <Self as alloy_sol_types::SolInterface>::NAME,
489 selector,
490 ),
491 );
492 };
493 DECODE_SHIMS[idx](data, validate)
494 }
495 #[inline]
496 fn abi_encoded_size(&self) -> usize {
497 match self {
498 Self::ERC1967InvalidAdmin(inner) => {
499 <ERC1967InvalidAdmin as alloy_sol_types::SolError>::abi_encoded_size(
500 inner,
501 )
502 }
503 Self::ERC1967InvalidBeacon(inner) => {
504 <ERC1967InvalidBeacon as alloy_sol_types::SolError>::abi_encoded_size(
505 inner,
506 )
507 }
508 Self::ERC1967InvalidImplementation(inner) => {
509 <ERC1967InvalidImplementation as alloy_sol_types::SolError>::abi_encoded_size(
510 inner,
511 )
512 }
513 Self::ERC1967NonPayable(inner) => {
514 <ERC1967NonPayable as alloy_sol_types::SolError>::abi_encoded_size(
515 inner,
516 )
517 }
518 }
519 }
520 #[inline]
521 fn abi_encode_raw(&self, out: &mut alloy_sol_types::private::Vec<u8>) {
522 match self {
523 Self::ERC1967InvalidAdmin(inner) => {
524 <ERC1967InvalidAdmin as alloy_sol_types::SolError>::abi_encode_raw(
525 inner,
526 out,
527 )
528 }
529 Self::ERC1967InvalidBeacon(inner) => {
530 <ERC1967InvalidBeacon as alloy_sol_types::SolError>::abi_encode_raw(
531 inner,
532 out,
533 )
534 }
535 Self::ERC1967InvalidImplementation(inner) => {
536 <ERC1967InvalidImplementation as alloy_sol_types::SolError>::abi_encode_raw(
537 inner,
538 out,
539 )
540 }
541 Self::ERC1967NonPayable(inner) => {
542 <ERC1967NonPayable as alloy_sol_types::SolError>::abi_encode_raw(
543 inner,
544 out,
545 )
546 }
547 }
548 }
549 }
550 use alloy::contract as alloy_contract;
551 #[inline]
555 pub const fn new<
556 T: alloy_contract::private::Transport + ::core::clone::Clone,
557 P: alloy_contract::private::Provider<T, N>,
558 N: alloy_contract::private::Network,
559 >(
560 address: alloy_sol_types::private::Address,
561 provider: P,
562 ) -> ERC1967UtilsInstance<T, P, N> {
563 ERC1967UtilsInstance::<T, P, N>::new(address, provider)
564 }
565 #[inline]
571 pub fn deploy<
572 T: alloy_contract::private::Transport + ::core::clone::Clone,
573 P: alloy_contract::private::Provider<T, N>,
574 N: alloy_contract::private::Network,
575 >(
576 provider: P,
577 ) -> impl ::core::future::Future<
578 Output = alloy_contract::Result<ERC1967UtilsInstance<T, P, N>>,
579 > {
580 ERC1967UtilsInstance::<T, P, N>::deploy(provider)
581 }
582 #[inline]
588 pub fn deploy_builder<
589 T: alloy_contract::private::Transport + ::core::clone::Clone,
590 P: alloy_contract::private::Provider<T, N>,
591 N: alloy_contract::private::Network,
592 >(provider: P) -> alloy_contract::RawCallBuilder<T, P, N> {
593 ERC1967UtilsInstance::<T, P, N>::deploy_builder(provider)
594 }
595 #[derive(Clone)]
607 pub struct ERC1967UtilsInstance<T, P, N = alloy_contract::private::Ethereum> {
608 address: alloy_sol_types::private::Address,
609 provider: P,
610 _network_transport: ::core::marker::PhantomData<(N, T)>,
611 }
612 #[automatically_derived]
613 impl<T, P, N> ::core::fmt::Debug for ERC1967UtilsInstance<T, P, N> {
614 #[inline]
615 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
616 f.debug_tuple("ERC1967UtilsInstance").field(&self.address).finish()
617 }
618 }
619 #[automatically_derived]
621 impl<
622 T: alloy_contract::private::Transport + ::core::clone::Clone,
623 P: alloy_contract::private::Provider<T, N>,
624 N: alloy_contract::private::Network,
625 > ERC1967UtilsInstance<T, P, N> {
626 #[inline]
630 pub const fn new(
631 address: alloy_sol_types::private::Address,
632 provider: P,
633 ) -> Self {
634 Self {
635 address,
636 provider,
637 _network_transport: ::core::marker::PhantomData,
638 }
639 }
640 #[inline]
646 pub async fn deploy(
647 provider: P,
648 ) -> alloy_contract::Result<ERC1967UtilsInstance<T, P, N>> {
649 let call_builder = Self::deploy_builder(provider);
650 let contract_address = call_builder.deploy().await?;
651 Ok(Self::new(contract_address, call_builder.provider))
652 }
653 #[inline]
659 pub fn deploy_builder(provider: P) -> alloy_contract::RawCallBuilder<T, P, N> {
660 alloy_contract::RawCallBuilder::new_raw_deploy(
661 provider,
662 ::core::clone::Clone::clone(&BYTECODE),
663 )
664 }
665 #[inline]
667 pub const fn address(&self) -> &alloy_sol_types::private::Address {
668 &self.address
669 }
670 #[inline]
672 pub fn set_address(&mut self, address: alloy_sol_types::private::Address) {
673 self.address = address;
674 }
675 pub fn at(mut self, address: alloy_sol_types::private::Address) -> Self {
677 self.set_address(address);
678 self
679 }
680 #[inline]
682 pub const fn provider(&self) -> &P {
683 &self.provider
684 }
685 }
686 impl<T, P: ::core::clone::Clone, N> ERC1967UtilsInstance<T, &P, N> {
687 #[inline]
689 pub fn with_cloned_provider(self) -> ERC1967UtilsInstance<T, P, N> {
690 ERC1967UtilsInstance {
691 address: self.address,
692 provider: ::core::clone::Clone::clone(&self.provider),
693 _network_transport: ::core::marker::PhantomData,
694 }
695 }
696 }
697 #[automatically_derived]
699 impl<
700 T: alloy_contract::private::Transport + ::core::clone::Clone,
701 P: alloy_contract::private::Provider<T, N>,
702 N: alloy_contract::private::Network,
703 > ERC1967UtilsInstance<T, P, N> {
704 pub fn call_builder<C: alloy_sol_types::SolCall>(
709 &self,
710 call: &C,
711 ) -> alloy_contract::SolCallBuilder<T, &P, C, N> {
712 alloy_contract::SolCallBuilder::new_sol(&self.provider, &self.address, call)
713 }
714 }
715 #[automatically_derived]
717 impl<
718 T: alloy_contract::private::Transport + ::core::clone::Clone,
719 P: alloy_contract::private::Provider<T, N>,
720 N: alloy_contract::private::Network,
721 > ERC1967UtilsInstance<T, P, N> {
722 pub fn event_filter<E: alloy_sol_types::SolEvent>(
727 &self,
728 ) -> alloy_contract::Event<T, &P, E, N> {
729 alloy_contract::Event::new_sol(&self.provider, &self.address)
730 }
731 }
732}