fluence_marketplace_api_draft/
strings.rs

1/**
2
3Generated by the following Solidity interface...
4```solidity
5interface Strings {
6    error StringsInsufficientHexLength(uint256 value, uint256 length);
7}
8```
9
10...which was generated by the following JSON ABI:
11```json
12[
13  {
14    "type": "error",
15    "name": "StringsInsufficientHexLength",
16    "inputs": [
17      {
18        "name": "value",
19        "type": "uint256",
20        "internalType": "uint256"
21      },
22      {
23        "name": "length",
24        "type": "uint256",
25        "internalType": "uint256"
26      }
27    ]
28  }
29]
30```*/
31#[allow(
32    non_camel_case_types,
33    non_snake_case,
34    clippy::pub_underscore_fields,
35    clippy::style,
36    clippy::empty_structs_with_brackets
37)]
38pub mod Strings {
39    use super::*;
40    use alloy::sol_types as alloy_sol_types;
41    /// The creation / init bytecode of the contract.
42    ///
43    /// ```text
44    ///0x6080806040523460175760399081601c823930815050f35b5f80fdfe5f80fdfea2646970667358221220ba7aa748b5dfa7cadcaa72df63083965307f70c410eea9d9ed506ea3e4cbb45464736f6c634300081c0033
45    /// ```
46    #[rustfmt::skip]
47    #[allow(clippy::all)]
48    pub static BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
49        b"`\x80\x80`@R4`\x17W`9\x90\x81`\x1C\x8290\x81PP\xF3[_\x80\xFD\xFE_\x80\xFD\xFE\xA2dipfsX\"\x12 \xBAz\xA7H\xB5\xDF\xA7\xCA\xDC\xAAr\xDFc\x089e0\x7Fp\xC4\x10\xEE\xA9\xD9\xEDPn\xA3\xE4\xCB\xB4TdsolcC\0\x08\x1C\x003",
50    );
51    /// The runtime bytecode of the contract, as deployed on the network.
52    ///
53    /// ```text
54    ///0x5f80fdfea2646970667358221220ba7aa748b5dfa7cadcaa72df63083965307f70c410eea9d9ed506ea3e4cbb45464736f6c634300081c0033
55    /// ```
56    #[rustfmt::skip]
57    #[allow(clippy::all)]
58    pub static DEPLOYED_BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
59        b"_\x80\xFD\xFE\xA2dipfsX\"\x12 \xBAz\xA7H\xB5\xDF\xA7\xCA\xDC\xAAr\xDFc\x089e0\x7Fp\xC4\x10\xEE\xA9\xD9\xEDPn\xA3\xE4\xCB\xB4TdsolcC\0\x08\x1C\x003",
60    );
61    /**Custom error with signature `StringsInsufficientHexLength(uint256,uint256)` and selector `0xe22e27eb`.
62```solidity
63error StringsInsufficientHexLength(uint256 value, uint256 length);
64```*/
65    #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
66    #[derive(Clone)]
67    pub struct StringsInsufficientHexLength {
68        #[allow(missing_docs)]
69        pub value: alloy::sol_types::private::primitives::aliases::U256,
70        #[allow(missing_docs)]
71        pub length: alloy::sol_types::private::primitives::aliases::U256,
72    }
73    #[allow(
74        non_camel_case_types,
75        non_snake_case,
76        clippy::pub_underscore_fields,
77        clippy::style
78    )]
79    const _: () = {
80        use alloy::sol_types as alloy_sol_types;
81        #[doc(hidden)]
82        type UnderlyingSolTuple<'a> = (
83            alloy::sol_types::sol_data::Uint<256>,
84            alloy::sol_types::sol_data::Uint<256>,
85        );
86        #[doc(hidden)]
87        type UnderlyingRustTuple<'a> = (
88            alloy::sol_types::private::primitives::aliases::U256,
89            alloy::sol_types::private::primitives::aliases::U256,
90        );
91        #[cfg(test)]
92        #[allow(dead_code, unreachable_patterns)]
93        fn _type_assertion(
94            _t: alloy_sol_types::private::AssertTypeEq<UnderlyingRustTuple>,
95        ) {
96            match _t {
97                alloy_sol_types::private::AssertTypeEq::<
98                    <UnderlyingSolTuple as alloy_sol_types::SolType>::RustType,
99                >(_) => {}
100            }
101        }
102        #[automatically_derived]
103        #[doc(hidden)]
104        impl ::core::convert::From<StringsInsufficientHexLength>
105        for UnderlyingRustTuple<'_> {
106            fn from(value: StringsInsufficientHexLength) -> Self {
107                (value.value, value.length)
108            }
109        }
110        #[automatically_derived]
111        #[doc(hidden)]
112        impl ::core::convert::From<UnderlyingRustTuple<'_>>
113        for StringsInsufficientHexLength {
114            fn from(tuple: UnderlyingRustTuple<'_>) -> Self {
115                Self {
116                    value: tuple.0,
117                    length: tuple.1,
118                }
119            }
120        }
121        #[automatically_derived]
122        impl alloy_sol_types::SolError for StringsInsufficientHexLength {
123            type Parameters<'a> = UnderlyingSolTuple<'a>;
124            type Token<'a> = <Self::Parameters<
125                'a,
126            > as alloy_sol_types::SolType>::Token<'a>;
127            const SIGNATURE: &'static str = "StringsInsufficientHexLength(uint256,uint256)";
128            const SELECTOR: [u8; 4] = [226u8, 46u8, 39u8, 235u8];
129            #[inline]
130            fn new<'a>(
131                tuple: <Self::Parameters<'a> as alloy_sol_types::SolType>::RustType,
132            ) -> Self {
133                tuple.into()
134            }
135            #[inline]
136            fn tokenize(&self) -> Self::Token<'_> {
137                (
138                    <alloy::sol_types::sol_data::Uint<
139                        256,
140                    > as alloy_sol_types::SolType>::tokenize(&self.value),
141                    <alloy::sol_types::sol_data::Uint<
142                        256,
143                    > as alloy_sol_types::SolType>::tokenize(&self.length),
144                )
145            }
146        }
147    };
148    ///Container for all the [`Strings`](self) custom errors.
149    pub enum StringsErrors {
150        #[allow(missing_docs)]
151        StringsInsufficientHexLength(StringsInsufficientHexLength),
152    }
153    #[automatically_derived]
154    impl StringsErrors {
155        /// All the selectors of this enum.
156        ///
157        /// Note that the selectors might not be in the same order as the variants.
158        /// No guarantees are made about the order of the selectors.
159        ///
160        /// Prefer using `SolInterface` methods instead.
161        pub const SELECTORS: &'static [[u8; 4usize]] = &[[226u8, 46u8, 39u8, 235u8]];
162    }
163    #[automatically_derived]
164    impl alloy_sol_types::SolInterface for StringsErrors {
165        const NAME: &'static str = "StringsErrors";
166        const MIN_DATA_LENGTH: usize = 64usize;
167        const COUNT: usize = 1usize;
168        #[inline]
169        fn selector(&self) -> [u8; 4] {
170            match self {
171                Self::StringsInsufficientHexLength(_) => {
172                    <StringsInsufficientHexLength as alloy_sol_types::SolError>::SELECTOR
173                }
174            }
175        }
176        #[inline]
177        fn selector_at(i: usize) -> ::core::option::Option<[u8; 4]> {
178            Self::SELECTORS.get(i).copied()
179        }
180        #[inline]
181        fn valid_selector(selector: [u8; 4]) -> bool {
182            Self::SELECTORS.binary_search(&selector).is_ok()
183        }
184        #[inline]
185        #[allow(non_snake_case)]
186        fn abi_decode_raw(
187            selector: [u8; 4],
188            data: &[u8],
189            validate: bool,
190        ) -> alloy_sol_types::Result<Self> {
191            static DECODE_SHIMS: &[fn(
192                &[u8],
193                bool,
194            ) -> alloy_sol_types::Result<StringsErrors>] = &[
195                {
196                    fn StringsInsufficientHexLength(
197                        data: &[u8],
198                        validate: bool,
199                    ) -> alloy_sol_types::Result<StringsErrors> {
200                        <StringsInsufficientHexLength as alloy_sol_types::SolError>::abi_decode_raw(
201                                data,
202                                validate,
203                            )
204                            .map(StringsErrors::StringsInsufficientHexLength)
205                    }
206                    StringsInsufficientHexLength
207                },
208            ];
209            let Ok(idx) = Self::SELECTORS.binary_search(&selector) else {
210                return Err(
211                    alloy_sol_types::Error::unknown_selector(
212                        <Self as alloy_sol_types::SolInterface>::NAME,
213                        selector,
214                    ),
215                );
216            };
217            DECODE_SHIMS[idx](data, validate)
218        }
219        #[inline]
220        fn abi_encoded_size(&self) -> usize {
221            match self {
222                Self::StringsInsufficientHexLength(inner) => {
223                    <StringsInsufficientHexLength as alloy_sol_types::SolError>::abi_encoded_size(
224                        inner,
225                    )
226                }
227            }
228        }
229        #[inline]
230        fn abi_encode_raw(&self, out: &mut alloy_sol_types::private::Vec<u8>) {
231            match self {
232                Self::StringsInsufficientHexLength(inner) => {
233                    <StringsInsufficientHexLength as alloy_sol_types::SolError>::abi_encode_raw(
234                        inner,
235                        out,
236                    )
237                }
238            }
239        }
240    }
241    use alloy::contract as alloy_contract;
242    /**Creates a new wrapper around an on-chain [`Strings`](self) contract instance.
243
244See the [wrapper's documentation](`StringsInstance`) for more details.*/
245    #[inline]
246    pub const fn new<
247        T: alloy_contract::private::Transport + ::core::clone::Clone,
248        P: alloy_contract::private::Provider<T, N>,
249        N: alloy_contract::private::Network,
250    >(
251        address: alloy_sol_types::private::Address,
252        provider: P,
253    ) -> StringsInstance<T, P, N> {
254        StringsInstance::<T, P, N>::new(address, provider)
255    }
256    /**Deploys this contract using the given `provider` and constructor arguments, if any.
257
258Returns a new instance of the contract, if the deployment was successful.
259
260For more fine-grained control over the deployment process, use [`deploy_builder`] instead.*/
261    #[inline]
262    pub fn deploy<
263        T: alloy_contract::private::Transport + ::core::clone::Clone,
264        P: alloy_contract::private::Provider<T, N>,
265        N: alloy_contract::private::Network,
266    >(
267        provider: P,
268    ) -> impl ::core::future::Future<
269        Output = alloy_contract::Result<StringsInstance<T, P, N>>,
270    > {
271        StringsInstance::<T, P, N>::deploy(provider)
272    }
273    /**Creates a `RawCallBuilder` for deploying this contract using the given `provider`
274and constructor arguments, if any.
275
276This is a simple wrapper around creating a `RawCallBuilder` with the data set to
277the bytecode concatenated with the constructor's ABI-encoded arguments.*/
278    #[inline]
279    pub fn deploy_builder<
280        T: alloy_contract::private::Transport + ::core::clone::Clone,
281        P: alloy_contract::private::Provider<T, N>,
282        N: alloy_contract::private::Network,
283    >(provider: P) -> alloy_contract::RawCallBuilder<T, P, N> {
284        StringsInstance::<T, P, N>::deploy_builder(provider)
285    }
286    /**A [`Strings`](self) instance.
287
288Contains type-safe methods for interacting with an on-chain instance of the
289[`Strings`](self) contract located at a given `address`, using a given
290provider `P`.
291
292If the contract bytecode is available (see the [`sol!`](alloy_sol_types::sol!)
293documentation on how to provide it), the `deploy` and `deploy_builder` methods can
294be used to deploy a new instance of the contract.
295
296See the [module-level documentation](self) for all the available methods.*/
297    #[derive(Clone)]
298    pub struct StringsInstance<T, P, N = alloy_contract::private::Ethereum> {
299        address: alloy_sol_types::private::Address,
300        provider: P,
301        _network_transport: ::core::marker::PhantomData<(N, T)>,
302    }
303    #[automatically_derived]
304    impl<T, P, N> ::core::fmt::Debug for StringsInstance<T, P, N> {
305        #[inline]
306        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
307            f.debug_tuple("StringsInstance").field(&self.address).finish()
308        }
309    }
310    /// Instantiation and getters/setters.
311    #[automatically_derived]
312    impl<
313        T: alloy_contract::private::Transport + ::core::clone::Clone,
314        P: alloy_contract::private::Provider<T, N>,
315        N: alloy_contract::private::Network,
316    > StringsInstance<T, P, N> {
317        /**Creates a new wrapper around an on-chain [`Strings`](self) contract instance.
318
319See the [wrapper's documentation](`StringsInstance`) for more details.*/
320        #[inline]
321        pub const fn new(
322            address: alloy_sol_types::private::Address,
323            provider: P,
324        ) -> Self {
325            Self {
326                address,
327                provider,
328                _network_transport: ::core::marker::PhantomData,
329            }
330        }
331        /**Deploys this contract using the given `provider` and constructor arguments, if any.
332
333Returns a new instance of the contract, if the deployment was successful.
334
335For more fine-grained control over the deployment process, use [`deploy_builder`] instead.*/
336        #[inline]
337        pub async fn deploy(
338            provider: P,
339        ) -> alloy_contract::Result<StringsInstance<T, P, N>> {
340            let call_builder = Self::deploy_builder(provider);
341            let contract_address = call_builder.deploy().await?;
342            Ok(Self::new(contract_address, call_builder.provider))
343        }
344        /**Creates a `RawCallBuilder` for deploying this contract using the given `provider`
345and constructor arguments, if any.
346
347This is a simple wrapper around creating a `RawCallBuilder` with the data set to
348the bytecode concatenated with the constructor's ABI-encoded arguments.*/
349        #[inline]
350        pub fn deploy_builder(provider: P) -> alloy_contract::RawCallBuilder<T, P, N> {
351            alloy_contract::RawCallBuilder::new_raw_deploy(
352                provider,
353                ::core::clone::Clone::clone(&BYTECODE),
354            )
355        }
356        /// Returns a reference to the address.
357        #[inline]
358        pub const fn address(&self) -> &alloy_sol_types::private::Address {
359            &self.address
360        }
361        /// Sets the address.
362        #[inline]
363        pub fn set_address(&mut self, address: alloy_sol_types::private::Address) {
364            self.address = address;
365        }
366        /// Sets the address and returns `self`.
367        pub fn at(mut self, address: alloy_sol_types::private::Address) -> Self {
368            self.set_address(address);
369            self
370        }
371        /// Returns a reference to the provider.
372        #[inline]
373        pub const fn provider(&self) -> &P {
374            &self.provider
375        }
376    }
377    impl<T, P: ::core::clone::Clone, N> StringsInstance<T, &P, N> {
378        /// Clones the provider and returns a new instance with the cloned provider.
379        #[inline]
380        pub fn with_cloned_provider(self) -> StringsInstance<T, P, N> {
381            StringsInstance {
382                address: self.address,
383                provider: ::core::clone::Clone::clone(&self.provider),
384                _network_transport: ::core::marker::PhantomData,
385            }
386        }
387    }
388    /// Function calls.
389    #[automatically_derived]
390    impl<
391        T: alloy_contract::private::Transport + ::core::clone::Clone,
392        P: alloy_contract::private::Provider<T, N>,
393        N: alloy_contract::private::Network,
394    > StringsInstance<T, P, N> {
395        /// Creates a new call builder using this contract instance's provider and address.
396        ///
397        /// Note that the call can be any function call, not just those defined in this
398        /// contract. Prefer using the other methods for building type-safe contract calls.
399        pub fn call_builder<C: alloy_sol_types::SolCall>(
400            &self,
401            call: &C,
402        ) -> alloy_contract::SolCallBuilder<T, &P, C, N> {
403            alloy_contract::SolCallBuilder::new_sol(&self.provider, &self.address, call)
404        }
405    }
406    /// Event filters.
407    #[automatically_derived]
408    impl<
409        T: alloy_contract::private::Transport + ::core::clone::Clone,
410        P: alloy_contract::private::Provider<T, N>,
411        N: alloy_contract::private::Network,
412    > StringsInstance<T, P, N> {
413        /// Creates a new event filter using this contract instance's provider and address.
414        ///
415        /// Note that the type can be any event, not just those defined in this contract.
416        /// Prefer using the other methods for building type-safe event filters.
417        pub fn event_filter<E: alloy_sol_types::SolEvent>(
418            &self,
419        ) -> alloy_contract::Event<T, &P, E, N> {
420            alloy_contract::Event::new_sol(&self.provider, &self.address)
421        }
422    }
423}