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