cartesi_rollups_contracts/
create2.rs1#[allow(
21 non_camel_case_types,
22 non_snake_case,
23 clippy::pub_underscore_fields,
24 clippy::style,
25 clippy::empty_structs_with_brackets
26)]
27pub mod Create2 {
28 use super::*;
29 use alloy::sol_types as alloy_sol_types;
30 #[rustfmt::skip]
36 #[allow(clippy::all)]
37 pub static BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
38 b"`\x80\x80`@R4`\x17W`9\x90\x81`\x1C\x8290\x81PP\xF3[_\x80\xFD\xFE_\x80\xFD\xFE\xA2dipfsX\"\x12 O3\x94r{9d\x0E\x08%\0}\xE9N\xFA\xE0\xC5\xD0\x13wd\xE7l\x05\x87\xAB&]\xFD\xDB\xF3\xBCdsolcC\0\x08\x1E\x003",
39 );
40 #[rustfmt::skip]
46 #[allow(clippy::all)]
47 pub static DEPLOYED_BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
48 b"_\x80\xFD\xFE\xA2dipfsX\"\x12 O3\x94r{9d\x0E\x08%\0}\xE9N\xFA\xE0\xC5\xD0\x13wd\xE7l\x05\x87\xAB&]\xFD\xDB\xF3\xBCdsolcC\0\x08\x1E\x003",
49 );
50 #[derive(serde::Serialize, serde::Deserialize)]
51 #[derive(Default, Debug, PartialEq, Eq, Hash)]
52 #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
57 #[derive(Clone)]
58 pub struct Create2EmptyBytecode;
59 #[allow(
60 non_camel_case_types,
61 non_snake_case,
62 clippy::pub_underscore_fields,
63 clippy::style
64 )]
65 const _: () = {
66 use alloy::sol_types as alloy_sol_types;
67 #[doc(hidden)]
68 #[allow(dead_code)]
69 type UnderlyingSolTuple<'a> = ();
70 #[doc(hidden)]
71 type UnderlyingRustTuple<'a> = ();
72 #[cfg(test)]
73 #[allow(dead_code, unreachable_patterns)]
74 fn _type_assertion(
75 _t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>,
76 ) {
77 match _t {
78 alloy_sol_types::private::AssertTypeEq::<
79 <UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
80 >(_) => {}
81 }
82 }
83 #[automatically_derived]
84 #[doc(hidden)]
85 impl ::core::convert::From<Create2EmptyBytecode> for UnderlyingRustTuple<'_> {
86 fn from(value: Create2EmptyBytecode) -> Self {
87 ()
88 }
89 }
90 #[automatically_derived]
91 #[doc(hidden)]
92 impl ::core::convert::From<UnderlyingRustTuple<'_>> for Create2EmptyBytecode {
93 fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
94 Self
95 }
96 }
97 #[automatically_derived]
98 impl alloy_sol_types::SolError for Create2EmptyBytecode {
99 type Parameters<'a> = UnderlyingSolTuple<'a>;
100 type Token<'a> = <Self::Parameters<
101 'a,
102 > as alloy_sol_types::SolType>::Token<'a>;
103 const SIGNATURE: &'static str = "Create2EmptyBytecode()";
104 const SELECTOR: [u8; 4] = [76u8, 162u8, 73u8, 220u8];
105 #[inline]
106 fn new<'a>(
107 tuple: <Self::Parameters<'a> as alloy_sol_types::SolType>::RustType,
108 ) -> Self {
109 tuple.into()
110 }
111 #[inline]
112 fn tokenize(&self) -> Self::Token<'_> {
113 ()
114 }
115 #[inline]
116 fn abi_decode_raw_validate(data: &[u8]) -> alloy_sol_types::Result<Self> {
117 <Self::Parameters<
118 '_,
119 > as alloy_sol_types::SolType>::abi_decode_sequence_validate(data)
120 .map(Self::new)
121 }
122 }
123 };
124 #[derive(Clone)]
126 #[derive(serde::Serialize, serde::Deserialize)]
127 #[derive(Debug, PartialEq, Eq, Hash)]
128 pub enum Create2Errors {
129 #[allow(missing_docs)]
130 Create2EmptyBytecode(Create2EmptyBytecode),
131 }
132 impl Create2Errors {
133 pub const SELECTORS: &'static [[u8; 4usize]] = &[[76u8, 162u8, 73u8, 220u8]];
140 pub const VARIANT_NAMES: &'static [&'static str] = &[
142 ::core::stringify!(Create2EmptyBytecode),
143 ];
144 pub const SIGNATURES: &'static [&'static str] = &[
146 <Create2EmptyBytecode as alloy_sol_types::SolError>::SIGNATURE,
147 ];
148 #[inline]
150 pub fn signature_by_selector(
151 selector: [u8; 4usize],
152 ) -> ::core::option::Option<&'static str> {
153 match Self::SELECTORS.binary_search(&selector) {
154 ::core::result::Result::Ok(idx) => {
155 ::core::option::Option::Some(Self::SIGNATURES[idx])
156 }
157 ::core::result::Result::Err(_) => ::core::option::Option::None,
158 }
159 }
160 #[inline]
162 pub fn name_by_selector(
163 selector: [u8; 4usize],
164 ) -> ::core::option::Option<&'static str> {
165 let sig = Self::signature_by_selector(selector)?;
166 sig.split_once('(').map(|(name, _)| name)
167 }
168 }
169 #[automatically_derived]
170 impl alloy_sol_types::SolInterface for Create2Errors {
171 const NAME: &'static str = "Create2Errors";
172 const MIN_DATA_LENGTH: usize = 0usize;
173 const COUNT: usize = 1usize;
174 #[inline]
175 fn selector(&self) -> [u8; 4] {
176 match self {
177 Self::Create2EmptyBytecode(_) => {
178 <Create2EmptyBytecode as alloy_sol_types::SolError>::SELECTOR
179 }
180 }
181 }
182 #[inline]
183 fn selector_at(i: usize) -> ::core::option::Option<[u8; 4]> {
184 Self::SELECTORS.get(i).copied()
185 }
186 #[inline]
187 fn valid_selector(selector: [u8; 4]) -> bool {
188 Self::SELECTORS.binary_search(&selector).is_ok()
189 }
190 #[inline]
191 #[allow(non_snake_case)]
192 fn abi_decode_raw(
193 selector: [u8; 4],
194 data: &[u8],
195 ) -> alloy_sol_types::Result<Self> {
196 static DECODE_SHIMS: &[fn(
197 &[u8],
198 ) -> alloy_sol_types::Result<Create2Errors>] = &[
199 {
200 fn Create2EmptyBytecode(
201 data: &[u8],
202 ) -> alloy_sol_types::Result<Create2Errors> {
203 <Create2EmptyBytecode as alloy_sol_types::SolError>::abi_decode_raw(
204 data,
205 )
206 .map(Create2Errors::Create2EmptyBytecode)
207 }
208 Create2EmptyBytecode
209 },
210 ];
211 let Ok(idx) = Self::SELECTORS.binary_search(&selector) else {
212 return Err(
213 alloy_sol_types::Error::unknown_selector(
214 <Self as alloy_sol_types::SolInterface>::NAME,
215 selector,
216 ),
217 );
218 };
219 DECODE_SHIMS[idx](data)
220 }
221 #[inline]
222 #[allow(non_snake_case)]
223 fn abi_decode_raw_validate(
224 selector: [u8; 4],
225 data: &[u8],
226 ) -> alloy_sol_types::Result<Self> {
227 static DECODE_VALIDATE_SHIMS: &[fn(
228 &[u8],
229 ) -> alloy_sol_types::Result<Create2Errors>] = &[
230 {
231 fn Create2EmptyBytecode(
232 data: &[u8],
233 ) -> alloy_sol_types::Result<Create2Errors> {
234 <Create2EmptyBytecode as alloy_sol_types::SolError>::abi_decode_raw_validate(
235 data,
236 )
237 .map(Create2Errors::Create2EmptyBytecode)
238 }
239 Create2EmptyBytecode
240 },
241 ];
242 let Ok(idx) = Self::SELECTORS.binary_search(&selector) else {
243 return Err(
244 alloy_sol_types::Error::unknown_selector(
245 <Self as alloy_sol_types::SolInterface>::NAME,
246 selector,
247 ),
248 );
249 };
250 DECODE_VALIDATE_SHIMS[idx](data)
251 }
252 #[inline]
253 fn abi_encoded_size(&self) -> usize {
254 match self {
255 Self::Create2EmptyBytecode(inner) => {
256 <Create2EmptyBytecode as alloy_sol_types::SolError>::abi_encoded_size(
257 inner,
258 )
259 }
260 }
261 }
262 #[inline]
263 fn abi_encode_raw(&self, out: &mut alloy_sol_types::private::Vec<u8>) {
264 match self {
265 Self::Create2EmptyBytecode(inner) => {
266 <Create2EmptyBytecode as alloy_sol_types::SolError>::abi_encode_raw(
267 inner,
268 out,
269 )
270 }
271 }
272 }
273 }
274 use alloy::contract as alloy_contract;
275 #[inline]
279 pub const fn new<
280 P: alloy_contract::private::Provider<N>,
281 N: alloy_contract::private::Network,
282 >(
283 address: alloy_sol_types::private::Address,
284 __provider: P,
285 ) -> Create2Instance<P, N> {
286 Create2Instance::<P, N>::new(address, __provider)
287 }
288 #[inline]
294 pub fn deploy<
295 P: alloy_contract::private::Provider<N>,
296 N: alloy_contract::private::Network,
297 >(
298 __provider: P,
299 ) -> impl ::core::future::Future<
300 Output = alloy_contract::Result<Create2Instance<P, N>>,
301 > {
302 Create2Instance::<P, N>::deploy(__provider)
303 }
304 #[inline]
310 pub fn deploy_builder<
311 P: alloy_contract::private::Provider<N>,
312 N: alloy_contract::private::Network,
313 >(__provider: P) -> alloy_contract::RawCallBuilder<P, N> {
314 Create2Instance::<P, N>::deploy_builder(__provider)
315 }
316 #[derive(Clone)]
328 pub struct Create2Instance<P, N = alloy_contract::private::Ethereum> {
329 address: alloy_sol_types::private::Address,
330 provider: P,
331 _network: ::core::marker::PhantomData<N>,
332 }
333 #[automatically_derived]
334 impl<P, N> ::core::fmt::Debug for Create2Instance<P, N> {
335 #[inline]
336 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
337 f.debug_tuple("Create2Instance").field(&self.address).finish()
338 }
339 }
340 impl<
342 P: alloy_contract::private::Provider<N>,
343 N: alloy_contract::private::Network,
344 > Create2Instance<P, N> {
345 #[inline]
349 pub const fn new(
350 address: alloy_sol_types::private::Address,
351 __provider: P,
352 ) -> Self {
353 Self {
354 address,
355 provider: __provider,
356 _network: ::core::marker::PhantomData,
357 }
358 }
359 #[inline]
365 pub async fn deploy(
366 __provider: P,
367 ) -> alloy_contract::Result<Create2Instance<P, N>> {
368 let call_builder = Self::deploy_builder(__provider);
369 let contract_address = call_builder.deploy().await?;
370 Ok(Self::new(contract_address, call_builder.provider))
371 }
372 #[inline]
378 pub fn deploy_builder(__provider: P) -> alloy_contract::RawCallBuilder<P, N> {
379 alloy_contract::RawCallBuilder::new_raw_deploy(
380 __provider,
381 ::core::clone::Clone::clone(&BYTECODE),
382 )
383 }
384 #[inline]
386 pub const fn address(&self) -> &alloy_sol_types::private::Address {
387 &self.address
388 }
389 #[inline]
391 pub fn set_address(&mut self, address: alloy_sol_types::private::Address) {
392 self.address = address;
393 }
394 pub fn at(mut self, address: alloy_sol_types::private::Address) -> Self {
396 self.set_address(address);
397 self
398 }
399 #[inline]
401 pub const fn provider(&self) -> &P {
402 &self.provider
403 }
404 }
405 impl<P: ::core::clone::Clone, N> Create2Instance<&P, N> {
406 #[inline]
408 pub fn with_cloned_provider(self) -> Create2Instance<P, N> {
409 Create2Instance {
410 address: self.address,
411 provider: ::core::clone::Clone::clone(&self.provider),
412 _network: ::core::marker::PhantomData,
413 }
414 }
415 }
416 impl<
418 P: alloy_contract::private::Provider<N>,
419 N: alloy_contract::private::Network,
420 > Create2Instance<P, N> {
421 pub fn call_builder<C: alloy_sol_types::SolCall>(
426 &self,
427 call: &C,
428 ) -> alloy_contract::SolCallBuilder<&P, C, N> {
429 alloy_contract::SolCallBuilder::new_sol(&self.provider, &self.address, call)
430 }
431 }
432 impl<
434 P: alloy_contract::private::Provider<N>,
435 N: alloy_contract::private::Network,
436 > Create2Instance<P, N> {
437 pub fn event_filter<E: alloy_sol_types::SolEvent>(
442 &self,
443 ) -> alloy_contract::Event<&P, E, N> {
444 alloy_contract::Event::new_sol(&self.provider, &self.address)
445 }
446 }
447}