1#[allow(
90 non_camel_case_types,
91 non_snake_case,
92 clippy::pub_underscore_fields,
93 clippy::style,
94 clippy::empty_structs_with_brackets
95)]
96pub mod ERC1967Proxy {
97 use alloy::sol_types as alloy_sol_types;
98
99 use super::*;
100 #[rustfmt::skip]
106 #[allow(clippy::all)]
107 pub static BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
108 b"`\x80`@R`@Qa\x03\xA78\x03\x80a\x03\xA7\x839\x81\x01`@\x81\x90Ra\0\"\x91a\x02<V[a\0,\x82\x82a\x003V[PPa\x03!V[a\0<\x82a\0\x91V[`@Q`\x01`\x01`\xA0\x1B\x03\x83\x16\x90\x7F\xBC|\xD7Z \xEE'\xFD\x9A\xDE\xBA\xB3 A\xF7U!M\xBCk\xFF\xA9\x0C\xC0\"[9\xDA.\\-;\x90_\x90\xA2\x80Q\x15a\0\x85Wa\0\x80\x82\x82a\x01\x0CV[PPPV[a\0\x8Da\x01\x7FV[PPV[\x80`\x01`\x01`\xA0\x1B\x03\x16;_\x03a\0\xCBW`@QcL\x9C\x8C\xE3`\xE0\x1B\x81R`\x01`\x01`\xA0\x1B\x03\x82\x16`\x04\x82\x01R`$\x01[`@Q\x80\x91\x03\x90\xFD[\x7F6\x08\x94\xA1;\xA1\xA3!\x06g\xC8(I-\xB9\x8D\xCA> v\xCC75\xA9 \xA3\xCAP]8+\xBC\x80T`\x01`\x01`\xA0\x1B\x03\x19\x16`\x01`\x01`\xA0\x1B\x03\x92\x90\x92\x16\x91\x90\x91\x17\x90UV[``__\x84`\x01`\x01`\xA0\x1B\x03\x16\x84`@Qa\x01(\x91\x90a\x03\x0BV[_`@Q\x80\x83\x03\x81\x85Z\xF4\x91PP=\x80_\x81\x14a\x01`W`@Q\x91P`\x1F\x19`?=\x01\x16\x82\x01`@R=\x82R=_` \x84\x01>a\x01eV[``\x91P[P\x90\x92P\x90Pa\x01v\x85\x83\x83a\x01\xA0V[\x95\x94PPPPPV[4\x15a\x01\x9EW`@Qc\xB3\x98\x97\x9F`\xE0\x1B\x81R`\x04\x01`@Q\x80\x91\x03\x90\xFD[V[``\x82a\x01\xB5Wa\x01\xB0\x82a\x01\xFFV[a\x01\xF8V[\x81Q\x15\x80\x15a\x01\xCCWP`\x01`\x01`\xA0\x1B\x03\x84\x16;\x15[\x15a\x01\xF5W`@Qc\x99\x96\xB3\x15`\xE0\x1B\x81R`\x01`\x01`\xA0\x1B\x03\x85\x16`\x04\x82\x01R`$\x01a\0\xC2V[P\x80[\x93\x92PPPV[\x80Q\x15a\x02\x0FW\x80Q\x80\x82` \x01\xFD[`@Qc\n\x12\xF5!`\xE1\x1B\x81R`\x04\x01`@Q\x80\x91\x03\x90\xFD[cNH{q`\xE0\x1B_R`A`\x04R`$_\xFD[__`@\x83\x85\x03\x12\x15a\x02MW__\xFD[\x82Q`\x01`\x01`\xA0\x1B\x03\x81\x16\x81\x14a\x02cW__\xFD[` \x84\x01Q\x90\x92P`\x01`\x01`@\x1B\x03\x81\x11\x15a\x02~W__\xFD[\x83\x01`\x1F\x81\x01\x85\x13a\x02\x8EW__\xFD[\x80Q`\x01`\x01`@\x1B\x03\x81\x11\x15a\x02\xA7Wa\x02\xA7a\x02(V[`@Q`\x1F\x82\x01`\x1F\x19\x90\x81\x16`?\x01\x16\x81\x01`\x01`\x01`@\x1B\x03\x81\x11\x82\x82\x10\x17\x15a\x02\xD5Wa\x02\xD5a\x02(V[`@R\x81\x81R\x82\x82\x01` \x01\x87\x10\x15a\x02\xECW__\xFD[\x81` \x84\x01` \x83\x01^_` \x83\x83\x01\x01R\x80\x93PPPP\x92P\x92\x90PV[_\x82Q\x80` \x85\x01\x84^_\x92\x01\x91\x82RP\x91\x90PV[`z\x80a\x03-_9_\xF3\xFE`\x80`@R`\n`\x0CV[\0[`\x18`\x14`\x1AV[`PV[V[_`K\x7F6\x08\x94\xA1;\xA1\xA3!\x06g\xC8(I-\xB9\x8D\xCA> v\xCC75\xA9 \xA3\xCAP]8+\xBCT`\x01`\x01`\xA0\x1B\x03\x16\x90V[\x90P\x90V[6__7__6_\x84Z\xF4=__>\x80\x80\x15`iW=_\xF3[=_\xFD\xFE\xA1dsolcC\0\x08\x1C\0\n",
109 );
110 #[rustfmt::skip]
116 #[allow(clippy::all)]
117 pub static DEPLOYED_BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
118 b"`\x80`@R`\n`\x0CV[\0[`\x18`\x14`\x1AV[`PV[V[_`K\x7F6\x08\x94\xA1;\xA1\xA3!\x06g\xC8(I-\xB9\x8D\xCA> v\xCC75\xA9 \xA3\xCAP]8+\xBCT`\x01`\x01`\xA0\x1B\x03\x16\x90V[\x90P\x90V[6__7__6_\x84Z\xF4=__>\x80\x80\x15`iW=_\xF3[=_\xFD\xFE\xA1dsolcC\0\x08\x1C\0\n",
119 );
120 #[derive(Default, Debug, PartialEq, Eq, Hash)]
121 #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
126 #[derive(Clone)]
127 pub struct AddressEmptyCode {
128 #[allow(missing_docs)]
129 pub target: alloy::sol_types::private::Address,
130 }
131 #[allow(
132 non_camel_case_types,
133 non_snake_case,
134 clippy::pub_underscore_fields,
135 clippy::style
136 )]
137 const _: () = {
138 use alloy::sol_types as alloy_sol_types;
139 #[doc(hidden)]
140 type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::Address,);
141 #[doc(hidden)]
142 type UnderlyingRustTuple<'a> = (alloy::sol_types::private::Address,);
143 #[cfg(test)]
144 #[allow(dead_code, unreachable_patterns)]
145 fn _type_assertion(_t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>) {
146 match _t {
147 alloy_sol_types::private::AssertTypeEq::<
148 <UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
149 >(_) => {},
150 }
151 }
152 #[automatically_derived]
153 #[doc(hidden)]
154 impl ::core::convert::From<AddressEmptyCode> for UnderlyingRustTuple<'_> {
155 fn from(value: AddressEmptyCode) -> Self {
156 (value.target,)
157 }
158 }
159 #[automatically_derived]
160 #[doc(hidden)]
161 impl ::core::convert::From<UnderlyingRustTuple<'_>> for AddressEmptyCode {
162 fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
163 Self { target: tuple.0 }
164 }
165 }
166 #[automatically_derived]
167 impl alloy_sol_types::SolError for AddressEmptyCode {
168 type Parameters<'a> = UnderlyingSolTuple<'a>;
169 type Token<'a> = <Self::Parameters<'a> as alloy_sol_types::SolType>::Token<'a>;
170 const SIGNATURE: &'static str = "AddressEmptyCode(address)";
171 const SELECTOR: [u8; 4] = [153u8, 150u8, 179u8, 21u8];
172 #[inline]
173 fn new<'a>(
174 tuple: <Self::Parameters<'a> as alloy_sol_types::SolType>::RustType,
175 ) -> Self {
176 tuple.into()
177 }
178 #[inline]
179 fn tokenize(&self) -> Self::Token<'_> {
180 (
181 <alloy::sol_types::sol_data::Address as alloy_sol_types::SolType>::tokenize(
182 &self.target,
183 ),
184 )
185 }
186 }
187 };
188 #[derive(Default, Debug, PartialEq, Eq, Hash)]
189 #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
194 #[derive(Clone)]
195 pub struct ERC1967InvalidImplementation {
196 #[allow(missing_docs)]
197 pub implementation: alloy::sol_types::private::Address,
198 }
199 #[allow(
200 non_camel_case_types,
201 non_snake_case,
202 clippy::pub_underscore_fields,
203 clippy::style
204 )]
205 const _: () = {
206 use alloy::sol_types as alloy_sol_types;
207 #[doc(hidden)]
208 type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::Address,);
209 #[doc(hidden)]
210 type UnderlyingRustTuple<'a> = (alloy::sol_types::private::Address,);
211 #[cfg(test)]
212 #[allow(dead_code, unreachable_patterns)]
213 fn _type_assertion(_t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>) {
214 match _t {
215 alloy_sol_types::private::AssertTypeEq::<
216 <UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
217 >(_) => {},
218 }
219 }
220 #[automatically_derived]
221 #[doc(hidden)]
222 impl ::core::convert::From<ERC1967InvalidImplementation> for UnderlyingRustTuple<'_> {
223 fn from(value: ERC1967InvalidImplementation) -> Self {
224 (value.implementation,)
225 }
226 }
227 #[automatically_derived]
228 #[doc(hidden)]
229 impl ::core::convert::From<UnderlyingRustTuple<'_>> for ERC1967InvalidImplementation {
230 fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
231 Self {
232 implementation: tuple.0,
233 }
234 }
235 }
236 #[automatically_derived]
237 impl alloy_sol_types::SolError for ERC1967InvalidImplementation {
238 type Parameters<'a> = UnderlyingSolTuple<'a>;
239 type Token<'a> = <Self::Parameters<'a> as alloy_sol_types::SolType>::Token<'a>;
240 const SIGNATURE: &'static str = "ERC1967InvalidImplementation(address)";
241 const SELECTOR: [u8; 4] = [76u8, 156u8, 140u8, 227u8];
242 #[inline]
243 fn new<'a>(
244 tuple: <Self::Parameters<'a> as alloy_sol_types::SolType>::RustType,
245 ) -> Self {
246 tuple.into()
247 }
248 #[inline]
249 fn tokenize(&self) -> Self::Token<'_> {
250 (
251 <alloy::sol_types::sol_data::Address as alloy_sol_types::SolType>::tokenize(
252 &self.implementation,
253 ),
254 )
255 }
256 }
257 };
258 #[derive(Default, Debug, PartialEq, Eq, Hash)]
259 #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
264 #[derive(Clone)]
265 pub struct ERC1967NonPayable {}
266 #[allow(
267 non_camel_case_types,
268 non_snake_case,
269 clippy::pub_underscore_fields,
270 clippy::style
271 )]
272 const _: () = {
273 use alloy::sol_types as alloy_sol_types;
274 #[doc(hidden)]
275 type UnderlyingSolTuple<'a> = ();
276 #[doc(hidden)]
277 type UnderlyingRustTuple<'a> = ();
278 #[cfg(test)]
279 #[allow(dead_code, unreachable_patterns)]
280 fn _type_assertion(_t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>) {
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<ERC1967NonPayable> for UnderlyingRustTuple<'_> {
290 fn from(value: ERC1967NonPayable) -> Self {
291 ()
292 }
293 }
294 #[automatically_derived]
295 #[doc(hidden)]
296 impl ::core::convert::From<UnderlyingRustTuple<'_>> for ERC1967NonPayable {
297 fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
298 Self {}
299 }
300 }
301 #[automatically_derived]
302 impl alloy_sol_types::SolError for ERC1967NonPayable {
303 type Parameters<'a> = UnderlyingSolTuple<'a>;
304 type Token<'a> = <Self::Parameters<'a> as alloy_sol_types::SolType>::Token<'a>;
305 const SIGNATURE: &'static str = "ERC1967NonPayable()";
306 const SELECTOR: [u8; 4] = [179u8, 152u8, 151u8, 159u8];
307 #[inline]
308 fn new<'a>(
309 tuple: <Self::Parameters<'a> as alloy_sol_types::SolType>::RustType,
310 ) -> Self {
311 tuple.into()
312 }
313 #[inline]
314 fn tokenize(&self) -> Self::Token<'_> {
315 ()
316 }
317 }
318 };
319 #[derive(Default, Debug, PartialEq, Eq, Hash)]
320 #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
325 #[derive(Clone)]
326 pub struct FailedInnerCall {}
327 #[allow(
328 non_camel_case_types,
329 non_snake_case,
330 clippy::pub_underscore_fields,
331 clippy::style
332 )]
333 const _: () = {
334 use alloy::sol_types as alloy_sol_types;
335 #[doc(hidden)]
336 type UnderlyingSolTuple<'a> = ();
337 #[doc(hidden)]
338 type UnderlyingRustTuple<'a> = ();
339 #[cfg(test)]
340 #[allow(dead_code, unreachable_patterns)]
341 fn _type_assertion(_t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>) {
342 match _t {
343 alloy_sol_types::private::AssertTypeEq::<
344 <UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
345 >(_) => {},
346 }
347 }
348 #[automatically_derived]
349 #[doc(hidden)]
350 impl ::core::convert::From<FailedInnerCall> for UnderlyingRustTuple<'_> {
351 fn from(value: FailedInnerCall) -> Self {
352 ()
353 }
354 }
355 #[automatically_derived]
356 #[doc(hidden)]
357 impl ::core::convert::From<UnderlyingRustTuple<'_>> for FailedInnerCall {
358 fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
359 Self {}
360 }
361 }
362 #[automatically_derived]
363 impl alloy_sol_types::SolError for FailedInnerCall {
364 type Parameters<'a> = UnderlyingSolTuple<'a>;
365 type Token<'a> = <Self::Parameters<'a> as alloy_sol_types::SolType>::Token<'a>;
366 const SIGNATURE: &'static str = "FailedInnerCall()";
367 const SELECTOR: [u8; 4] = [20u8, 37u8, 234u8, 66u8];
368 #[inline]
369 fn new<'a>(
370 tuple: <Self::Parameters<'a> as alloy_sol_types::SolType>::RustType,
371 ) -> Self {
372 tuple.into()
373 }
374 #[inline]
375 fn tokenize(&self) -> Self::Token<'_> {
376 ()
377 }
378 }
379 };
380 #[derive(Default, Debug, PartialEq, Eq, Hash)]
381 #[allow(
386 non_camel_case_types,
387 non_snake_case,
388 clippy::pub_underscore_fields,
389 clippy::style
390 )]
391 #[derive(Clone)]
392 pub struct Upgraded {
393 #[allow(missing_docs)]
394 pub implementation: alloy::sol_types::private::Address,
395 }
396 #[allow(
397 non_camel_case_types,
398 non_snake_case,
399 clippy::pub_underscore_fields,
400 clippy::style
401 )]
402 const _: () = {
403 use alloy::sol_types as alloy_sol_types;
404 #[automatically_derived]
405 impl alloy_sol_types::SolEvent for Upgraded {
406 type DataTuple<'a> = ();
407 type DataToken<'a> = <Self::DataTuple<'a> as alloy_sol_types::SolType>::Token<'a>;
408 type TopicList = (
409 alloy_sol_types::sol_data::FixedBytes<32>,
410 alloy::sol_types::sol_data::Address,
411 );
412 const SIGNATURE: &'static str = "Upgraded(address)";
413 const SIGNATURE_HASH: alloy_sol_types::private::B256 =
414 alloy_sol_types::private::B256::new([
415 188u8, 124u8, 215u8, 90u8, 32u8, 238u8, 39u8, 253u8, 154u8, 222u8, 186u8,
416 179u8, 32u8, 65u8, 247u8, 85u8, 33u8, 77u8, 188u8, 107u8, 255u8, 169u8, 12u8,
417 192u8, 34u8, 91u8, 57u8, 218u8, 46u8, 92u8, 45u8, 59u8,
418 ]);
419 const ANONYMOUS: bool = false;
420 #[allow(unused_variables)]
421 #[inline]
422 fn new(
423 topics: <Self::TopicList as alloy_sol_types::SolType>::RustType,
424 data: <Self::DataTuple<'_> as alloy_sol_types::SolType>::RustType,
425 ) -> Self {
426 Self {
427 implementation: topics.1,
428 }
429 }
430 #[inline]
431 fn check_signature(
432 topics: &<Self::TopicList as alloy_sol_types::SolType>::RustType,
433 ) -> alloy_sol_types::Result<()> {
434 if topics.0 != Self::SIGNATURE_HASH {
435 return Err(alloy_sol_types::Error::invalid_event_signature_hash(
436 Self::SIGNATURE,
437 topics.0,
438 Self::SIGNATURE_HASH,
439 ));
440 }
441 Ok(())
442 }
443 #[inline]
444 fn tokenize_body(&self) -> Self::DataToken<'_> {
445 ()
446 }
447 #[inline]
448 fn topics(&self) -> <Self::TopicList as alloy_sol_types::SolType>::RustType {
449 (Self::SIGNATURE_HASH.into(), self.implementation.clone())
450 }
451 #[inline]
452 fn encode_topics_raw(
453 &self,
454 out: &mut [alloy_sol_types::abi::token::WordToken],
455 ) -> alloy_sol_types::Result<()> {
456 if out.len() < <Self::TopicList as alloy_sol_types::TopicList>::COUNT {
457 return Err(alloy_sol_types::Error::Overrun);
458 }
459 out[0usize] = alloy_sol_types::abi::token::WordToken(Self::SIGNATURE_HASH);
460 out[1usize] = <alloy::sol_types::sol_data::Address as alloy_sol_types::EventTopic>::encode_topic(
461 &self.implementation,
462 );
463 Ok(())
464 }
465 }
466 #[automatically_derived]
467 impl alloy_sol_types::private::IntoLogData for Upgraded {
468 fn to_log_data(&self) -> alloy_sol_types::private::LogData {
469 From::from(self)
470 }
471 fn into_log_data(self) -> alloy_sol_types::private::LogData {
472 From::from(&self)
473 }
474 }
475 #[automatically_derived]
476 impl From<&Upgraded> for alloy_sol_types::private::LogData {
477 #[inline]
478 fn from(this: &Upgraded) -> alloy_sol_types::private::LogData {
479 alloy_sol_types::SolEvent::encode_log_data(this)
480 }
481 }
482 };
483 #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
488 #[derive(Clone)]
489 pub struct constructorCall {
490 #[allow(missing_docs)]
491 pub implementation: alloy::sol_types::private::Address,
492 #[allow(missing_docs)]
493 pub _data: alloy::sol_types::private::Bytes,
494 }
495 const _: () = {
496 use alloy::sol_types as alloy_sol_types;
497 {
498 #[doc(hidden)]
499 type UnderlyingSolTuple<'a> = (
500 alloy::sol_types::sol_data::Address,
501 alloy::sol_types::sol_data::Bytes,
502 );
503 #[doc(hidden)]
504 type UnderlyingRustTuple<'a> = (
505 alloy::sol_types::private::Address,
506 alloy::sol_types::private::Bytes,
507 );
508 #[cfg(test)]
509 #[allow(dead_code, unreachable_patterns)]
510 fn _type_assertion(_t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>) {
511 match _t {
512 alloy_sol_types::private::AssertTypeEq::<
513 <UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
514 >(_) => {},
515 }
516 }
517 #[automatically_derived]
518 #[doc(hidden)]
519 impl ::core::convert::From<constructorCall> for UnderlyingRustTuple<'_> {
520 fn from(value: constructorCall) -> Self {
521 (value.implementation, value._data)
522 }
523 }
524 #[automatically_derived]
525 #[doc(hidden)]
526 impl ::core::convert::From<UnderlyingRustTuple<'_>> for constructorCall {
527 fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
528 Self {
529 implementation: tuple.0,
530 _data: tuple.1,
531 }
532 }
533 }
534 }
535 #[automatically_derived]
536 impl alloy_sol_types::SolConstructor for constructorCall {
537 type Parameters<'a> = (
538 alloy::sol_types::sol_data::Address,
539 alloy::sol_types::sol_data::Bytes,
540 );
541 type Token<'a> = <Self::Parameters<'a> as alloy_sol_types::SolType>::Token<'a>;
542 #[inline]
543 fn new<'a>(
544 tuple: <Self::Parameters<'a> as alloy_sol_types::SolType>::RustType,
545 ) -> Self {
546 tuple.into()
547 }
548 #[inline]
549 fn tokenize(&self) -> Self::Token<'_> {
550 (
551 <alloy::sol_types::sol_data::Address as alloy_sol_types::SolType>::tokenize(
552 &self.implementation,
553 ),
554 <alloy::sol_types::sol_data::Bytes as alloy_sol_types::SolType>::tokenize(
555 &self._data,
556 ),
557 )
558 }
559 }
560 };
561 #[derive(Debug, PartialEq, Eq, Hash)]
563 pub enum ERC1967ProxyErrors {
564 #[allow(missing_docs)]
565 AddressEmptyCode(AddressEmptyCode),
566 #[allow(missing_docs)]
567 ERC1967InvalidImplementation(ERC1967InvalidImplementation),
568 #[allow(missing_docs)]
569 ERC1967NonPayable(ERC1967NonPayable),
570 #[allow(missing_docs)]
571 FailedInnerCall(FailedInnerCall),
572 }
573 #[automatically_derived]
574 impl ERC1967ProxyErrors {
575 pub const SELECTORS: &'static [[u8; 4usize]] = &[
582 [20u8, 37u8, 234u8, 66u8],
583 [76u8, 156u8, 140u8, 227u8],
584 [153u8, 150u8, 179u8, 21u8],
585 [179u8, 152u8, 151u8, 159u8],
586 ];
587 }
588 #[automatically_derived]
589 impl alloy_sol_types::SolInterface for ERC1967ProxyErrors {
590 const NAME: &'static str = "ERC1967ProxyErrors";
591 const MIN_DATA_LENGTH: usize = 0usize;
592 const COUNT: usize = 4usize;
593 #[inline]
594 fn selector(&self) -> [u8; 4] {
595 match self {
596 Self::AddressEmptyCode(_) => {
597 <AddressEmptyCode as alloy_sol_types::SolError>::SELECTOR
598 },
599 Self::ERC1967InvalidImplementation(_) => {
600 <ERC1967InvalidImplementation as alloy_sol_types::SolError>::SELECTOR
601 },
602 Self::ERC1967NonPayable(_) => {
603 <ERC1967NonPayable as alloy_sol_types::SolError>::SELECTOR
604 },
605 Self::FailedInnerCall(_) => {
606 <FailedInnerCall as alloy_sol_types::SolError>::SELECTOR
607 },
608 }
609 }
610 #[inline]
611 fn selector_at(i: usize) -> ::core::option::Option<[u8; 4]> {
612 Self::SELECTORS.get(i).copied()
613 }
614 #[inline]
615 fn valid_selector(selector: [u8; 4]) -> bool {
616 Self::SELECTORS.binary_search(&selector).is_ok()
617 }
618 #[inline]
619 #[allow(non_snake_case)]
620 fn abi_decode_raw(
621 selector: [u8; 4],
622 data: &[u8],
623 validate: bool,
624 ) -> alloy_sol_types::Result<Self> {
625 static DECODE_SHIMS: &[fn(
626 &[u8],
627 bool,
628 )
629 -> alloy_sol_types::Result<ERC1967ProxyErrors>] = &[
630 {
631 fn FailedInnerCall(
632 data: &[u8],
633 validate: bool,
634 ) -> alloy_sol_types::Result<ERC1967ProxyErrors> {
635 <FailedInnerCall as alloy_sol_types::SolError>::abi_decode_raw(
636 data, validate,
637 )
638 .map(ERC1967ProxyErrors::FailedInnerCall)
639 }
640 FailedInnerCall
641 },
642 {
643 fn ERC1967InvalidImplementation(
644 data: &[u8],
645 validate: bool,
646 ) -> alloy_sol_types::Result<ERC1967ProxyErrors> {
647 <ERC1967InvalidImplementation as alloy_sol_types::SolError>::abi_decode_raw(
648 data, validate,
649 )
650 .map(ERC1967ProxyErrors::ERC1967InvalidImplementation)
651 }
652 ERC1967InvalidImplementation
653 },
654 {
655 fn AddressEmptyCode(
656 data: &[u8],
657 validate: bool,
658 ) -> alloy_sol_types::Result<ERC1967ProxyErrors> {
659 <AddressEmptyCode as alloy_sol_types::SolError>::abi_decode_raw(
660 data, validate,
661 )
662 .map(ERC1967ProxyErrors::AddressEmptyCode)
663 }
664 AddressEmptyCode
665 },
666 {
667 fn ERC1967NonPayable(
668 data: &[u8],
669 validate: bool,
670 ) -> alloy_sol_types::Result<ERC1967ProxyErrors> {
671 <ERC1967NonPayable as alloy_sol_types::SolError>::abi_decode_raw(
672 data, validate,
673 )
674 .map(ERC1967ProxyErrors::ERC1967NonPayable)
675 }
676 ERC1967NonPayable
677 },
678 ];
679 let Ok(idx) = Self::SELECTORS.binary_search(&selector) else {
680 return Err(alloy_sol_types::Error::unknown_selector(
681 <Self as alloy_sol_types::SolInterface>::NAME,
682 selector,
683 ));
684 };
685 DECODE_SHIMS[idx](data, validate)
686 }
687 #[inline]
688 fn abi_encoded_size(&self) -> usize {
689 match self {
690 Self::AddressEmptyCode(inner) => {
691 <AddressEmptyCode as alloy_sol_types::SolError>::abi_encoded_size(inner)
692 },
693 Self::ERC1967InvalidImplementation(inner) => {
694 <ERC1967InvalidImplementation as alloy_sol_types::SolError>::abi_encoded_size(
695 inner,
696 )
697 },
698 Self::ERC1967NonPayable(inner) => {
699 <ERC1967NonPayable as alloy_sol_types::SolError>::abi_encoded_size(inner)
700 },
701 Self::FailedInnerCall(inner) => {
702 <FailedInnerCall as alloy_sol_types::SolError>::abi_encoded_size(inner)
703 },
704 }
705 }
706 #[inline]
707 fn abi_encode_raw(&self, out: &mut alloy_sol_types::private::Vec<u8>) {
708 match self {
709 Self::AddressEmptyCode(inner) => {
710 <AddressEmptyCode as alloy_sol_types::SolError>::abi_encode_raw(inner, out)
711 },
712 Self::ERC1967InvalidImplementation(inner) => {
713 <ERC1967InvalidImplementation as alloy_sol_types::SolError>::abi_encode_raw(
714 inner, out,
715 )
716 },
717 Self::ERC1967NonPayable(inner) => {
718 <ERC1967NonPayable as alloy_sol_types::SolError>::abi_encode_raw(inner, out)
719 },
720 Self::FailedInnerCall(inner) => {
721 <FailedInnerCall as alloy_sol_types::SolError>::abi_encode_raw(inner, out)
722 },
723 }
724 }
725 }
726 #[derive(Debug, PartialEq, Eq, Hash)]
728 pub enum ERC1967ProxyEvents {
729 #[allow(missing_docs)]
730 Upgraded(Upgraded),
731 }
732 #[automatically_derived]
733 impl ERC1967ProxyEvents {
734 pub const SELECTORS: &'static [[u8; 32usize]] = &[[
741 188u8, 124u8, 215u8, 90u8, 32u8, 238u8, 39u8, 253u8, 154u8, 222u8, 186u8, 179u8, 32u8,
742 65u8, 247u8, 85u8, 33u8, 77u8, 188u8, 107u8, 255u8, 169u8, 12u8, 192u8, 34u8, 91u8,
743 57u8, 218u8, 46u8, 92u8, 45u8, 59u8,
744 ]];
745 }
746 #[automatically_derived]
747 impl alloy_sol_types::SolEventInterface for ERC1967ProxyEvents {
748 const NAME: &'static str = "ERC1967ProxyEvents";
749 const COUNT: usize = 1usize;
750 fn decode_raw_log(
751 topics: &[alloy_sol_types::Word],
752 data: &[u8],
753 validate: bool,
754 ) -> alloy_sol_types::Result<Self> {
755 match topics.first().copied() {
756 Some(<Upgraded as alloy_sol_types::SolEvent>::SIGNATURE_HASH) => {
757 <Upgraded as alloy_sol_types::SolEvent>::decode_raw_log(topics, data, validate)
758 .map(Self::Upgraded)
759 },
760 _ => alloy_sol_types::private::Err(alloy_sol_types::Error::InvalidLog {
761 name: <Self as alloy_sol_types::SolEventInterface>::NAME,
762 log: alloy_sol_types::private::Box::new(
763 alloy_sol_types::private::LogData::new_unchecked(
764 topics.to_vec(),
765 data.to_vec().into(),
766 ),
767 ),
768 }),
769 }
770 }
771 }
772 #[automatically_derived]
773 impl alloy_sol_types::private::IntoLogData for ERC1967ProxyEvents {
774 fn to_log_data(&self) -> alloy_sol_types::private::LogData {
775 match self {
776 Self::Upgraded(inner) => alloy_sol_types::private::IntoLogData::to_log_data(inner),
777 }
778 }
779 fn into_log_data(self) -> alloy_sol_types::private::LogData {
780 match self {
781 Self::Upgraded(inner) => {
782 alloy_sol_types::private::IntoLogData::into_log_data(inner)
783 },
784 }
785 }
786 }
787 use alloy::contract as alloy_contract;
788 #[inline]
792 pub const fn new<
793 T: alloy_contract::private::Transport + ::core::clone::Clone,
794 P: alloy_contract::private::Provider<T, N>,
795 N: alloy_contract::private::Network,
796 >(
797 address: alloy_sol_types::private::Address,
798 provider: P,
799 ) -> ERC1967ProxyInstance<T, P, N> {
800 ERC1967ProxyInstance::<T, P, N>::new(address, provider)
801 }
802 #[inline]
808 pub fn deploy<
809 T: alloy_contract::private::Transport + ::core::clone::Clone,
810 P: alloy_contract::private::Provider<T, N>,
811 N: alloy_contract::private::Network,
812 >(
813 provider: P,
814 implementation: alloy::sol_types::private::Address,
815 _data: alloy::sol_types::private::Bytes,
816 ) -> impl ::core::future::Future<Output = alloy_contract::Result<ERC1967ProxyInstance<T, P, N>>>
817 {
818 ERC1967ProxyInstance::<T, P, N>::deploy(provider, implementation, _data)
819 }
820 #[inline]
826 pub fn deploy_builder<
827 T: alloy_contract::private::Transport + ::core::clone::Clone,
828 P: alloy_contract::private::Provider<T, N>,
829 N: alloy_contract::private::Network,
830 >(
831 provider: P,
832 implementation: alloy::sol_types::private::Address,
833 _data: alloy::sol_types::private::Bytes,
834 ) -> alloy_contract::RawCallBuilder<T, P, N> {
835 ERC1967ProxyInstance::<T, P, N>::deploy_builder(provider, implementation, _data)
836 }
837 #[derive(Clone)]
849 pub struct ERC1967ProxyInstance<T, P, N = alloy_contract::private::Ethereum> {
850 address: alloy_sol_types::private::Address,
851 provider: P,
852 _network_transport: ::core::marker::PhantomData<(N, T)>,
853 }
854 #[automatically_derived]
855 impl<T, P, N> ::core::fmt::Debug for ERC1967ProxyInstance<T, P, N> {
856 #[inline]
857 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
858 f.debug_tuple("ERC1967ProxyInstance")
859 .field(&self.address)
860 .finish()
861 }
862 }
863 #[automatically_derived]
865 impl<
866 T: alloy_contract::private::Transport + ::core::clone::Clone,
867 P: alloy_contract::private::Provider<T, N>,
868 N: alloy_contract::private::Network,
869 > ERC1967ProxyInstance<T, P, N>
870 {
871 #[inline]
875 pub const fn new(address: alloy_sol_types::private::Address, provider: P) -> Self {
876 Self {
877 address,
878 provider,
879 _network_transport: ::core::marker::PhantomData,
880 }
881 }
882 #[inline]
888 pub async fn deploy(
889 provider: P,
890 implementation: alloy::sol_types::private::Address,
891 _data: alloy::sol_types::private::Bytes,
892 ) -> alloy_contract::Result<ERC1967ProxyInstance<T, P, N>> {
893 let call_builder = Self::deploy_builder(provider, implementation, _data);
894 let contract_address = call_builder.deploy().await?;
895 Ok(Self::new(contract_address, call_builder.provider))
896 }
897 #[inline]
903 pub fn deploy_builder(
904 provider: P,
905 implementation: alloy::sol_types::private::Address,
906 _data: alloy::sol_types::private::Bytes,
907 ) -> alloy_contract::RawCallBuilder<T, P, N> {
908 alloy_contract::RawCallBuilder::new_raw_deploy(
909 provider,
910 [
911 &BYTECODE[..],
912 &alloy_sol_types::SolConstructor::abi_encode(&constructorCall {
913 implementation,
914 _data,
915 })[..],
916 ]
917 .concat()
918 .into(),
919 )
920 }
921 #[inline]
923 pub const fn address(&self) -> &alloy_sol_types::private::Address {
924 &self.address
925 }
926 #[inline]
928 pub fn set_address(&mut self, address: alloy_sol_types::private::Address) {
929 self.address = address;
930 }
931 pub fn at(mut self, address: alloy_sol_types::private::Address) -> Self {
933 self.set_address(address);
934 self
935 }
936 #[inline]
938 pub const fn provider(&self) -> &P {
939 &self.provider
940 }
941 }
942 impl<T, P: ::core::clone::Clone, N> ERC1967ProxyInstance<T, &P, N> {
943 #[inline]
945 pub fn with_cloned_provider(self) -> ERC1967ProxyInstance<T, P, N> {
946 ERC1967ProxyInstance {
947 address: self.address,
948 provider: ::core::clone::Clone::clone(&self.provider),
949 _network_transport: ::core::marker::PhantomData,
950 }
951 }
952 }
953 #[automatically_derived]
955 impl<
956 T: alloy_contract::private::Transport + ::core::clone::Clone,
957 P: alloy_contract::private::Provider<T, N>,
958 N: alloy_contract::private::Network,
959 > ERC1967ProxyInstance<T, P, N>
960 {
961 pub fn call_builder<C: alloy_sol_types::SolCall>(
966 &self,
967 call: &C,
968 ) -> alloy_contract::SolCallBuilder<T, &P, C, N> {
969 alloy_contract::SolCallBuilder::new_sol(&self.provider, &self.address, call)
970 }
971 }
972 #[automatically_derived]
974 impl<
975 T: alloy_contract::private::Transport + ::core::clone::Clone,
976 P: alloy_contract::private::Provider<T, N>,
977 N: alloy_contract::private::Network,
978 > ERC1967ProxyInstance<T, P, N>
979 {
980 pub fn event_filter<E: alloy_sol_types::SolEvent>(
985 &self,
986 ) -> alloy_contract::Event<T, &P, E, N> {
987 alloy_contract::Event::new_sol(&self.provider, &self.address)
988 }
989 pub fn Upgraded_filter(&self) -> alloy_contract::Event<T, &P, Upgraded, N> {
991 self.event_filter::<Upgraded>()
992 }
993 }
994}