fluence_marketplace_api_draft/
math.rs

1/**
2
3Generated by the following Solidity interface...
4```solidity
5interface Math {}
6```
7
8...which was generated by the following JSON ABI:
9```json
10[]
11```*/
12#[allow(
13    non_camel_case_types,
14    non_snake_case,
15    clippy::pub_underscore_fields,
16    clippy::style,
17    clippy::empty_structs_with_brackets
18)]
19pub mod Math {
20    use super::*;
21    use alloy::sol_types as alloy_sol_types;
22    /// The creation / init bytecode of the contract.
23    ///
24    /// ```text
25    ///0x6080806040523460175760399081601c823930815050f35b5f80fdfe5f80fdfea2646970667358221220bc9b8b630a8fe2f1f10f4bed688b4b5ef8cca800ea0d03ec18e96048da9c675c64736f6c634300081c0033
26    /// ```
27    #[rustfmt::skip]
28    #[allow(clippy::all)]
29    pub static BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
30        b"`\x80\x80`@R4`\x17W`9\x90\x81`\x1C\x8290\x81PP\xF3[_\x80\xFD\xFE_\x80\xFD\xFE\xA2dipfsX\"\x12 \xBC\x9B\x8Bc\n\x8F\xE2\xF1\xF1\x0FK\xEDh\x8BK^\xF8\xCC\xA8\0\xEA\r\x03\xEC\x18\xE9`H\xDA\x9Cg\\dsolcC\0\x08\x1C\x003",
31    );
32    /// The runtime bytecode of the contract, as deployed on the network.
33    ///
34    /// ```text
35    ///0x5f80fdfea2646970667358221220bc9b8b630a8fe2f1f10f4bed688b4b5ef8cca800ea0d03ec18e96048da9c675c64736f6c634300081c0033
36    /// ```
37    #[rustfmt::skip]
38    #[allow(clippy::all)]
39    pub static DEPLOYED_BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static(
40        b"_\x80\xFD\xFE\xA2dipfsX\"\x12 \xBC\x9B\x8Bc\n\x8F\xE2\xF1\xF1\x0FK\xEDh\x8BK^\xF8\xCC\xA8\0\xEA\r\x03\xEC\x18\xE9`H\xDA\x9Cg\\dsolcC\0\x08\x1C\x003",
41    );
42    use alloy::contract as alloy_contract;
43    /**Creates a new wrapper around an on-chain [`Math`](self) contract instance.
44
45See the [wrapper's documentation](`MathInstance`) for more details.*/
46    #[inline]
47    pub const fn new<
48        T: alloy_contract::private::Transport + ::core::clone::Clone,
49        P: alloy_contract::private::Provider<T, N>,
50        N: alloy_contract::private::Network,
51    >(address: alloy_sol_types::private::Address, provider: P) -> MathInstance<T, P, N> {
52        MathInstance::<T, P, N>::new(address, provider)
53    }
54    /**Deploys this contract using the given `provider` and constructor arguments, if any.
55
56Returns a new instance of the contract, if the deployment was successful.
57
58For more fine-grained control over the deployment process, use [`deploy_builder`] instead.*/
59    #[inline]
60    pub fn deploy<
61        T: alloy_contract::private::Transport + ::core::clone::Clone,
62        P: alloy_contract::private::Provider<T, N>,
63        N: alloy_contract::private::Network,
64    >(
65        provider: P,
66    ) -> impl ::core::future::Future<
67        Output = alloy_contract::Result<MathInstance<T, P, N>>,
68    > {
69        MathInstance::<T, P, N>::deploy(provider)
70    }
71    /**Creates a `RawCallBuilder` for deploying this contract using the given `provider`
72and constructor arguments, if any.
73
74This is a simple wrapper around creating a `RawCallBuilder` with the data set to
75the bytecode concatenated with the constructor's ABI-encoded arguments.*/
76    #[inline]
77    pub fn deploy_builder<
78        T: alloy_contract::private::Transport + ::core::clone::Clone,
79        P: alloy_contract::private::Provider<T, N>,
80        N: alloy_contract::private::Network,
81    >(provider: P) -> alloy_contract::RawCallBuilder<T, P, N> {
82        MathInstance::<T, P, N>::deploy_builder(provider)
83    }
84    /**A [`Math`](self) instance.
85
86Contains type-safe methods for interacting with an on-chain instance of the
87[`Math`](self) contract located at a given `address`, using a given
88provider `P`.
89
90If the contract bytecode is available (see the [`sol!`](alloy_sol_types::sol!)
91documentation on how to provide it), the `deploy` and `deploy_builder` methods can
92be used to deploy a new instance of the contract.
93
94See the [module-level documentation](self) for all the available methods.*/
95    #[derive(Clone)]
96    pub struct MathInstance<T, P, N = alloy_contract::private::Ethereum> {
97        address: alloy_sol_types::private::Address,
98        provider: P,
99        _network_transport: ::core::marker::PhantomData<(N, T)>,
100    }
101    #[automatically_derived]
102    impl<T, P, N> ::core::fmt::Debug for MathInstance<T, P, N> {
103        #[inline]
104        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
105            f.debug_tuple("MathInstance").field(&self.address).finish()
106        }
107    }
108    /// Instantiation and getters/setters.
109    #[automatically_derived]
110    impl<
111        T: alloy_contract::private::Transport + ::core::clone::Clone,
112        P: alloy_contract::private::Provider<T, N>,
113        N: alloy_contract::private::Network,
114    > MathInstance<T, P, N> {
115        /**Creates a new wrapper around an on-chain [`Math`](self) contract instance.
116
117See the [wrapper's documentation](`MathInstance`) for more details.*/
118        #[inline]
119        pub const fn new(
120            address: alloy_sol_types::private::Address,
121            provider: P,
122        ) -> Self {
123            Self {
124                address,
125                provider,
126                _network_transport: ::core::marker::PhantomData,
127            }
128        }
129        /**Deploys this contract using the given `provider` and constructor arguments, if any.
130
131Returns a new instance of the contract, if the deployment was successful.
132
133For more fine-grained control over the deployment process, use [`deploy_builder`] instead.*/
134        #[inline]
135        pub async fn deploy(
136            provider: P,
137        ) -> alloy_contract::Result<MathInstance<T, P, N>> {
138            let call_builder = Self::deploy_builder(provider);
139            let contract_address = call_builder.deploy().await?;
140            Ok(Self::new(contract_address, call_builder.provider))
141        }
142        /**Creates a `RawCallBuilder` for deploying this contract using the given `provider`
143and constructor arguments, if any.
144
145This is a simple wrapper around creating a `RawCallBuilder` with the data set to
146the bytecode concatenated with the constructor's ABI-encoded arguments.*/
147        #[inline]
148        pub fn deploy_builder(provider: P) -> alloy_contract::RawCallBuilder<T, P, N> {
149            alloy_contract::RawCallBuilder::new_raw_deploy(
150                provider,
151                ::core::clone::Clone::clone(&BYTECODE),
152            )
153        }
154        /// Returns a reference to the address.
155        #[inline]
156        pub const fn address(&self) -> &alloy_sol_types::private::Address {
157            &self.address
158        }
159        /// Sets the address.
160        #[inline]
161        pub fn set_address(&mut self, address: alloy_sol_types::private::Address) {
162            self.address = address;
163        }
164        /// Sets the address and returns `self`.
165        pub fn at(mut self, address: alloy_sol_types::private::Address) -> Self {
166            self.set_address(address);
167            self
168        }
169        /// Returns a reference to the provider.
170        #[inline]
171        pub const fn provider(&self) -> &P {
172            &self.provider
173        }
174    }
175    impl<T, P: ::core::clone::Clone, N> MathInstance<T, &P, N> {
176        /// Clones the provider and returns a new instance with the cloned provider.
177        #[inline]
178        pub fn with_cloned_provider(self) -> MathInstance<T, P, N> {
179            MathInstance {
180                address: self.address,
181                provider: ::core::clone::Clone::clone(&self.provider),
182                _network_transport: ::core::marker::PhantomData,
183            }
184        }
185    }
186    /// Function calls.
187    #[automatically_derived]
188    impl<
189        T: alloy_contract::private::Transport + ::core::clone::Clone,
190        P: alloy_contract::private::Provider<T, N>,
191        N: alloy_contract::private::Network,
192    > MathInstance<T, P, N> {
193        /// Creates a new call builder using this contract instance's provider and address.
194        ///
195        /// Note that the call can be any function call, not just those defined in this
196        /// contract. Prefer using the other methods for building type-safe contract calls.
197        pub fn call_builder<C: alloy_sol_types::SolCall>(
198            &self,
199            call: &C,
200        ) -> alloy_contract::SolCallBuilder<T, &P, C, N> {
201            alloy_contract::SolCallBuilder::new_sol(&self.provider, &self.address, call)
202        }
203    }
204    /// Event filters.
205    #[automatically_derived]
206    impl<
207        T: alloy_contract::private::Transport + ::core::clone::Clone,
208        P: alloy_contract::private::Provider<T, N>,
209        N: alloy_contract::private::Network,
210    > MathInstance<T, P, N> {
211        /// Creates a new event filter using this contract instance's provider and address.
212        ///
213        /// Note that the type can be any event, not just those defined in this contract.
214        /// Prefer using the other methods for building type-safe event filters.
215        pub fn event_filter<E: alloy_sol_types::SolEvent>(
216            &self,
217        ) -> alloy_contract::Event<T, &P, E, N> {
218            alloy_contract::Event::new_sol(&self.provider, &self.address)
219        }
220    }
221}