1pub use hopr_ticket_price_oracle::*;
2#[allow(
5 clippy::enum_variant_names,
6 clippy::too_many_arguments,
7 clippy::upper_case_acronyms,
8 clippy::type_complexity,
9 dead_code,
10 non_camel_case_types,
11)]
12pub mod hopr_ticket_price_oracle {
13 #[allow(deprecated)]
14 fn __abi() -> ::ethers::core::abi::Abi {
15 ::ethers::core::abi::ethabi::Contract {
16 constructor: ::core::option::Option::Some(::ethers::core::abi::ethabi::Constructor {
17 inputs: ::std::vec![
18 ::ethers::core::abi::ethabi::Param {
19 name: ::std::borrow::ToOwned::to_owned("_newOwner"),
20 kind: ::ethers::core::abi::ethabi::ParamType::Address,
21 internal_type: ::core::option::Option::Some(
22 ::std::borrow::ToOwned::to_owned("address"),
23 ),
24 },
25 ::ethers::core::abi::ethabi::Param {
26 name: ::std::borrow::ToOwned::to_owned("_initialTicketPrice"),
27 kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize),
28 internal_type: ::core::option::Option::Some(
29 ::std::borrow::ToOwned::to_owned("uint256"),
30 ),
31 },
32 ],
33 }),
34 functions: ::core::convert::From::from([
35 (
36 ::std::borrow::ToOwned::to_owned("currentTicketPrice"),
37 ::std::vec![
38 ::ethers::core::abi::ethabi::Function {
39 name: ::std::borrow::ToOwned::to_owned("currentTicketPrice"),
40 inputs: ::std::vec![],
41 outputs: ::std::vec![
42 ::ethers::core::abi::ethabi::Param {
43 name: ::std::string::String::new(),
44 kind: ::ethers::core::abi::ethabi::ParamType::Uint(
45 256usize,
46 ),
47 internal_type: ::core::option::Option::Some(
48 ::std::borrow::ToOwned::to_owned("uint256"),
49 ),
50 },
51 ],
52 constant: ::core::option::Option::None,
53 state_mutability: ::ethers::core::abi::ethabi::StateMutability::View,
54 },
55 ],
56 ),
57 (
58 ::std::borrow::ToOwned::to_owned("owner"),
59 ::std::vec![
60 ::ethers::core::abi::ethabi::Function {
61 name: ::std::borrow::ToOwned::to_owned("owner"),
62 inputs: ::std::vec![],
63 outputs: ::std::vec![
64 ::ethers::core::abi::ethabi::Param {
65 name: ::std::string::String::new(),
66 kind: ::ethers::core::abi::ethabi::ParamType::Address,
67 internal_type: ::core::option::Option::Some(
68 ::std::borrow::ToOwned::to_owned("address"),
69 ),
70 },
71 ],
72 constant: ::core::option::Option::None,
73 state_mutability: ::ethers::core::abi::ethabi::StateMutability::View,
74 },
75 ],
76 ),
77 (
78 ::std::borrow::ToOwned::to_owned("renounceOwnership"),
79 ::std::vec![
80 ::ethers::core::abi::ethabi::Function {
81 name: ::std::borrow::ToOwned::to_owned("renounceOwnership"),
82 inputs: ::std::vec![],
83 outputs: ::std::vec![],
84 constant: ::core::option::Option::None,
85 state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable,
86 },
87 ],
88 ),
89 (
90 ::std::borrow::ToOwned::to_owned("setTicketPrice"),
91 ::std::vec![
92 ::ethers::core::abi::ethabi::Function {
93 name: ::std::borrow::ToOwned::to_owned("setTicketPrice"),
94 inputs: ::std::vec![
95 ::ethers::core::abi::ethabi::Param {
96 name: ::std::borrow::ToOwned::to_owned("_newTicketPrice"),
97 kind: ::ethers::core::abi::ethabi::ParamType::Uint(
98 256usize,
99 ),
100 internal_type: ::core::option::Option::Some(
101 ::std::borrow::ToOwned::to_owned("uint256"),
102 ),
103 },
104 ],
105 outputs: ::std::vec![],
106 constant: ::core::option::Option::None,
107 state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable,
108 },
109 ],
110 ),
111 (
112 ::std::borrow::ToOwned::to_owned("transferOwnership"),
113 ::std::vec![
114 ::ethers::core::abi::ethabi::Function {
115 name: ::std::borrow::ToOwned::to_owned("transferOwnership"),
116 inputs: ::std::vec![
117 ::ethers::core::abi::ethabi::Param {
118 name: ::std::borrow::ToOwned::to_owned("newOwner"),
119 kind: ::ethers::core::abi::ethabi::ParamType::Address,
120 internal_type: ::core::option::Option::Some(
121 ::std::borrow::ToOwned::to_owned("address"),
122 ),
123 },
124 ],
125 outputs: ::std::vec![],
126 constant: ::core::option::Option::None,
127 state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable,
128 },
129 ],
130 ),
131 ]),
132 events: ::core::convert::From::from([
133 (
134 ::std::borrow::ToOwned::to_owned("OwnershipTransferred"),
135 ::std::vec![
136 ::ethers::core::abi::ethabi::Event {
137 name: ::std::borrow::ToOwned::to_owned(
138 "OwnershipTransferred",
139 ),
140 inputs: ::std::vec![
141 ::ethers::core::abi::ethabi::EventParam {
142 name: ::std::borrow::ToOwned::to_owned("previousOwner"),
143 kind: ::ethers::core::abi::ethabi::ParamType::Address,
144 indexed: true,
145 },
146 ::ethers::core::abi::ethabi::EventParam {
147 name: ::std::borrow::ToOwned::to_owned("newOwner"),
148 kind: ::ethers::core::abi::ethabi::ParamType::Address,
149 indexed: true,
150 },
151 ],
152 anonymous: false,
153 },
154 ],
155 ),
156 (
157 ::std::borrow::ToOwned::to_owned("TicketPriceUpdated"),
158 ::std::vec![
159 ::ethers::core::abi::ethabi::Event {
160 name: ::std::borrow::ToOwned::to_owned("TicketPriceUpdated"),
161 inputs: ::std::vec![
162 ::ethers::core::abi::ethabi::EventParam {
163 name: ::std::string::String::new(),
164 kind: ::ethers::core::abi::ethabi::ParamType::Uint(
165 256usize,
166 ),
167 indexed: false,
168 },
169 ::ethers::core::abi::ethabi::EventParam {
170 name: ::std::string::String::new(),
171 kind: ::ethers::core::abi::ethabi::ParamType::Uint(
172 256usize,
173 ),
174 indexed: false,
175 },
176 ],
177 anonymous: false,
178 },
179 ],
180 ),
181 ]),
182 errors: ::core::convert::From::from([
183 (
184 ::std::borrow::ToOwned::to_owned("TicketPriceMustNotBeSame"),
185 ::std::vec![
186 ::ethers::core::abi::ethabi::AbiError {
187 name: ::std::borrow::ToOwned::to_owned(
188 "TicketPriceMustNotBeSame",
189 ),
190 inputs: ::std::vec![],
191 },
192 ],
193 ),
194 (
195 ::std::borrow::ToOwned::to_owned("TicketPriceMustNotBeZero"),
196 ::std::vec![
197 ::ethers::core::abi::ethabi::AbiError {
198 name: ::std::borrow::ToOwned::to_owned(
199 "TicketPriceMustNotBeZero",
200 ),
201 inputs: ::std::vec![],
202 },
203 ],
204 ),
205 ]),
206 receive: false,
207 fallback: false,
208 }
209 }
210 pub static HOPRTICKETPRICEORACLE_ABI: ::ethers::contract::Lazy<
212 ::ethers::core::abi::Abi,
213 > = ::ethers::contract::Lazy::new(__abi);
214 #[rustfmt::skip]
215 const __BYTECODE: &[u8] = b"`\x80`@R4\x80\x15a\0\x10W`\0\x80\xFD[P`@Qa\x05c8\x03\x80a\x05c\x839\x81\x01`@\x81\x90Ra\0/\x91a\x02\x03V[a\083a\0QV[a\0A\x82a\0\xA1V[a\0J\x81a\x01\x1FV[PPa\x02=V[`\0\x80T`\x01`\x01`\xA0\x1B\x03\x83\x81\x16`\x01`\x01`\xA0\x1B\x03\x19\x83\x16\x81\x17\x84U`@Q\x91\x90\x92\x16\x92\x83\x91\x7F\x8B\xE0\x07\x9CS\x16Y\x14\x13D\xCD\x1F\xD0\xA4\xF2\x84\x19I\x7F\x97\"\xA3\xDA\xAF\xE3\xB4\x18okdW\xE0\x91\x90\xA3PPV[a\0\xA9a\x01\xA7V[`\x01`\x01`\xA0\x1B\x03\x81\x16a\x01\x13W`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`&`$\x82\x01R\x7FOwnable: new owner is the zero a`D\x82\x01Reddress`\xD0\x1B`d\x82\x01R`\x84\x01[`@Q\x80\x91\x03\x90\xFD[a\x01\x1C\x81a\0QV[PV[\x80`\0\x03a\x01@W`@QcE\xB2W\xEF`\xE0\x1B\x81R`\x04\x01`@Q\x80\x91\x03\x90\xFD[`\x01T\x81\x03a\x01bW`@Qc\x9B$\xE99`\xE0\x1B\x81R`\x04\x01`@Q\x80\x91\x03\x90\xFD[`\x01\x80T\x90\x82\x90U`@\x80Q\x82\x81R` \x81\x01\x84\x90R\x7F\xD4\xC5\xE0k\x1A\xE0\x97\xBA\x027&R\xA7\xAD\xAAnJ\x8E\0\xBERt\x97\xA3\xAD\x0E\xBC?v\x1E\xF3\xFB\x91\x01`@Q\x80\x91\x03\x90\xA1PPV[`\0T`\x01`\x01`\xA0\x1B\x03\x163\x14a\x02\x01W`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01\x81\x90R`$\x82\x01R\x7FOwnable: caller is not the owner`D\x82\x01R`d\x01a\x01\nV[V[`\0\x80`@\x83\x85\x03\x12\x15a\x02\x16W`\0\x80\xFD[\x82Q`\x01`\x01`\xA0\x1B\x03\x81\x16\x81\x14a\x02-W`\0\x80\xFD[` \x93\x90\x93\x01Q\x92\x94\x92\x93PPPV[a\x03\x17\x80a\x02L`\09`\0\xF3\xFE`\x80`@R4\x80\x15a\0\x10W`\0\x80\xFD[P`\x046\x10a\0WW`\x005`\xE0\x1C\x80c\x15\x98\x16P\x14a\0\\W\x80cqP\x18\xA6\x14a\0qW\x80c\x8D\xA5\xCB[\x14a\0yW\x80c\xE0\x15\x91\x06\x14a\0\x99W\x80c\xF2\xFD\xE3\x8B\x14a\0\xB0W[`\0\x80\xFD[a\0oa\0j6`\x04a\x02\x98V[a\0\xC3V[\0[a\0oa\0\xD7V[`\0T`@Q`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x81R` \x01[`@Q\x80\x91\x03\x90\xF3[a\0\xA2`\x01T\x81V[`@Q\x90\x81R` \x01a\0\x90V[a\0oa\0\xBE6`\x04a\x02\xB1V[a\0\xEBV[a\0\xCBa\x01fV[a\0\xD4\x81a\x01\xC0V[PV[a\0\xDFa\x01fV[a\0\xE9`\0a\x02HV[V[a\0\xF3a\x01fV[`\x01`\x01`\xA0\x1B\x03\x81\x16a\x01]W`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`&`$\x82\x01R\x7FOwnable: new owner is the zero a`D\x82\x01Reddress`\xD0\x1B`d\x82\x01R`\x84\x01[`@Q\x80\x91\x03\x90\xFD[a\0\xD4\x81a\x02HV[`\0T`\x01`\x01`\xA0\x1B\x03\x163\x14a\0\xE9W`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01\x81\x90R`$\x82\x01R\x7FOwnable: caller is not the owner`D\x82\x01R`d\x01a\x01TV[\x80`\0\x03a\x01\xE1W`@QcE\xB2W\xEF`\xE0\x1B\x81R`\x04\x01`@Q\x80\x91\x03\x90\xFD[`\x01T\x81\x03a\x02\x03W`@Qc\x9B$\xE99`\xE0\x1B\x81R`\x04\x01`@Q\x80\x91\x03\x90\xFD[`\x01\x80T\x90\x82\x90U`@\x80Q\x82\x81R` \x81\x01\x84\x90R\x7F\xD4\xC5\xE0k\x1A\xE0\x97\xBA\x027&R\xA7\xAD\xAAnJ\x8E\0\xBERt\x97\xA3\xAD\x0E\xBC?v\x1E\xF3\xFB\x91\x01`@Q\x80\x91\x03\x90\xA1PPV[`\0\x80T`\x01`\x01`\xA0\x1B\x03\x83\x81\x16`\x01`\x01`\xA0\x1B\x03\x19\x83\x16\x81\x17\x84U`@Q\x91\x90\x92\x16\x92\x83\x91\x7F\x8B\xE0\x07\x9CS\x16Y\x14\x13D\xCD\x1F\xD0\xA4\xF2\x84\x19I\x7F\x97\"\xA3\xDA\xAF\xE3\xB4\x18okdW\xE0\x91\x90\xA3PPV[`\0` \x82\x84\x03\x12\x15a\x02\xAAW`\0\x80\xFD[P5\x91\x90PV[`\0` \x82\x84\x03\x12\x15a\x02\xC3W`\0\x80\xFD[\x815`\x01`\x01`\xA0\x1B\x03\x81\x16\x81\x14a\x02\xDAW`\0\x80\xFD[\x93\x92PPPV\xFE\xA2dipfsX\"\x12 \x80\xF8'\xDE\x88>\xA1\xD8\x0B\xBC^\x1C\xC1\xD9F\xF4\xCB\xCE\xF3\x86{j\xC3\x16\x12\xEE\x17[\xF2$\xD5bdsolcC\0\x08\x13\x003";
216 pub static HOPRTICKETPRICEORACLE_BYTECODE: ::ethers::core::types::Bytes = ::ethers::core::types::Bytes::from_static(
218 __BYTECODE,
219 );
220 #[rustfmt::skip]
221 const __DEPLOYED_BYTECODE: &[u8] = b"`\x80`@R4\x80\x15a\0\x10W`\0\x80\xFD[P`\x046\x10a\0WW`\x005`\xE0\x1C\x80c\x15\x98\x16P\x14a\0\\W\x80cqP\x18\xA6\x14a\0qW\x80c\x8D\xA5\xCB[\x14a\0yW\x80c\xE0\x15\x91\x06\x14a\0\x99W\x80c\xF2\xFD\xE3\x8B\x14a\0\xB0W[`\0\x80\xFD[a\0oa\0j6`\x04a\x02\x98V[a\0\xC3V[\0[a\0oa\0\xD7V[`\0T`@Q`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x81R` \x01[`@Q\x80\x91\x03\x90\xF3[a\0\xA2`\x01T\x81V[`@Q\x90\x81R` \x01a\0\x90V[a\0oa\0\xBE6`\x04a\x02\xB1V[a\0\xEBV[a\0\xCBa\x01fV[a\0\xD4\x81a\x01\xC0V[PV[a\0\xDFa\x01fV[a\0\xE9`\0a\x02HV[V[a\0\xF3a\x01fV[`\x01`\x01`\xA0\x1B\x03\x81\x16a\x01]W`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`&`$\x82\x01R\x7FOwnable: new owner is the zero a`D\x82\x01Reddress`\xD0\x1B`d\x82\x01R`\x84\x01[`@Q\x80\x91\x03\x90\xFD[a\0\xD4\x81a\x02HV[`\0T`\x01`\x01`\xA0\x1B\x03\x163\x14a\0\xE9W`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01\x81\x90R`$\x82\x01R\x7FOwnable: caller is not the owner`D\x82\x01R`d\x01a\x01TV[\x80`\0\x03a\x01\xE1W`@QcE\xB2W\xEF`\xE0\x1B\x81R`\x04\x01`@Q\x80\x91\x03\x90\xFD[`\x01T\x81\x03a\x02\x03W`@Qc\x9B$\xE99`\xE0\x1B\x81R`\x04\x01`@Q\x80\x91\x03\x90\xFD[`\x01\x80T\x90\x82\x90U`@\x80Q\x82\x81R` \x81\x01\x84\x90R\x7F\xD4\xC5\xE0k\x1A\xE0\x97\xBA\x027&R\xA7\xAD\xAAnJ\x8E\0\xBERt\x97\xA3\xAD\x0E\xBC?v\x1E\xF3\xFB\x91\x01`@Q\x80\x91\x03\x90\xA1PPV[`\0\x80T`\x01`\x01`\xA0\x1B\x03\x83\x81\x16`\x01`\x01`\xA0\x1B\x03\x19\x83\x16\x81\x17\x84U`@Q\x91\x90\x92\x16\x92\x83\x91\x7F\x8B\xE0\x07\x9CS\x16Y\x14\x13D\xCD\x1F\xD0\xA4\xF2\x84\x19I\x7F\x97\"\xA3\xDA\xAF\xE3\xB4\x18okdW\xE0\x91\x90\xA3PPV[`\0` \x82\x84\x03\x12\x15a\x02\xAAW`\0\x80\xFD[P5\x91\x90PV[`\0` \x82\x84\x03\x12\x15a\x02\xC3W`\0\x80\xFD[\x815`\x01`\x01`\xA0\x1B\x03\x81\x16\x81\x14a\x02\xDAW`\0\x80\xFD[\x93\x92PPPV\xFE\xA2dipfsX\"\x12 \x80\xF8'\xDE\x88>\xA1\xD8\x0B\xBC^\x1C\xC1\xD9F\xF4\xCB\xCE\xF3\x86{j\xC3\x16\x12\xEE\x17[\xF2$\xD5bdsolcC\0\x08\x13\x003";
222 pub static HOPRTICKETPRICEORACLE_DEPLOYED_BYTECODE: ::ethers::core::types::Bytes = ::ethers::core::types::Bytes::from_static(
224 __DEPLOYED_BYTECODE,
225 );
226 pub struct HoprTicketPriceOracle<M>(::ethers::contract::Contract<M>);
227 impl<M> ::core::clone::Clone for HoprTicketPriceOracle<M> {
228 fn clone(&self) -> Self {
229 Self(::core::clone::Clone::clone(&self.0))
230 }
231 }
232 impl<M> ::core::ops::Deref for HoprTicketPriceOracle<M> {
233 type Target = ::ethers::contract::Contract<M>;
234 fn deref(&self) -> &Self::Target {
235 &self.0
236 }
237 }
238 impl<M> ::core::ops::DerefMut for HoprTicketPriceOracle<M> {
239 fn deref_mut(&mut self) -> &mut Self::Target {
240 &mut self.0
241 }
242 }
243 impl<M> ::core::fmt::Debug for HoprTicketPriceOracle<M> {
244 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
245 f.debug_tuple(::core::stringify!(HoprTicketPriceOracle))
246 .field(&self.address())
247 .finish()
248 }
249 }
250 impl<M: ::ethers::providers::Middleware> HoprTicketPriceOracle<M> {
251 pub fn new<T: Into<::ethers::core::types::Address>>(
254 address: T,
255 client: ::std::sync::Arc<M>,
256 ) -> Self {
257 Self(
258 ::ethers::contract::Contract::new(
259 address.into(),
260 HOPRTICKETPRICEORACLE_ABI.clone(),
261 client,
262 ),
263 )
264 }
265 pub fn deploy<T: ::ethers::core::abi::Tokenize>(
289 client: ::std::sync::Arc<M>,
290 constructor_args: T,
291 ) -> ::core::result::Result<
292 ::ethers::contract::builders::ContractDeployer<M, Self>,
293 ::ethers::contract::ContractError<M>,
294 > {
295 let factory = ::ethers::contract::ContractFactory::new(
296 HOPRTICKETPRICEORACLE_ABI.clone(),
297 HOPRTICKETPRICEORACLE_BYTECODE.clone().into(),
298 client,
299 );
300 let deployer = factory.deploy(constructor_args)?;
301 let deployer = ::ethers::contract::ContractDeployer::new(deployer);
302 Ok(deployer)
303 }
304 pub fn current_ticket_price(
306 &self,
307 ) -> ::ethers::contract::builders::ContractCall<M, ::ethers::core::types::U256> {
308 self.0
309 .method_hash([224, 21, 145, 6], ())
310 .expect("method not found (this should never happen)")
311 }
312 pub fn owner(
314 &self,
315 ) -> ::ethers::contract::builders::ContractCall<
316 M,
317 ::ethers::core::types::Address,
318 > {
319 self.0
320 .method_hash([141, 165, 203, 91], ())
321 .expect("method not found (this should never happen)")
322 }
323 pub fn renounce_ownership(
325 &self,
326 ) -> ::ethers::contract::builders::ContractCall<M, ()> {
327 self.0
328 .method_hash([113, 80, 24, 166], ())
329 .expect("method not found (this should never happen)")
330 }
331 pub fn set_ticket_price(
333 &self,
334 new_ticket_price: ::ethers::core::types::U256,
335 ) -> ::ethers::contract::builders::ContractCall<M, ()> {
336 self.0
337 .method_hash([21, 152, 22, 80], new_ticket_price)
338 .expect("method not found (this should never happen)")
339 }
340 pub fn transfer_ownership(
342 &self,
343 new_owner: ::ethers::core::types::Address,
344 ) -> ::ethers::contract::builders::ContractCall<M, ()> {
345 self.0
346 .method_hash([242, 253, 227, 139], new_owner)
347 .expect("method not found (this should never happen)")
348 }
349 pub fn ownership_transferred_filter(
351 &self,
352 ) -> ::ethers::contract::builders::Event<
353 ::std::sync::Arc<M>,
354 M,
355 OwnershipTransferredFilter,
356 > {
357 self.0.event()
358 }
359 pub fn ticket_price_updated_filter(
361 &self,
362 ) -> ::ethers::contract::builders::Event<
363 ::std::sync::Arc<M>,
364 M,
365 TicketPriceUpdatedFilter,
366 > {
367 self.0.event()
368 }
369 pub fn events(
371 &self,
372 ) -> ::ethers::contract::builders::Event<
373 ::std::sync::Arc<M>,
374 M,
375 HoprTicketPriceOracleEvents,
376 > {
377 self.0.event_with_filter(::core::default::Default::default())
378 }
379 }
380 impl<M: ::ethers::providers::Middleware> From<::ethers::contract::Contract<M>>
381 for HoprTicketPriceOracle<M> {
382 fn from(contract: ::ethers::contract::Contract<M>) -> Self {
383 Self::new(contract.address(), contract.client())
384 }
385 }
386 #[derive(
388 Clone,
389 ::ethers::contract::EthError,
390 ::ethers::contract::EthDisplay,
391 serde::Serialize,
392 serde::Deserialize,
393 Default,
394 Debug,
395 PartialEq,
396 Eq,
397 Hash
398 )]
399 #[etherror(name = "TicketPriceMustNotBeSame", abi = "TicketPriceMustNotBeSame()")]
400 pub struct TicketPriceMustNotBeSame;
401 #[derive(
403 Clone,
404 ::ethers::contract::EthError,
405 ::ethers::contract::EthDisplay,
406 serde::Serialize,
407 serde::Deserialize,
408 Default,
409 Debug,
410 PartialEq,
411 Eq,
412 Hash
413 )]
414 #[etherror(name = "TicketPriceMustNotBeZero", abi = "TicketPriceMustNotBeZero()")]
415 pub struct TicketPriceMustNotBeZero;
416 #[derive(
418 Clone,
419 ::ethers::contract::EthAbiType,
420 serde::Serialize,
421 serde::Deserialize,
422 Debug,
423 PartialEq,
424 Eq,
425 Hash
426 )]
427 pub enum HoprTicketPriceOracleErrors {
428 TicketPriceMustNotBeSame(TicketPriceMustNotBeSame),
429 TicketPriceMustNotBeZero(TicketPriceMustNotBeZero),
430 RevertString(::std::string::String),
433 }
434 impl ::ethers::core::abi::AbiDecode for HoprTicketPriceOracleErrors {
435 fn decode(
436 data: impl AsRef<[u8]>,
437 ) -> ::core::result::Result<Self, ::ethers::core::abi::AbiError> {
438 let data = data.as_ref();
439 if let Ok(decoded) = <::std::string::String as ::ethers::core::abi::AbiDecode>::decode(
440 data,
441 ) {
442 return Ok(Self::RevertString(decoded));
443 }
444 if let Ok(decoded) = <TicketPriceMustNotBeSame as ::ethers::core::abi::AbiDecode>::decode(
445 data,
446 ) {
447 return Ok(Self::TicketPriceMustNotBeSame(decoded));
448 }
449 if let Ok(decoded) = <TicketPriceMustNotBeZero as ::ethers::core::abi::AbiDecode>::decode(
450 data,
451 ) {
452 return Ok(Self::TicketPriceMustNotBeZero(decoded));
453 }
454 Err(::ethers::core::abi::Error::InvalidData.into())
455 }
456 }
457 impl ::ethers::core::abi::AbiEncode for HoprTicketPriceOracleErrors {
458 fn encode(self) -> ::std::vec::Vec<u8> {
459 match self {
460 Self::TicketPriceMustNotBeSame(element) => {
461 ::ethers::core::abi::AbiEncode::encode(element)
462 }
463 Self::TicketPriceMustNotBeZero(element) => {
464 ::ethers::core::abi::AbiEncode::encode(element)
465 }
466 Self::RevertString(s) => ::ethers::core::abi::AbiEncode::encode(s),
467 }
468 }
469 }
470 impl ::ethers::contract::ContractRevert for HoprTicketPriceOracleErrors {
471 fn valid_selector(selector: [u8; 4]) -> bool {
472 match selector {
473 [0x08, 0xc3, 0x79, 0xa0] => true,
474 _ if selector
475 == <TicketPriceMustNotBeSame as ::ethers::contract::EthError>::selector() => {
476 true
477 }
478 _ if selector
479 == <TicketPriceMustNotBeZero as ::ethers::contract::EthError>::selector() => {
480 true
481 }
482 _ => false,
483 }
484 }
485 }
486 impl ::core::fmt::Display for HoprTicketPriceOracleErrors {
487 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
488 match self {
489 Self::TicketPriceMustNotBeSame(element) => {
490 ::core::fmt::Display::fmt(element, f)
491 }
492 Self::TicketPriceMustNotBeZero(element) => {
493 ::core::fmt::Display::fmt(element, f)
494 }
495 Self::RevertString(s) => ::core::fmt::Display::fmt(s, f),
496 }
497 }
498 }
499 impl ::core::convert::From<::std::string::String> for HoprTicketPriceOracleErrors {
500 fn from(value: String) -> Self {
501 Self::RevertString(value)
502 }
503 }
504 impl ::core::convert::From<TicketPriceMustNotBeSame>
505 for HoprTicketPriceOracleErrors {
506 fn from(value: TicketPriceMustNotBeSame) -> Self {
507 Self::TicketPriceMustNotBeSame(value)
508 }
509 }
510 impl ::core::convert::From<TicketPriceMustNotBeZero>
511 for HoprTicketPriceOracleErrors {
512 fn from(value: TicketPriceMustNotBeZero) -> Self {
513 Self::TicketPriceMustNotBeZero(value)
514 }
515 }
516 #[derive(
517 Clone,
518 ::ethers::contract::EthEvent,
519 ::ethers::contract::EthDisplay,
520 serde::Serialize,
521 serde::Deserialize,
522 Default,
523 Debug,
524 PartialEq,
525 Eq,
526 Hash
527 )]
528 #[ethevent(
529 name = "OwnershipTransferred",
530 abi = "OwnershipTransferred(address,address)"
531 )]
532 pub struct OwnershipTransferredFilter {
533 #[ethevent(indexed)]
534 pub previous_owner: ::ethers::core::types::Address,
535 #[ethevent(indexed)]
536 pub new_owner: ::ethers::core::types::Address,
537 }
538 #[derive(
539 Clone,
540 ::ethers::contract::EthEvent,
541 ::ethers::contract::EthDisplay,
542 serde::Serialize,
543 serde::Deserialize,
544 Default,
545 Debug,
546 PartialEq,
547 Eq,
548 Hash
549 )]
550 #[ethevent(name = "TicketPriceUpdated", abi = "TicketPriceUpdated(uint256,uint256)")]
551 pub struct TicketPriceUpdatedFilter(
552 pub ::ethers::core::types::U256,
553 pub ::ethers::core::types::U256,
554 );
555 #[derive(
557 Clone,
558 ::ethers::contract::EthAbiType,
559 serde::Serialize,
560 serde::Deserialize,
561 Debug,
562 PartialEq,
563 Eq,
564 Hash
565 )]
566 pub enum HoprTicketPriceOracleEvents {
567 OwnershipTransferredFilter(OwnershipTransferredFilter),
568 TicketPriceUpdatedFilter(TicketPriceUpdatedFilter),
569 }
570 impl ::ethers::contract::EthLogDecode for HoprTicketPriceOracleEvents {
571 fn decode_log(
572 log: &::ethers::core::abi::RawLog,
573 ) -> ::core::result::Result<Self, ::ethers::core::abi::Error> {
574 if let Ok(decoded) = OwnershipTransferredFilter::decode_log(log) {
575 return Ok(
576 HoprTicketPriceOracleEvents::OwnershipTransferredFilter(decoded),
577 );
578 }
579 if let Ok(decoded) = TicketPriceUpdatedFilter::decode_log(log) {
580 return Ok(
581 HoprTicketPriceOracleEvents::TicketPriceUpdatedFilter(decoded),
582 );
583 }
584 Err(::ethers::core::abi::Error::InvalidData)
585 }
586 }
587 impl ::core::fmt::Display for HoprTicketPriceOracleEvents {
588 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
589 match self {
590 Self::OwnershipTransferredFilter(element) => {
591 ::core::fmt::Display::fmt(element, f)
592 }
593 Self::TicketPriceUpdatedFilter(element) => {
594 ::core::fmt::Display::fmt(element, f)
595 }
596 }
597 }
598 }
599 impl ::core::convert::From<OwnershipTransferredFilter>
600 for HoprTicketPriceOracleEvents {
601 fn from(value: OwnershipTransferredFilter) -> Self {
602 Self::OwnershipTransferredFilter(value)
603 }
604 }
605 impl ::core::convert::From<TicketPriceUpdatedFilter>
606 for HoprTicketPriceOracleEvents {
607 fn from(value: TicketPriceUpdatedFilter) -> Self {
608 Self::TicketPriceUpdatedFilter(value)
609 }
610 }
611 #[derive(
613 Clone,
614 ::ethers::contract::EthCall,
615 ::ethers::contract::EthDisplay,
616 serde::Serialize,
617 serde::Deserialize,
618 Default,
619 Debug,
620 PartialEq,
621 Eq,
622 Hash
623 )]
624 #[ethcall(name = "currentTicketPrice", abi = "currentTicketPrice()")]
625 pub struct CurrentTicketPriceCall;
626 #[derive(
628 Clone,
629 ::ethers::contract::EthCall,
630 ::ethers::contract::EthDisplay,
631 serde::Serialize,
632 serde::Deserialize,
633 Default,
634 Debug,
635 PartialEq,
636 Eq,
637 Hash
638 )]
639 #[ethcall(name = "owner", abi = "owner()")]
640 pub struct OwnerCall;
641 #[derive(
643 Clone,
644 ::ethers::contract::EthCall,
645 ::ethers::contract::EthDisplay,
646 serde::Serialize,
647 serde::Deserialize,
648 Default,
649 Debug,
650 PartialEq,
651 Eq,
652 Hash
653 )]
654 #[ethcall(name = "renounceOwnership", abi = "renounceOwnership()")]
655 pub struct RenounceOwnershipCall;
656 #[derive(
658 Clone,
659 ::ethers::contract::EthCall,
660 ::ethers::contract::EthDisplay,
661 serde::Serialize,
662 serde::Deserialize,
663 Default,
664 Debug,
665 PartialEq,
666 Eq,
667 Hash
668 )]
669 #[ethcall(name = "setTicketPrice", abi = "setTicketPrice(uint256)")]
670 pub struct SetTicketPriceCall {
671 pub new_ticket_price: ::ethers::core::types::U256,
672 }
673 #[derive(
675 Clone,
676 ::ethers::contract::EthCall,
677 ::ethers::contract::EthDisplay,
678 serde::Serialize,
679 serde::Deserialize,
680 Default,
681 Debug,
682 PartialEq,
683 Eq,
684 Hash
685 )]
686 #[ethcall(name = "transferOwnership", abi = "transferOwnership(address)")]
687 pub struct TransferOwnershipCall {
688 pub new_owner: ::ethers::core::types::Address,
689 }
690 #[derive(
692 Clone,
693 ::ethers::contract::EthAbiType,
694 serde::Serialize,
695 serde::Deserialize,
696 Debug,
697 PartialEq,
698 Eq,
699 Hash
700 )]
701 pub enum HoprTicketPriceOracleCalls {
702 CurrentTicketPrice(CurrentTicketPriceCall),
703 Owner(OwnerCall),
704 RenounceOwnership(RenounceOwnershipCall),
705 SetTicketPrice(SetTicketPriceCall),
706 TransferOwnership(TransferOwnershipCall),
707 }
708 impl ::ethers::core::abi::AbiDecode for HoprTicketPriceOracleCalls {
709 fn decode(
710 data: impl AsRef<[u8]>,
711 ) -> ::core::result::Result<Self, ::ethers::core::abi::AbiError> {
712 let data = data.as_ref();
713 if let Ok(decoded) = <CurrentTicketPriceCall as ::ethers::core::abi::AbiDecode>::decode(
714 data,
715 ) {
716 return Ok(Self::CurrentTicketPrice(decoded));
717 }
718 if let Ok(decoded) = <OwnerCall as ::ethers::core::abi::AbiDecode>::decode(
719 data,
720 ) {
721 return Ok(Self::Owner(decoded));
722 }
723 if let Ok(decoded) = <RenounceOwnershipCall as ::ethers::core::abi::AbiDecode>::decode(
724 data,
725 ) {
726 return Ok(Self::RenounceOwnership(decoded));
727 }
728 if let Ok(decoded) = <SetTicketPriceCall as ::ethers::core::abi::AbiDecode>::decode(
729 data,
730 ) {
731 return Ok(Self::SetTicketPrice(decoded));
732 }
733 if let Ok(decoded) = <TransferOwnershipCall as ::ethers::core::abi::AbiDecode>::decode(
734 data,
735 ) {
736 return Ok(Self::TransferOwnership(decoded));
737 }
738 Err(::ethers::core::abi::Error::InvalidData.into())
739 }
740 }
741 impl ::ethers::core::abi::AbiEncode for HoprTicketPriceOracleCalls {
742 fn encode(self) -> Vec<u8> {
743 match self {
744 Self::CurrentTicketPrice(element) => {
745 ::ethers::core::abi::AbiEncode::encode(element)
746 }
747 Self::Owner(element) => ::ethers::core::abi::AbiEncode::encode(element),
748 Self::RenounceOwnership(element) => {
749 ::ethers::core::abi::AbiEncode::encode(element)
750 }
751 Self::SetTicketPrice(element) => {
752 ::ethers::core::abi::AbiEncode::encode(element)
753 }
754 Self::TransferOwnership(element) => {
755 ::ethers::core::abi::AbiEncode::encode(element)
756 }
757 }
758 }
759 }
760 impl ::core::fmt::Display for HoprTicketPriceOracleCalls {
761 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
762 match self {
763 Self::CurrentTicketPrice(element) => {
764 ::core::fmt::Display::fmt(element, f)
765 }
766 Self::Owner(element) => ::core::fmt::Display::fmt(element, f),
767 Self::RenounceOwnership(element) => ::core::fmt::Display::fmt(element, f),
768 Self::SetTicketPrice(element) => ::core::fmt::Display::fmt(element, f),
769 Self::TransferOwnership(element) => ::core::fmt::Display::fmt(element, f),
770 }
771 }
772 }
773 impl ::core::convert::From<CurrentTicketPriceCall> for HoprTicketPriceOracleCalls {
774 fn from(value: CurrentTicketPriceCall) -> Self {
775 Self::CurrentTicketPrice(value)
776 }
777 }
778 impl ::core::convert::From<OwnerCall> for HoprTicketPriceOracleCalls {
779 fn from(value: OwnerCall) -> Self {
780 Self::Owner(value)
781 }
782 }
783 impl ::core::convert::From<RenounceOwnershipCall> for HoprTicketPriceOracleCalls {
784 fn from(value: RenounceOwnershipCall) -> Self {
785 Self::RenounceOwnership(value)
786 }
787 }
788 impl ::core::convert::From<SetTicketPriceCall> for HoprTicketPriceOracleCalls {
789 fn from(value: SetTicketPriceCall) -> Self {
790 Self::SetTicketPrice(value)
791 }
792 }
793 impl ::core::convert::From<TransferOwnershipCall> for HoprTicketPriceOracleCalls {
794 fn from(value: TransferOwnershipCall) -> Self {
795 Self::TransferOwnership(value)
796 }
797 }
798 #[derive(
800 Clone,
801 ::ethers::contract::EthAbiType,
802 ::ethers::contract::EthAbiCodec,
803 serde::Serialize,
804 serde::Deserialize,
805 Default,
806 Debug,
807 PartialEq,
808 Eq,
809 Hash
810 )]
811 pub struct CurrentTicketPriceReturn(pub ::ethers::core::types::U256);
812 #[derive(
814 Clone,
815 ::ethers::contract::EthAbiType,
816 ::ethers::contract::EthAbiCodec,
817 serde::Serialize,
818 serde::Deserialize,
819 Default,
820 Debug,
821 PartialEq,
822 Eq,
823 Hash
824 )]
825 pub struct OwnerReturn(pub ::ethers::core::types::Address);
826}