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