Skip to main content

cartesi_rollups_contracts/
create2.rs

1/**
2
3Generated by the following Solidity interface...
4```solidity
5interface Create2 {
6    error Create2EmptyBytecode();
7}
8```
9
10...which was generated by the following JSON ABI:
11```json
12[
13  {
14    "type": "error",
15    "name": "Create2EmptyBytecode",
16    "inputs": []
17  }
18]
19```*/
20#[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    /// The creation / init bytecode of the contract.
31    ///
32    /// ```text
33    ///0x6080806040523460175760399081601c823930815050f35b5f80fdfe5f80fdfea26469706673582212204f3394727b39640e0825007de94efae0c5d0137764e76c0587ab265dfddbf3bc64736f6c634300081e0033
34    /// ```
35    #[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    /// The runtime bytecode of the contract, as deployed on the network.
41    ///
42    /// ```text
43    ///0x5f80fdfea26469706673582212204f3394727b39640e0825007de94efae0c5d0137764e76c0587ab265dfddbf3bc64736f6c634300081e0033
44    /// ```
45    #[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    /**Custom error with signature `Create2EmptyBytecode()` and selector `0x4ca249dc`.
53```solidity
54error Create2EmptyBytecode();
55```*/
56    #[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    ///Container for all the [`Create2`](self) custom errors.
125    #[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        /// All the selectors of this enum.
134        ///
135        /// Note that the selectors might not be in the same order as the variants.
136        /// No guarantees are made about the order of the selectors.
137        ///
138        /// Prefer using `SolInterface` methods instead.
139        pub const SELECTORS: &'static [[u8; 4usize]] = &[[76u8, 162u8, 73u8, 220u8]];
140        /// The names of the variants in the same order as `SELECTORS`.
141        pub const VARIANT_NAMES: &'static [&'static str] = &[
142            ::core::stringify!(Create2EmptyBytecode),
143        ];
144        /// The signatures in the same order as `SELECTORS`.
145        pub const SIGNATURES: &'static [&'static str] = &[
146            <Create2EmptyBytecode as alloy_sol_types::SolError>::SIGNATURE,
147        ];
148        /// Returns the signature for the given selector, if known.
149        #[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        /// Returns the enum variant name for the given selector, if known.
161        #[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    /**Creates a new wrapper around an on-chain [`Create2`](self) contract instance.
276
277See the [wrapper's documentation](`Create2Instance`) for more details.*/
278    #[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    /**Deploys this contract using the given `provider` and constructor arguments, if any.
289
290Returns a new instance of the contract, if the deployment was successful.
291
292For more fine-grained control over the deployment process, use [`deploy_builder`] instead.*/
293    #[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    /**Creates a `RawCallBuilder` for deploying this contract using the given `provider`
305and constructor arguments, if any.
306
307This is a simple wrapper around creating a `RawCallBuilder` with the data set to
308the bytecode concatenated with the constructor's ABI-encoded arguments.*/
309    #[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    /**A [`Create2`](self) instance.
317
318Contains type-safe methods for interacting with an on-chain instance of the
319[`Create2`](self) contract located at a given `address`, using a given
320provider `P`.
321
322If the contract bytecode is available (see the [`sol!`](alloy_sol_types::sol!)
323documentation on how to provide it), the `deploy` and `deploy_builder` methods can
324be used to deploy a new instance of the contract.
325
326See the [module-level documentation](self) for all the available methods.*/
327    #[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    /// Instantiation and getters/setters.
341    impl<
342        P: alloy_contract::private::Provider<N>,
343        N: alloy_contract::private::Network,
344    > Create2Instance<P, N> {
345        /**Creates a new wrapper around an on-chain [`Create2`](self) contract instance.
346
347See the [wrapper's documentation](`Create2Instance`) for more details.*/
348        #[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        /**Deploys this contract using the given `provider` and constructor arguments, if any.
360
361Returns a new instance of the contract, if the deployment was successful.
362
363For more fine-grained control over the deployment process, use [`deploy_builder`] instead.*/
364        #[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        /**Creates a `RawCallBuilder` for deploying this contract using the given `provider`
373and constructor arguments, if any.
374
375This is a simple wrapper around creating a `RawCallBuilder` with the data set to
376the bytecode concatenated with the constructor's ABI-encoded arguments.*/
377        #[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        /// Returns a reference to the address.
385        #[inline]
386        pub const fn address(&self) -> &alloy_sol_types::private::Address {
387            &self.address
388        }
389        /// Sets the address.
390        #[inline]
391        pub fn set_address(&mut self, address: alloy_sol_types::private::Address) {
392            self.address = address;
393        }
394        /// Sets the address and returns `self`.
395        pub fn at(mut self, address: alloy_sol_types::private::Address) -> Self {
396            self.set_address(address);
397            self
398        }
399        /// Returns a reference to the provider.
400        #[inline]
401        pub const fn provider(&self) -> &P {
402            &self.provider
403        }
404    }
405    impl<P: ::core::clone::Clone, N> Create2Instance<&P, N> {
406        /// Clones the provider and returns a new instance with the cloned provider.
407        #[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    /// Function calls.
417    impl<
418        P: alloy_contract::private::Provider<N>,
419        N: alloy_contract::private::Network,
420    > Create2Instance<P, N> {
421        /// Creates a new call builder using this contract instance's provider and address.
422        ///
423        /// Note that the call can be any function call, not just those defined in this
424        /// contract. Prefer using the other methods for building type-safe contract calls.
425        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    /// Event filters.
433    impl<
434        P: alloy_contract::private::Provider<N>,
435        N: alloy_contract::private::Network,
436    > Create2Instance<P, N> {
437        /// Creates a new event filter using this contract instance's provider and address.
438        ///
439        /// Note that the type can be any event, not just those defined in this contract.
440        /// Prefer using the other methods for building type-safe event filters.
441        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}