pod_examples_solidity/fast_types.rs
1/**
2
3Generated by the following Solidity interface...
4```solidity
5interface FastTypes {}
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 FastTypes {
20 use super::*;
21 use alloy::sol_types as alloy_sol_types;
22 /// The creation / init bytecode of the contract.
23 ///
24 /// ```text
25 ///0x601f604b600b8282823980515f1a607314603f577f4e487b71000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b305f52607381538281f3fe730000000000000000000000000000000000000000301460806040525f5ffd
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"`\x1F`K`\x0B\x82\x82\x829\x80Q_\x1A`s\x14`?W\x7FNH{q\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0_R_`\x04R`$_\xFD[0_R`s\x81S\x82\x81\xF3\xFEs\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x000\x14`\x80`@R__\xFD",
31 );
32 /// The runtime bytecode of the contract, as deployed on the network.
33 ///
34 /// ```text
35 ///0x730000000000000000000000000000000000000000301460806040525f5ffd
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"s\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x000\x14`\x80`@R__\xFD",
41 );
42 use alloy::contract as alloy_contract;
43 /**Creates a new wrapper around an on-chain [`FastTypes`](self) contract instance.
44
45See the [wrapper's documentation](`FastTypesInstance`) for more details.*/
46 #[inline]
47 pub const fn new<
48 P: alloy_contract::private::Provider<N>,
49 N: alloy_contract::private::Network,
50 >(
51 address: alloy_sol_types::private::Address,
52 __provider: P,
53 ) -> FastTypesInstance<P, N> {
54 FastTypesInstance::<P, N>::new(address, __provider)
55 }
56 /**Deploys this contract using the given `provider` and constructor arguments, if any.
57
58Returns a new instance of the contract, if the deployment was successful.
59
60For more fine-grained control over the deployment process, use [`deploy_builder`] instead.*/
61 #[inline]
62 pub fn deploy<
63 P: alloy_contract::private::Provider<N>,
64 N: alloy_contract::private::Network,
65 >(
66 __provider: P,
67 ) -> impl ::core::future::Future<
68 Output = alloy_contract::Result<FastTypesInstance<P, N>>,
69 > {
70 FastTypesInstance::<P, N>::deploy(__provider)
71 }
72 /**Creates a `RawCallBuilder` for deploying this contract using the given `provider`
73and constructor arguments, if any.
74
75This is a simple wrapper around creating a `RawCallBuilder` with the data set to
76the bytecode concatenated with the constructor's ABI-encoded arguments.*/
77 #[inline]
78 pub fn deploy_builder<
79 P: alloy_contract::private::Provider<N>,
80 N: alloy_contract::private::Network,
81 >(__provider: P) -> alloy_contract::RawCallBuilder<P, N> {
82 FastTypesInstance::<P, N>::deploy_builder(__provider)
83 }
84 /**A [`FastTypes`](self) instance.
85
86Contains type-safe methods for interacting with an on-chain instance of the
87[`FastTypes`](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 FastTypesInstance<P, N = alloy_contract::private::Ethereum> {
97 address: alloy_sol_types::private::Address,
98 provider: P,
99 _network: ::core::marker::PhantomData<N>,
100 }
101 #[automatically_derived]
102 impl<P, N> ::core::fmt::Debug for FastTypesInstance<P, N> {
103 #[inline]
104 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
105 f.debug_tuple("FastTypesInstance").field(&self.address).finish()
106 }
107 }
108 /// Instantiation and getters/setters.
109 impl<
110 P: alloy_contract::private::Provider<N>,
111 N: alloy_contract::private::Network,
112 > FastTypesInstance<P, N> {
113 /**Creates a new wrapper around an on-chain [`FastTypes`](self) contract instance.
114
115See the [wrapper's documentation](`FastTypesInstance`) for more details.*/
116 #[inline]
117 pub const fn new(
118 address: alloy_sol_types::private::Address,
119 __provider: P,
120 ) -> Self {
121 Self {
122 address,
123 provider: __provider,
124 _network: ::core::marker::PhantomData,
125 }
126 }
127 /**Deploys this contract using the given `provider` and constructor arguments, if any.
128
129Returns a new instance of the contract, if the deployment was successful.
130
131For more fine-grained control over the deployment process, use [`deploy_builder`] instead.*/
132 #[inline]
133 pub async fn deploy(
134 __provider: P,
135 ) -> alloy_contract::Result<FastTypesInstance<P, N>> {
136 let call_builder = Self::deploy_builder(__provider);
137 let contract_address = call_builder.deploy().await?;
138 Ok(Self::new(contract_address, call_builder.provider))
139 }
140 /**Creates a `RawCallBuilder` for deploying this contract using the given `provider`
141and constructor arguments, if any.
142
143This is a simple wrapper around creating a `RawCallBuilder` with the data set to
144the bytecode concatenated with the constructor's ABI-encoded arguments.*/
145 #[inline]
146 pub fn deploy_builder(__provider: P) -> alloy_contract::RawCallBuilder<P, N> {
147 alloy_contract::RawCallBuilder::new_raw_deploy(
148 __provider,
149 ::core::clone::Clone::clone(&BYTECODE),
150 )
151 }
152 /// Returns a reference to the address.
153 #[inline]
154 pub const fn address(&self) -> &alloy_sol_types::private::Address {
155 &self.address
156 }
157 /// Sets the address.
158 #[inline]
159 pub fn set_address(&mut self, address: alloy_sol_types::private::Address) {
160 self.address = address;
161 }
162 /// Sets the address and returns `self`.
163 pub fn at(mut self, address: alloy_sol_types::private::Address) -> Self {
164 self.set_address(address);
165 self
166 }
167 /// Returns a reference to the provider.
168 #[inline]
169 pub const fn provider(&self) -> &P {
170 &self.provider
171 }
172 }
173 impl<P: ::core::clone::Clone, N> FastTypesInstance<&P, N> {
174 /// Clones the provider and returns a new instance with the cloned provider.
175 #[inline]
176 pub fn with_cloned_provider(self) -> FastTypesInstance<P, N> {
177 FastTypesInstance {
178 address: self.address,
179 provider: ::core::clone::Clone::clone(&self.provider),
180 _network: ::core::marker::PhantomData,
181 }
182 }
183 }
184 /// Function calls.
185 impl<
186 P: alloy_contract::private::Provider<N>,
187 N: alloy_contract::private::Network,
188 > FastTypesInstance<P, N> {
189 /// Creates a new call builder using this contract instance's provider and address.
190 ///
191 /// Note that the call can be any function call, not just those defined in this
192 /// contract. Prefer using the other methods for building type-safe contract calls.
193 pub fn call_builder<C: alloy_sol_types::SolCall>(
194 &self,
195 call: &C,
196 ) -> alloy_contract::SolCallBuilder<&P, C, N> {
197 alloy_contract::SolCallBuilder::new_sol(&self.provider, &self.address, call)
198 }
199 }
200 /// Event filters.
201 impl<
202 P: alloy_contract::private::Provider<N>,
203 N: alloy_contract::private::Network,
204 > FastTypesInstance<P, N> {
205 /// Creates a new event filter using this contract instance's provider and address.
206 ///
207 /// Note that the type can be any event, not just those defined in this contract.
208 /// Prefer using the other methods for building type-safe event filters.
209 pub fn event_filter<E: alloy_sol_types::SolEvent>(
210 &self,
211 ) -> alloy_contract::Event<&P, E, N> {
212 alloy_contract::Event::new_sol(&self.provider, &self.address)
213 }
214 }
215}