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 #[automatically_derived]
110 impl<
111 P: alloy_contract::private::Provider<N>,
112 N: alloy_contract::private::Network,
113 > FastTypesInstance<P, N> {
114 /**Creates a new wrapper around an on-chain [`FastTypes`](self) contract instance.
115
116See the [wrapper's documentation](`FastTypesInstance`) for more details.*/
117 #[inline]
118 pub const fn new(
119 address: alloy_sol_types::private::Address,
120 provider: P,
121 ) -> Self {
122 Self {
123 address,
124 provider,
125 _network: ::core::marker::PhantomData,
126 }
127 }
128 /**Deploys this contract using the given `provider` and constructor arguments, if any.
129
130Returns a new instance of the contract, if the deployment was successful.
131
132For more fine-grained control over the deployment process, use [`deploy_builder`] instead.*/
133 #[inline]
134 pub async fn deploy(
135 provider: P,
136 ) -> alloy_contract::Result<FastTypesInstance<P, N>> {
137 let call_builder = Self::deploy_builder(provider);
138 let contract_address = call_builder.deploy().await?;
139 Ok(Self::new(contract_address, call_builder.provider))
140 }
141 /**Creates a `RawCallBuilder` for deploying this contract using the given `provider`
142and constructor arguments, if any.
143
144This is a simple wrapper around creating a `RawCallBuilder` with the data set to
145the bytecode concatenated with the constructor's ABI-encoded arguments.*/
146 #[inline]
147 pub fn deploy_builder(provider: P) -> alloy_contract::RawCallBuilder<P, N> {
148 alloy_contract::RawCallBuilder::new_raw_deploy(
149 provider,
150 ::core::clone::Clone::clone(&BYTECODE),
151 )
152 }
153 /// Returns a reference to the address.
154 #[inline]
155 pub const fn address(&self) -> &alloy_sol_types::private::Address {
156 &self.address
157 }
158 /// Sets the address.
159 #[inline]
160 pub fn set_address(&mut self, address: alloy_sol_types::private::Address) {
161 self.address = address;
162 }
163 /// Sets the address and returns `self`.
164 pub fn at(mut self, address: alloy_sol_types::private::Address) -> Self {
165 self.set_address(address);
166 self
167 }
168 /// Returns a reference to the provider.
169 #[inline]
170 pub const fn provider(&self) -> &P {
171 &self.provider
172 }
173 }
174 impl<P: ::core::clone::Clone, N> FastTypesInstance<&P, N> {
175 /// Clones the provider and returns a new instance with the cloned provider.
176 #[inline]
177 pub fn with_cloned_provider(self) -> FastTypesInstance<P, N> {
178 FastTypesInstance {
179 address: self.address,
180 provider: ::core::clone::Clone::clone(&self.provider),
181 _network: ::core::marker::PhantomData,
182 }
183 }
184 }
185 /// Function calls.
186 #[automatically_derived]
187 impl<
188 P: alloy_contract::private::Provider<N>,
189 N: alloy_contract::private::Network,
190 > FastTypesInstance<P, N> {
191 /// Creates a new call builder using this contract instance's provider and address.
192 ///
193 /// Note that the call can be any function call, not just those defined in this
194 /// contract. Prefer using the other methods for building type-safe contract calls.
195 pub fn call_builder<C: alloy_sol_types::SolCall>(
196 &self,
197 call: &C,
198 ) -> alloy_contract::SolCallBuilder<&P, C, N> {
199 alloy_contract::SolCallBuilder::new_sol(&self.provider, &self.address, call)
200 }
201 }
202 /// Event filters.
203 #[automatically_derived]
204 impl<
205 P: alloy_contract::private::Provider<N>,
206 N: alloy_contract::private::Network,
207 > FastTypesInstance<P, N> {
208 /// Creates a new event filter using this contract instance's provider and address.
209 ///
210 /// Note that the type can be any event, not just those defined in this contract.
211 /// Prefer using the other methods for building type-safe event filters.
212 pub fn event_filter<E: alloy_sol_types::SolEvent>(
213 &self,
214 ) -> alloy_contract::Event<&P, E, N> {
215 alloy_contract::Event::new_sol(&self.provider, &self.address)
216 }
217 }
218}