Skip to main content

cartesi_rollups_contracts/
error_raiser.rs

1/**
2
3Generated by the following Solidity interface...
4```solidity
5interface ErrorRaiser {
6    function raise(bytes memory error) external pure;
7}
8```
9
10...which was generated by the following JSON ABI:
11```json
12[
13  {
14    "type": "function",
15    "name": "raise",
16    "inputs": [
17      {
18        "name": "error",
19        "type": "bytes",
20        "internalType": "bytes"
21      }
22    ],
23    "outputs": [],
24    "stateMutability": "pure"
25  }
26]
27```*/
28#[allow(
29    non_camel_case_types,
30    non_snake_case,
31    clippy::pub_underscore_fields,
32    clippy::style,
33    clippy::empty_structs_with_brackets
34)]
35pub mod ErrorRaiser {
36    use super::*;
37    use alloy::sol_types as alloy_sol_types;
38    /// The creation / init bytecode of the contract.
39    ///
40    /// ```text
41    ///0x6080806040523460155761010b908161001a8239f35b5f80fdfe608060405260043610156010575f80fd5b5f3560e01c63ac603e30146022575f80fd5b3460bd57602036600319011260bd5760043567ffffffffffffffff811160bd573660238201121560bd5780600401359067ffffffffffffffff821160bd57366024838301011160bd5760405191601f8101601f19908116603f011683019067ffffffffffffffff82118483101760b9578060245f946020946040528287520183860137830101528051908160b4575f80fd5b602001fd5b60c1565b5f80fd5b634e487b7160e01b5f52604160045260245ffdfea2646970667358221220ea792bddece773a94a603580762ed0f3b13fba33790f3c826f1c3c4fb14396c164736f6c634300081e0033
42    /// ```
43    #[rustfmt::skip]
44    #[allow(clippy::all)]
45    pub static BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
46        b"`\x80\x80`@R4`\x15Wa\x01\x0B\x90\x81a\0\x1A\x829\xF3[_\x80\xFD\xFE`\x80`@R`\x046\x10\x15`\x10W_\x80\xFD[_5`\xE0\x1Cc\xAC`>0\x14`\"W_\x80\xFD[4`\xBDW` 6`\x03\x19\x01\x12`\xBDW`\x045g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x81\x11`\xBDW6`#\x82\x01\x12\x15`\xBDW\x80`\x04\x015\x90g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x82\x11`\xBDW6`$\x83\x83\x01\x01\x11`\xBDW`@Q\x91`\x1F\x81\x01`\x1F\x19\x90\x81\x16`?\x01\x16\x83\x01\x90g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x82\x11\x84\x83\x10\x17`\xB9W\x80`$_\x94` \x94`@R\x82\x87R\x01\x83\x86\x017\x83\x01\x01R\x80Q\x90\x81`\xB4W_\x80\xFD[` \x01\xFD[`\xC1V[_\x80\xFD[cNH{q`\xE0\x1B_R`A`\x04R`$_\xFD\xFE\xA2dipfsX\"\x12 \xEAy+\xDD\xEC\xE7s\xA9J`5\x80v.\xD0\xF3\xB1?\xBA3y\x0F<\x82o\x1C<O\xB1C\x96\xC1dsolcC\0\x08\x1E\x003",
47    );
48    /// The runtime bytecode of the contract, as deployed on the network.
49    ///
50    /// ```text
51    ///0x608060405260043610156010575f80fd5b5f3560e01c63ac603e30146022575f80fd5b3460bd57602036600319011260bd5760043567ffffffffffffffff811160bd573660238201121560bd5780600401359067ffffffffffffffff821160bd57366024838301011160bd5760405191601f8101601f19908116603f011683019067ffffffffffffffff82118483101760b9578060245f946020946040528287520183860137830101528051908160b4575f80fd5b602001fd5b60c1565b5f80fd5b634e487b7160e01b5f52604160045260245ffdfea2646970667358221220ea792bddece773a94a603580762ed0f3b13fba33790f3c826f1c3c4fb14396c164736f6c634300081e0033
52    /// ```
53    #[rustfmt::skip]
54    #[allow(clippy::all)]
55    pub static DEPLOYED_BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
56        b"`\x80`@R`\x046\x10\x15`\x10W_\x80\xFD[_5`\xE0\x1Cc\xAC`>0\x14`\"W_\x80\xFD[4`\xBDW` 6`\x03\x19\x01\x12`\xBDW`\x045g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x81\x11`\xBDW6`#\x82\x01\x12\x15`\xBDW\x80`\x04\x015\x90g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x82\x11`\xBDW6`$\x83\x83\x01\x01\x11`\xBDW`@Q\x91`\x1F\x81\x01`\x1F\x19\x90\x81\x16`?\x01\x16\x83\x01\x90g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x82\x11\x84\x83\x10\x17`\xB9W\x80`$_\x94` \x94`@R\x82\x87R\x01\x83\x86\x017\x83\x01\x01R\x80Q\x90\x81`\xB4W_\x80\xFD[` \x01\xFD[`\xC1V[_\x80\xFD[cNH{q`\xE0\x1B_R`A`\x04R`$_\xFD\xFE\xA2dipfsX\"\x12 \xEAy+\xDD\xEC\xE7s\xA9J`5\x80v.\xD0\xF3\xB1?\xBA3y\x0F<\x82o\x1C<O\xB1C\x96\xC1dsolcC\0\x08\x1E\x003",
57    );
58    #[derive(serde::Serialize, serde::Deserialize)]
59    #[derive(Default, Debug, PartialEq, Eq, Hash)]
60    /**Function with signature `raise(bytes)` and selector `0xac603e30`.
61```solidity
62function raise(bytes memory error) external pure;
63```*/
64    #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
65    #[derive(Clone)]
66    pub struct raiseCall {
67        #[allow(missing_docs)]
68        pub error: alloy::sol_types::private::Bytes,
69    }
70    ///Container type for the return parameters of the [`raise(bytes)`](raiseCall) function.
71    #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
72    #[derive(Clone)]
73    pub struct raiseReturn {}
74    #[allow(
75        non_camel_case_types,
76        non_snake_case,
77        clippy::pub_underscore_fields,
78        clippy::style
79    )]
80    const _: () = {
81        use alloy::sol_types as alloy_sol_types;
82        {
83            #[doc(hidden)]
84            #[allow(dead_code)]
85            type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::Bytes,);
86            #[doc(hidden)]
87            type UnderlyingRustTuple<'a> = (alloy::sol_types::private::Bytes,);
88            #[cfg(test)]
89            #[allow(dead_code, unreachable_patterns)]
90            fn _type_assertion(
91                _t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>,
92            ) {
93                match _t {
94                    alloy_sol_types::private::AssertTypeEq::<
95                        <UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
96                    >(_) => {}
97                }
98            }
99            #[automatically_derived]
100            #[doc(hidden)]
101            impl ::core::convert::From<raiseCall> for UnderlyingRustTuple<'_> {
102                fn from(value: raiseCall) -> Self {
103                    (value.error,)
104                }
105            }
106            #[automatically_derived]
107            #[doc(hidden)]
108            impl ::core::convert::From<UnderlyingRustTuple<'_>> for raiseCall {
109                fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
110                    Self { error: tuple.0 }
111                }
112            }
113        }
114        {
115            #[doc(hidden)]
116            #[allow(dead_code)]
117            type UnderlyingSolTuple<'a> = ();
118            #[doc(hidden)]
119            type UnderlyingRustTuple<'a> = ();
120            #[cfg(test)]
121            #[allow(dead_code, unreachable_patterns)]
122            fn _type_assertion(
123                _t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>,
124            ) {
125                match _t {
126                    alloy_sol_types::private::AssertTypeEq::<
127                        <UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
128                    >(_) => {}
129                }
130            }
131            #[automatically_derived]
132            #[doc(hidden)]
133            impl ::core::convert::From<raiseReturn> for UnderlyingRustTuple<'_> {
134                fn from(value: raiseReturn) -> Self {
135                    ()
136                }
137            }
138            #[automatically_derived]
139            #[doc(hidden)]
140            impl ::core::convert::From<UnderlyingRustTuple<'_>> for raiseReturn {
141                fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
142                    Self {}
143                }
144            }
145        }
146        impl raiseReturn {
147            fn _tokenize(
148                &self,
149            ) -> <raiseCall as alloy_sol_types::SolCall>::ReturnToken<'_> {
150                ()
151            }
152        }
153        #[automatically_derived]
154        impl alloy_sol_types::SolCall for raiseCall {
155            type Parameters<'a> = (alloy::sol_types::sol_data::Bytes,);
156            type Token<'a> = <Self::Parameters<
157                'a,
158            > as alloy_sol_types::SolType>::Token<'a>;
159            type Return = raiseReturn;
160            type ReturnTuple<'a> = ();
161            type ReturnToken<'a> = <Self::ReturnTuple<
162                'a,
163            > as alloy_sol_types::SolType>::Token<'a>;
164            const SIGNATURE: &'static str = "raise(bytes)";
165            const SELECTOR: [u8; 4] = [172u8, 96u8, 62u8, 48u8];
166            #[inline]
167            fn new<'a>(
168                tuple: <Self::Parameters<'a> as alloy_sol_types::SolType>::RustType,
169            ) -> Self {
170                tuple.into()
171            }
172            #[inline]
173            fn tokenize(&self) -> Self::Token<'_> {
174                (
175                    <alloy::sol_types::sol_data::Bytes as alloy_sol_types::SolType>::tokenize(
176                        &self.error,
177                    ),
178                )
179            }
180            #[inline]
181            fn tokenize_returns(ret: &Self::Return) -> Self::ReturnToken<'_> {
182                raiseReturn::_tokenize(ret)
183            }
184            #[inline]
185            fn abi_decode_returns(data: &[u8]) -> alloy_sol_types::Result<Self::Return> {
186                <Self::ReturnTuple<
187                    '_,
188                > as alloy_sol_types::SolType>::abi_decode_sequence(data)
189                    .map(Into::into)
190            }
191            #[inline]
192            fn abi_decode_returns_validate(
193                data: &[u8],
194            ) -> alloy_sol_types::Result<Self::Return> {
195                <Self::ReturnTuple<
196                    '_,
197                > as alloy_sol_types::SolType>::abi_decode_sequence_validate(data)
198                    .map(Into::into)
199            }
200        }
201    };
202    ///Container for all the [`ErrorRaiser`](self) function calls.
203    #[derive(Clone)]
204    #[derive(serde::Serialize, serde::Deserialize)]
205    #[derive()]
206    pub enum ErrorRaiserCalls {
207        #[allow(missing_docs)]
208        raise(raiseCall),
209    }
210    impl ErrorRaiserCalls {
211        /// All the selectors of this enum.
212        ///
213        /// Note that the selectors might not be in the same order as the variants.
214        /// No guarantees are made about the order of the selectors.
215        ///
216        /// Prefer using `SolInterface` methods instead.
217        pub const SELECTORS: &'static [[u8; 4usize]] = &[[172u8, 96u8, 62u8, 48u8]];
218        /// The names of the variants in the same order as `SELECTORS`.
219        pub const VARIANT_NAMES: &'static [&'static str] = &[::core::stringify!(raise)];
220        /// The signatures in the same order as `SELECTORS`.
221        pub const SIGNATURES: &'static [&'static str] = &[
222            <raiseCall as alloy_sol_types::SolCall>::SIGNATURE,
223        ];
224        /// Returns the signature for the given selector, if known.
225        #[inline]
226        pub fn signature_by_selector(
227            selector: [u8; 4usize],
228        ) -> ::core::option::Option<&'static str> {
229            match Self::SELECTORS.binary_search(&selector) {
230                ::core::result::Result::Ok(idx) => {
231                    ::core::option::Option::Some(Self::SIGNATURES[idx])
232                }
233                ::core::result::Result::Err(_) => ::core::option::Option::None,
234            }
235        }
236        /// Returns the enum variant name for the given selector, if known.
237        #[inline]
238        pub fn name_by_selector(
239            selector: [u8; 4usize],
240        ) -> ::core::option::Option<&'static str> {
241            let sig = Self::signature_by_selector(selector)?;
242            sig.split_once('(').map(|(name, _)| name)
243        }
244    }
245    #[automatically_derived]
246    impl alloy_sol_types::SolInterface for ErrorRaiserCalls {
247        const NAME: &'static str = "ErrorRaiserCalls";
248        const MIN_DATA_LENGTH: usize = 64usize;
249        const COUNT: usize = 1usize;
250        #[inline]
251        fn selector(&self) -> [u8; 4] {
252            match self {
253                Self::raise(_) => <raiseCall as alloy_sol_types::SolCall>::SELECTOR,
254            }
255        }
256        #[inline]
257        fn selector_at(i: usize) -> ::core::option::Option<[u8; 4]> {
258            Self::SELECTORS.get(i).copied()
259        }
260        #[inline]
261        fn valid_selector(selector: [u8; 4]) -> bool {
262            Self::SELECTORS.binary_search(&selector).is_ok()
263        }
264        #[inline]
265        #[allow(non_snake_case)]
266        fn abi_decode_raw(
267            selector: [u8; 4],
268            data: &[u8],
269        ) -> alloy_sol_types::Result<Self> {
270            static DECODE_SHIMS: &[fn(
271                &[u8],
272            ) -> alloy_sol_types::Result<ErrorRaiserCalls>] = &[
273                {
274                    fn raise(data: &[u8]) -> alloy_sol_types::Result<ErrorRaiserCalls> {
275                        <raiseCall as alloy_sol_types::SolCall>::abi_decode_raw(data)
276                            .map(ErrorRaiserCalls::raise)
277                    }
278                    raise
279                },
280            ];
281            let Ok(idx) = Self::SELECTORS.binary_search(&selector) else {
282                return Err(
283                    alloy_sol_types::Error::unknown_selector(
284                        <Self as alloy_sol_types::SolInterface>::NAME,
285                        selector,
286                    ),
287                );
288            };
289            DECODE_SHIMS[idx](data)
290        }
291        #[inline]
292        #[allow(non_snake_case)]
293        fn abi_decode_raw_validate(
294            selector: [u8; 4],
295            data: &[u8],
296        ) -> alloy_sol_types::Result<Self> {
297            static DECODE_VALIDATE_SHIMS: &[fn(
298                &[u8],
299            ) -> alloy_sol_types::Result<ErrorRaiserCalls>] = &[
300                {
301                    fn raise(data: &[u8]) -> alloy_sol_types::Result<ErrorRaiserCalls> {
302                        <raiseCall as alloy_sol_types::SolCall>::abi_decode_raw_validate(
303                                data,
304                            )
305                            .map(ErrorRaiserCalls::raise)
306                    }
307                    raise
308                },
309            ];
310            let Ok(idx) = Self::SELECTORS.binary_search(&selector) else {
311                return Err(
312                    alloy_sol_types::Error::unknown_selector(
313                        <Self as alloy_sol_types::SolInterface>::NAME,
314                        selector,
315                    ),
316                );
317            };
318            DECODE_VALIDATE_SHIMS[idx](data)
319        }
320        #[inline]
321        fn abi_encoded_size(&self) -> usize {
322            match self {
323                Self::raise(inner) => {
324                    <raiseCall as alloy_sol_types::SolCall>::abi_encoded_size(inner)
325                }
326            }
327        }
328        #[inline]
329        fn abi_encode_raw(&self, out: &mut alloy_sol_types::private::Vec<u8>) {
330            match self {
331                Self::raise(inner) => {
332                    <raiseCall as alloy_sol_types::SolCall>::abi_encode_raw(inner, out)
333                }
334            }
335        }
336    }
337    use alloy::contract as alloy_contract;
338    /**Creates a new wrapper around an on-chain [`ErrorRaiser`](self) contract instance.
339
340See the [wrapper's documentation](`ErrorRaiserInstance`) for more details.*/
341    #[inline]
342    pub const fn new<
343        P: alloy_contract::private::Provider<N>,
344        N: alloy_contract::private::Network,
345    >(
346        address: alloy_sol_types::private::Address,
347        __provider: P,
348    ) -> ErrorRaiserInstance<P, N> {
349        ErrorRaiserInstance::<P, N>::new(address, __provider)
350    }
351    /**Deploys this contract using the given `provider` and constructor arguments, if any.
352
353Returns a new instance of the contract, if the deployment was successful.
354
355For more fine-grained control over the deployment process, use [`deploy_builder`] instead.*/
356    #[inline]
357    pub fn deploy<
358        P: alloy_contract::private::Provider<N>,
359        N: alloy_contract::private::Network,
360    >(
361        __provider: P,
362    ) -> impl ::core::future::Future<
363        Output = alloy_contract::Result<ErrorRaiserInstance<P, N>>,
364    > {
365        ErrorRaiserInstance::<P, N>::deploy(__provider)
366    }
367    /**Creates a `RawCallBuilder` for deploying this contract using the given `provider`
368and constructor arguments, if any.
369
370This is a simple wrapper around creating a `RawCallBuilder` with the data set to
371the bytecode concatenated with the constructor's ABI-encoded arguments.*/
372    #[inline]
373    pub fn deploy_builder<
374        P: alloy_contract::private::Provider<N>,
375        N: alloy_contract::private::Network,
376    >(__provider: P) -> alloy_contract::RawCallBuilder<P, N> {
377        ErrorRaiserInstance::<P, N>::deploy_builder(__provider)
378    }
379    /**A [`ErrorRaiser`](self) instance.
380
381Contains type-safe methods for interacting with an on-chain instance of the
382[`ErrorRaiser`](self) contract located at a given `address`, using a given
383provider `P`.
384
385If the contract bytecode is available (see the [`sol!`](alloy_sol_types::sol!)
386documentation on how to provide it), the `deploy` and `deploy_builder` methods can
387be used to deploy a new instance of the contract.
388
389See the [module-level documentation](self) for all the available methods.*/
390    #[derive(Clone)]
391    pub struct ErrorRaiserInstance<P, N = alloy_contract::private::Ethereum> {
392        address: alloy_sol_types::private::Address,
393        provider: P,
394        _network: ::core::marker::PhantomData<N>,
395    }
396    #[automatically_derived]
397    impl<P, N> ::core::fmt::Debug for ErrorRaiserInstance<P, N> {
398        #[inline]
399        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
400            f.debug_tuple("ErrorRaiserInstance").field(&self.address).finish()
401        }
402    }
403    /// Instantiation and getters/setters.
404    impl<
405        P: alloy_contract::private::Provider<N>,
406        N: alloy_contract::private::Network,
407    > ErrorRaiserInstance<P, N> {
408        /**Creates a new wrapper around an on-chain [`ErrorRaiser`](self) contract instance.
409
410See the [wrapper's documentation](`ErrorRaiserInstance`) for more details.*/
411        #[inline]
412        pub const fn new(
413            address: alloy_sol_types::private::Address,
414            __provider: P,
415        ) -> Self {
416            Self {
417                address,
418                provider: __provider,
419                _network: ::core::marker::PhantomData,
420            }
421        }
422        /**Deploys this contract using the given `provider` and constructor arguments, if any.
423
424Returns a new instance of the contract, if the deployment was successful.
425
426For more fine-grained control over the deployment process, use [`deploy_builder`] instead.*/
427        #[inline]
428        pub async fn deploy(
429            __provider: P,
430        ) -> alloy_contract::Result<ErrorRaiserInstance<P, N>> {
431            let call_builder = Self::deploy_builder(__provider);
432            let contract_address = call_builder.deploy().await?;
433            Ok(Self::new(contract_address, call_builder.provider))
434        }
435        /**Creates a `RawCallBuilder` for deploying this contract using the given `provider`
436and constructor arguments, if any.
437
438This is a simple wrapper around creating a `RawCallBuilder` with the data set to
439the bytecode concatenated with the constructor's ABI-encoded arguments.*/
440        #[inline]
441        pub fn deploy_builder(__provider: P) -> alloy_contract::RawCallBuilder<P, N> {
442            alloy_contract::RawCallBuilder::new_raw_deploy(
443                __provider,
444                ::core::clone::Clone::clone(&BYTECODE),
445            )
446        }
447        /// Returns a reference to the address.
448        #[inline]
449        pub const fn address(&self) -> &alloy_sol_types::private::Address {
450            &self.address
451        }
452        /// Sets the address.
453        #[inline]
454        pub fn set_address(&mut self, address: alloy_sol_types::private::Address) {
455            self.address = address;
456        }
457        /// Sets the address and returns `self`.
458        pub fn at(mut self, address: alloy_sol_types::private::Address) -> Self {
459            self.set_address(address);
460            self
461        }
462        /// Returns a reference to the provider.
463        #[inline]
464        pub const fn provider(&self) -> &P {
465            &self.provider
466        }
467    }
468    impl<P: ::core::clone::Clone, N> ErrorRaiserInstance<&P, N> {
469        /// Clones the provider and returns a new instance with the cloned provider.
470        #[inline]
471        pub fn with_cloned_provider(self) -> ErrorRaiserInstance<P, N> {
472            ErrorRaiserInstance {
473                address: self.address,
474                provider: ::core::clone::Clone::clone(&self.provider),
475                _network: ::core::marker::PhantomData,
476            }
477        }
478    }
479    /// Function calls.
480    impl<
481        P: alloy_contract::private::Provider<N>,
482        N: alloy_contract::private::Network,
483    > ErrorRaiserInstance<P, N> {
484        /// Creates a new call builder using this contract instance's provider and address.
485        ///
486        /// Note that the call can be any function call, not just those defined in this
487        /// contract. Prefer using the other methods for building type-safe contract calls.
488        pub fn call_builder<C: alloy_sol_types::SolCall>(
489            &self,
490            call: &C,
491        ) -> alloy_contract::SolCallBuilder<&P, C, N> {
492            alloy_contract::SolCallBuilder::new_sol(&self.provider, &self.address, call)
493        }
494        ///Creates a new call builder for the [`raise`] function.
495        pub fn raise(
496            &self,
497            error: alloy::sol_types::private::Bytes,
498        ) -> alloy_contract::SolCallBuilder<&P, raiseCall, N> {
499            self.call_builder(&raiseCall { error })
500        }
501    }
502    /// Event filters.
503    impl<
504        P: alloy_contract::private::Provider<N>,
505        N: alloy_contract::private::Network,
506    > ErrorRaiserInstance<P, N> {
507        /// Creates a new event filter using this contract instance's provider and address.
508        ///
509        /// Note that the type can be any event, not just those defined in this contract.
510        /// Prefer using the other methods for building type-safe event filters.
511        pub fn event_filter<E: alloy_sol_types::SolEvent>(
512            &self,
513        ) -> alloy_contract::Event<&P, E, N> {
514            alloy_contract::Event::new_sol(&self.provider, &self.address)
515        }
516    }
517}