1pub use ierc777::*;
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 ierc777 {
13 #[rustfmt::skip]
14 const __ABI: &str = "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"address\",\"name\":\"tokenHolder\",\"type\":\"address\",\"components\":[],\"indexed\":true}],\"type\":\"event\",\"name\":\"AuthorizedOperator\",\"outputs\":[],\"anonymous\":false},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\",\"components\":[],\"indexed\":false},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\",\"components\":[],\"indexed\":false},{\"internalType\":\"bytes\",\"name\":\"operatorData\",\"type\":\"bytes\",\"components\":[],\"indexed\":false}],\"type\":\"event\",\"name\":\"Burned\",\"outputs\":[],\"anonymous\":false},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\",\"components\":[],\"indexed\":false},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\",\"components\":[],\"indexed\":false},{\"internalType\":\"bytes\",\"name\":\"operatorData\",\"type\":\"bytes\",\"components\":[],\"indexed\":false}],\"type\":\"event\",\"name\":\"Minted\",\"outputs\":[],\"anonymous\":false},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"address\",\"name\":\"tokenHolder\",\"type\":\"address\",\"components\":[],\"indexed\":true}],\"type\":\"event\",\"name\":\"RevokedOperator\",\"outputs\":[],\"anonymous\":false},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\",\"components\":[],\"indexed\":false},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\",\"components\":[],\"indexed\":false},{\"internalType\":\"bytes\",\"name\":\"operatorData\",\"type\":\"bytes\",\"components\":[],\"indexed\":false}],\"type\":\"event\",\"name\":\"Sent\",\"outputs\":[],\"anonymous\":false},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"authorizeOperator\",\"outputs\":[]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\",\"components\":[]},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"burn\",\"outputs\":[]},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"defaultOperators\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\",\"components\":[]}]},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"granularity\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"address\",\"name\":\"tokenHolder\",\"type\":\"address\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"isOperatorFor\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\",\"components\":[]}]},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\",\"components\":[]},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\",\"components\":[]},{\"internalType\":\"bytes\",\"name\":\"operatorData\",\"type\":\"bytes\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"operatorBurn\",\"outputs\":[]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\",\"components\":[]},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\",\"components\":[]},{\"internalType\":\"bytes\",\"name\":\"operatorData\",\"type\":\"bytes\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"operatorSend\",\"outputs\":[]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"revokeOperator\",\"outputs\":[]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\",\"components\":[]},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"send\",\"outputs\":[]},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\",\"components\":[]}]},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\",\"components\":[]}]}]";
15 pub static IERC777_ABI: ::ethers_contract::Lazy<::ethers_core::abi::Abi> = ::ethers_contract::Lazy::new(||
17 ::ethers_core::utils::__serde_json::from_str(__ABI).expect("ABI is always valid"));
18 pub struct IERC777<M>(::ethers_contract::Contract<M>);
19 impl<M> ::core::clone::Clone for IERC777<M> {
20 fn clone(&self) -> Self {
21 Self(::core::clone::Clone::clone(&self.0))
22 }
23 }
24 impl<M> ::core::ops::Deref for IERC777<M> {
25 type Target = ::ethers_contract::Contract<M>;
26 fn deref(&self) -> &Self::Target {
27 &self.0
28 }
29 }
30 impl<M> ::core::ops::DerefMut for IERC777<M> {
31 fn deref_mut(&mut self) -> &mut Self::Target {
32 &mut self.0
33 }
34 }
35 impl<M> ::core::fmt::Debug for IERC777<M> {
36 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
37 f.debug_tuple(stringify!(IERC777)).field(&self.address()).finish()
38 }
39 }
40 impl<M: ::ethers_providers::Middleware> IERC777<M> {
41 pub fn new<T: Into<::ethers_core::types::Address>>(
44 address: T,
45 client: ::std::sync::Arc<M>,
46 ) -> Self {
47 Self(
48 ::ethers_contract::Contract::new(
49 address.into(),
50 IERC777_ABI.clone(),
51 client,
52 ),
53 )
54 }
55 pub fn authorize_operator(
57 &self,
58 operator: ::ethers_core::types::Address,
59 ) -> ::ethers_contract::builders::ContractCall<M, ()> {
60 self.0
61 .method_hash([149, 155, 140, 63], operator)
62 .expect("method not found (this should never happen)")
63 }
64 pub fn balance_of(
66 &self,
67 owner: ::ethers_core::types::Address,
68 ) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
69 self.0
70 .method_hash([112, 160, 130, 49], owner)
71 .expect("method not found (this should never happen)")
72 }
73 pub fn burn(
75 &self,
76 amount: ::ethers_core::types::U256,
77 data: ::ethers_core::types::Bytes,
78 ) -> ::ethers_contract::builders::ContractCall<M, ()> {
79 self.0
80 .method_hash([254, 157, 147, 3], (amount, data))
81 .expect("method not found (this should never happen)")
82 }
83 pub fn default_operators(
85 &self,
86 ) -> ::ethers_contract::builders::ContractCall<
87 M,
88 ::std::vec::Vec<::ethers_core::types::Address>,
89 > {
90 self.0
91 .method_hash([6, 228, 133, 56], ())
92 .expect("method not found (this should never happen)")
93 }
94 pub fn granularity(
96 &self,
97 ) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
98 self.0
99 .method_hash([85, 111, 13, 199], ())
100 .expect("method not found (this should never happen)")
101 }
102 pub fn is_operator_for(
104 &self,
105 operator: ::ethers_core::types::Address,
106 token_holder: ::ethers_core::types::Address,
107 ) -> ::ethers_contract::builders::ContractCall<M, bool> {
108 self.0
109 .method_hash([217, 91, 99, 113], (operator, token_holder))
110 .expect("method not found (this should never happen)")
111 }
112 pub fn name(
114 &self,
115 ) -> ::ethers_contract::builders::ContractCall<M, ::std::string::String> {
116 self.0
117 .method_hash([6, 253, 222, 3], ())
118 .expect("method not found (this should never happen)")
119 }
120 pub fn operator_burn(
122 &self,
123 account: ::ethers_core::types::Address,
124 amount: ::ethers_core::types::U256,
125 data: ::ethers_core::types::Bytes,
126 operator_data: ::ethers_core::types::Bytes,
127 ) -> ::ethers_contract::builders::ContractCall<M, ()> {
128 self.0
129 .method_hash([252, 103, 60, 79], (account, amount, data, operator_data))
130 .expect("method not found (this should never happen)")
131 }
132 pub fn operator_send(
134 &self,
135 sender: ::ethers_core::types::Address,
136 recipient: ::ethers_core::types::Address,
137 amount: ::ethers_core::types::U256,
138 data: ::ethers_core::types::Bytes,
139 operator_data: ::ethers_core::types::Bytes,
140 ) -> ::ethers_contract::builders::ContractCall<M, ()> {
141 self.0
142 .method_hash(
143 [98, 173, 27, 131],
144 (sender, recipient, amount, data, operator_data),
145 )
146 .expect("method not found (this should never happen)")
147 }
148 pub fn revoke_operator(
150 &self,
151 operator: ::ethers_core::types::Address,
152 ) -> ::ethers_contract::builders::ContractCall<M, ()> {
153 self.0
154 .method_hash([250, 216, 179, 42], operator)
155 .expect("method not found (this should never happen)")
156 }
157 pub fn send(
159 &self,
160 recipient: ::ethers_core::types::Address,
161 amount: ::ethers_core::types::U256,
162 data: ::ethers_core::types::Bytes,
163 ) -> ::ethers_contract::builders::ContractCall<M, ()> {
164 self.0
165 .method_hash([155, 217, 187, 198], (recipient, amount, data))
166 .expect("method not found (this should never happen)")
167 }
168 pub fn symbol(
170 &self,
171 ) -> ::ethers_contract::builders::ContractCall<M, ::std::string::String> {
172 self.0
173 .method_hash([149, 216, 155, 65], ())
174 .expect("method not found (this should never happen)")
175 }
176 pub fn total_supply(
178 &self,
179 ) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
180 self.0
181 .method_hash([24, 22, 13, 221], ())
182 .expect("method not found (this should never happen)")
183 }
184 pub fn authorized_operator_filter(
186 &self,
187 ) -> ::ethers_contract::builders::Event<
188 ::std::sync::Arc<M>,
189 M,
190 AuthorizedOperatorFilter,
191 > {
192 self.0.event()
193 }
194 pub fn burned_filter(
196 &self,
197 ) -> ::ethers_contract::builders::Event<::std::sync::Arc<M>, M, BurnedFilter> {
198 self.0.event()
199 }
200 pub fn minted_filter(
202 &self,
203 ) -> ::ethers_contract::builders::Event<::std::sync::Arc<M>, M, MintedFilter> {
204 self.0.event()
205 }
206 pub fn revoked_operator_filter(
208 &self,
209 ) -> ::ethers_contract::builders::Event<
210 ::std::sync::Arc<M>,
211 M,
212 RevokedOperatorFilter,
213 > {
214 self.0.event()
215 }
216 pub fn sent_filter(
218 &self,
219 ) -> ::ethers_contract::builders::Event<::std::sync::Arc<M>, M, SentFilter> {
220 self.0.event()
221 }
222 pub fn events(
224 &self,
225 ) -> ::ethers_contract::builders::Event<::std::sync::Arc<M>, M, IERC777Events> {
226 self.0.event_with_filter(::core::default::Default::default())
227 }
228 }
229 impl<M: ::ethers_providers::Middleware> From<::ethers_contract::Contract<M>>
230 for IERC777<M> {
231 fn from(contract: ::ethers_contract::Contract<M>) -> Self {
232 Self::new(contract.address(), contract.client())
233 }
234 }
235 #[derive(
236 Clone,
237 ::ethers_contract::EthEvent,
238 ::ethers_contract::EthDisplay,
239 Default,
240 Debug,
241 PartialEq,
242 Eq,
243 Hash
244 )]
245 #[ethevent(name = "AuthorizedOperator", abi = "AuthorizedOperator(address,address)")]
246 pub struct AuthorizedOperatorFilter {
247 #[ethevent(indexed)]
248 pub operator: ::ethers_core::types::Address,
249 #[ethevent(indexed)]
250 pub token_holder: ::ethers_core::types::Address,
251 }
252 #[derive(
253 Clone,
254 ::ethers_contract::EthEvent,
255 ::ethers_contract::EthDisplay,
256 Default,
257 Debug,
258 PartialEq,
259 Eq,
260 Hash
261 )]
262 #[ethevent(name = "Burned", abi = "Burned(address,address,uint256,bytes,bytes)")]
263 pub struct BurnedFilter {
264 #[ethevent(indexed)]
265 pub operator: ::ethers_core::types::Address,
266 #[ethevent(indexed)]
267 pub from: ::ethers_core::types::Address,
268 pub amount: ::ethers_core::types::U256,
269 pub data: ::ethers_core::types::Bytes,
270 pub operator_data: ::ethers_core::types::Bytes,
271 }
272 #[derive(
273 Clone,
274 ::ethers_contract::EthEvent,
275 ::ethers_contract::EthDisplay,
276 Default,
277 Debug,
278 PartialEq,
279 Eq,
280 Hash
281 )]
282 #[ethevent(name = "Minted", abi = "Minted(address,address,uint256,bytes,bytes)")]
283 pub struct MintedFilter {
284 #[ethevent(indexed)]
285 pub operator: ::ethers_core::types::Address,
286 #[ethevent(indexed)]
287 pub to: ::ethers_core::types::Address,
288 pub amount: ::ethers_core::types::U256,
289 pub data: ::ethers_core::types::Bytes,
290 pub operator_data: ::ethers_core::types::Bytes,
291 }
292 #[derive(
293 Clone,
294 ::ethers_contract::EthEvent,
295 ::ethers_contract::EthDisplay,
296 Default,
297 Debug,
298 PartialEq,
299 Eq,
300 Hash
301 )]
302 #[ethevent(name = "RevokedOperator", abi = "RevokedOperator(address,address)")]
303 pub struct RevokedOperatorFilter {
304 #[ethevent(indexed)]
305 pub operator: ::ethers_core::types::Address,
306 #[ethevent(indexed)]
307 pub token_holder: ::ethers_core::types::Address,
308 }
309 #[derive(
310 Clone,
311 ::ethers_contract::EthEvent,
312 ::ethers_contract::EthDisplay,
313 Default,
314 Debug,
315 PartialEq,
316 Eq,
317 Hash
318 )]
319 #[ethevent(name = "Sent", abi = "Sent(address,address,address,uint256,bytes,bytes)")]
320 pub struct SentFilter {
321 #[ethevent(indexed)]
322 pub operator: ::ethers_core::types::Address,
323 #[ethevent(indexed)]
324 pub from: ::ethers_core::types::Address,
325 #[ethevent(indexed)]
326 pub to: ::ethers_core::types::Address,
327 pub amount: ::ethers_core::types::U256,
328 pub data: ::ethers_core::types::Bytes,
329 pub operator_data: ::ethers_core::types::Bytes,
330 }
331 #[derive(Clone, ::ethers_contract::EthAbiType, Debug, PartialEq, Eq, Hash)]
333 pub enum IERC777Events {
334 AuthorizedOperatorFilter(AuthorizedOperatorFilter),
335 BurnedFilter(BurnedFilter),
336 MintedFilter(MintedFilter),
337 RevokedOperatorFilter(RevokedOperatorFilter),
338 SentFilter(SentFilter),
339 }
340 impl ::ethers_contract::EthLogDecode for IERC777Events {
341 fn decode_log(
342 log: &::ethers_core::abi::RawLog,
343 ) -> ::core::result::Result<Self, ::ethers_core::abi::Error> {
344 if let Ok(decoded) = AuthorizedOperatorFilter::decode_log(log) {
345 return Ok(IERC777Events::AuthorizedOperatorFilter(decoded));
346 }
347 if let Ok(decoded) = BurnedFilter::decode_log(log) {
348 return Ok(IERC777Events::BurnedFilter(decoded));
349 }
350 if let Ok(decoded) = MintedFilter::decode_log(log) {
351 return Ok(IERC777Events::MintedFilter(decoded));
352 }
353 if let Ok(decoded) = RevokedOperatorFilter::decode_log(log) {
354 return Ok(IERC777Events::RevokedOperatorFilter(decoded));
355 }
356 if let Ok(decoded) = SentFilter::decode_log(log) {
357 return Ok(IERC777Events::SentFilter(decoded));
358 }
359 Err(::ethers_core::abi::Error::InvalidData)
360 }
361 }
362 impl ::core::fmt::Display for IERC777Events {
363 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
364 match self {
365 Self::AuthorizedOperatorFilter(element) => {
366 ::core::fmt::Display::fmt(element, f)
367 }
368 Self::BurnedFilter(element) => ::core::fmt::Display::fmt(element, f),
369 Self::MintedFilter(element) => ::core::fmt::Display::fmt(element, f),
370 Self::RevokedOperatorFilter(element) => {
371 ::core::fmt::Display::fmt(element, f)
372 }
373 Self::SentFilter(element) => ::core::fmt::Display::fmt(element, f),
374 }
375 }
376 }
377 impl ::core::convert::From<AuthorizedOperatorFilter> for IERC777Events {
378 fn from(value: AuthorizedOperatorFilter) -> Self {
379 Self::AuthorizedOperatorFilter(value)
380 }
381 }
382 impl ::core::convert::From<BurnedFilter> for IERC777Events {
383 fn from(value: BurnedFilter) -> Self {
384 Self::BurnedFilter(value)
385 }
386 }
387 impl ::core::convert::From<MintedFilter> for IERC777Events {
388 fn from(value: MintedFilter) -> Self {
389 Self::MintedFilter(value)
390 }
391 }
392 impl ::core::convert::From<RevokedOperatorFilter> for IERC777Events {
393 fn from(value: RevokedOperatorFilter) -> Self {
394 Self::RevokedOperatorFilter(value)
395 }
396 }
397 impl ::core::convert::From<SentFilter> for IERC777Events {
398 fn from(value: SentFilter) -> Self {
399 Self::SentFilter(value)
400 }
401 }
402 #[derive(
404 Clone,
405 ::ethers_contract::EthCall,
406 ::ethers_contract::EthDisplay,
407 Default,
408 Debug,
409 PartialEq,
410 Eq,
411 Hash
412 )]
413 #[ethcall(name = "authorizeOperator", abi = "authorizeOperator(address)")]
414 pub struct AuthorizeOperatorCall {
415 pub operator: ::ethers_core::types::Address,
416 }
417 #[derive(
419 Clone,
420 ::ethers_contract::EthCall,
421 ::ethers_contract::EthDisplay,
422 Default,
423 Debug,
424 PartialEq,
425 Eq,
426 Hash
427 )]
428 #[ethcall(name = "balanceOf", abi = "balanceOf(address)")]
429 pub struct BalanceOfCall {
430 pub owner: ::ethers_core::types::Address,
431 }
432 #[derive(
434 Clone,
435 ::ethers_contract::EthCall,
436 ::ethers_contract::EthDisplay,
437 Default,
438 Debug,
439 PartialEq,
440 Eq,
441 Hash
442 )]
443 #[ethcall(name = "burn", abi = "burn(uint256,bytes)")]
444 pub struct BurnCall {
445 pub amount: ::ethers_core::types::U256,
446 pub data: ::ethers_core::types::Bytes,
447 }
448 #[derive(
450 Clone,
451 ::ethers_contract::EthCall,
452 ::ethers_contract::EthDisplay,
453 Default,
454 Debug,
455 PartialEq,
456 Eq,
457 Hash
458 )]
459 #[ethcall(name = "defaultOperators", abi = "defaultOperators()")]
460 pub struct DefaultOperatorsCall;
461 #[derive(
463 Clone,
464 ::ethers_contract::EthCall,
465 ::ethers_contract::EthDisplay,
466 Default,
467 Debug,
468 PartialEq,
469 Eq,
470 Hash
471 )]
472 #[ethcall(name = "granularity", abi = "granularity()")]
473 pub struct GranularityCall;
474 #[derive(
476 Clone,
477 ::ethers_contract::EthCall,
478 ::ethers_contract::EthDisplay,
479 Default,
480 Debug,
481 PartialEq,
482 Eq,
483 Hash
484 )]
485 #[ethcall(name = "isOperatorFor", abi = "isOperatorFor(address,address)")]
486 pub struct IsOperatorForCall {
487 pub operator: ::ethers_core::types::Address,
488 pub token_holder: ::ethers_core::types::Address,
489 }
490 #[derive(
492 Clone,
493 ::ethers_contract::EthCall,
494 ::ethers_contract::EthDisplay,
495 Default,
496 Debug,
497 PartialEq,
498 Eq,
499 Hash
500 )]
501 #[ethcall(name = "name", abi = "name()")]
502 pub struct NameCall;
503 #[derive(
505 Clone,
506 ::ethers_contract::EthCall,
507 ::ethers_contract::EthDisplay,
508 Default,
509 Debug,
510 PartialEq,
511 Eq,
512 Hash
513 )]
514 #[ethcall(name = "operatorBurn", abi = "operatorBurn(address,uint256,bytes,bytes)")]
515 pub struct OperatorBurnCall {
516 pub account: ::ethers_core::types::Address,
517 pub amount: ::ethers_core::types::U256,
518 pub data: ::ethers_core::types::Bytes,
519 pub operator_data: ::ethers_core::types::Bytes,
520 }
521 #[derive(
523 Clone,
524 ::ethers_contract::EthCall,
525 ::ethers_contract::EthDisplay,
526 Default,
527 Debug,
528 PartialEq,
529 Eq,
530 Hash
531 )]
532 #[ethcall(
533 name = "operatorSend",
534 abi = "operatorSend(address,address,uint256,bytes,bytes)"
535 )]
536 pub struct OperatorSendCall {
537 pub sender: ::ethers_core::types::Address,
538 pub recipient: ::ethers_core::types::Address,
539 pub amount: ::ethers_core::types::U256,
540 pub data: ::ethers_core::types::Bytes,
541 pub operator_data: ::ethers_core::types::Bytes,
542 }
543 #[derive(
545 Clone,
546 ::ethers_contract::EthCall,
547 ::ethers_contract::EthDisplay,
548 Default,
549 Debug,
550 PartialEq,
551 Eq,
552 Hash
553 )]
554 #[ethcall(name = "revokeOperator", abi = "revokeOperator(address)")]
555 pub struct RevokeOperatorCall {
556 pub operator: ::ethers_core::types::Address,
557 }
558 #[derive(
560 Clone,
561 ::ethers_contract::EthCall,
562 ::ethers_contract::EthDisplay,
563 Default,
564 Debug,
565 PartialEq,
566 Eq,
567 Hash
568 )]
569 #[ethcall(name = "send", abi = "send(address,uint256,bytes)")]
570 pub struct SendCall {
571 pub recipient: ::ethers_core::types::Address,
572 pub amount: ::ethers_core::types::U256,
573 pub data: ::ethers_core::types::Bytes,
574 }
575 #[derive(
577 Clone,
578 ::ethers_contract::EthCall,
579 ::ethers_contract::EthDisplay,
580 Default,
581 Debug,
582 PartialEq,
583 Eq,
584 Hash
585 )]
586 #[ethcall(name = "symbol", abi = "symbol()")]
587 pub struct SymbolCall;
588 #[derive(
590 Clone,
591 ::ethers_contract::EthCall,
592 ::ethers_contract::EthDisplay,
593 Default,
594 Debug,
595 PartialEq,
596 Eq,
597 Hash
598 )]
599 #[ethcall(name = "totalSupply", abi = "totalSupply()")]
600 pub struct TotalSupplyCall;
601 #[derive(Clone, ::ethers_contract::EthAbiType, Debug, PartialEq, Eq, Hash)]
603 pub enum IERC777Calls {
604 AuthorizeOperator(AuthorizeOperatorCall),
605 BalanceOf(BalanceOfCall),
606 Burn(BurnCall),
607 DefaultOperators(DefaultOperatorsCall),
608 Granularity(GranularityCall),
609 IsOperatorFor(IsOperatorForCall),
610 Name(NameCall),
611 OperatorBurn(OperatorBurnCall),
612 OperatorSend(OperatorSendCall),
613 RevokeOperator(RevokeOperatorCall),
614 Send(SendCall),
615 Symbol(SymbolCall),
616 TotalSupply(TotalSupplyCall),
617 }
618 impl ::ethers_core::abi::AbiDecode for IERC777Calls {
619 fn decode(
620 data: impl AsRef<[u8]>,
621 ) -> ::core::result::Result<Self, ::ethers_core::abi::AbiError> {
622 let data = data.as_ref();
623 if let Ok(decoded)
624 = <AuthorizeOperatorCall as ::ethers_core::abi::AbiDecode>::decode(
625 data,
626 ) {
627 return Ok(Self::AuthorizeOperator(decoded));
628 }
629 if let Ok(decoded)
630 = <BalanceOfCall as ::ethers_core::abi::AbiDecode>::decode(data) {
631 return Ok(Self::BalanceOf(decoded));
632 }
633 if let Ok(decoded)
634 = <BurnCall as ::ethers_core::abi::AbiDecode>::decode(data) {
635 return Ok(Self::Burn(decoded));
636 }
637 if let Ok(decoded)
638 = <DefaultOperatorsCall as ::ethers_core::abi::AbiDecode>::decode(data) {
639 return Ok(Self::DefaultOperators(decoded));
640 }
641 if let Ok(decoded)
642 = <GranularityCall as ::ethers_core::abi::AbiDecode>::decode(data) {
643 return Ok(Self::Granularity(decoded));
644 }
645 if let Ok(decoded)
646 = <IsOperatorForCall as ::ethers_core::abi::AbiDecode>::decode(data) {
647 return Ok(Self::IsOperatorFor(decoded));
648 }
649 if let Ok(decoded)
650 = <NameCall as ::ethers_core::abi::AbiDecode>::decode(data) {
651 return Ok(Self::Name(decoded));
652 }
653 if let Ok(decoded)
654 = <OperatorBurnCall as ::ethers_core::abi::AbiDecode>::decode(data) {
655 return Ok(Self::OperatorBurn(decoded));
656 }
657 if let Ok(decoded)
658 = <OperatorSendCall as ::ethers_core::abi::AbiDecode>::decode(data) {
659 return Ok(Self::OperatorSend(decoded));
660 }
661 if let Ok(decoded)
662 = <RevokeOperatorCall as ::ethers_core::abi::AbiDecode>::decode(data) {
663 return Ok(Self::RevokeOperator(decoded));
664 }
665 if let Ok(decoded)
666 = <SendCall as ::ethers_core::abi::AbiDecode>::decode(data) {
667 return Ok(Self::Send(decoded));
668 }
669 if let Ok(decoded)
670 = <SymbolCall as ::ethers_core::abi::AbiDecode>::decode(data) {
671 return Ok(Self::Symbol(decoded));
672 }
673 if let Ok(decoded)
674 = <TotalSupplyCall as ::ethers_core::abi::AbiDecode>::decode(data) {
675 return Ok(Self::TotalSupply(decoded));
676 }
677 Err(::ethers_core::abi::Error::InvalidData.into())
678 }
679 }
680 impl ::ethers_core::abi::AbiEncode for IERC777Calls {
681 fn encode(self) -> Vec<u8> {
682 match self {
683 Self::AuthorizeOperator(element) => {
684 ::ethers_core::abi::AbiEncode::encode(element)
685 }
686 Self::BalanceOf(element) => {
687 ::ethers_core::abi::AbiEncode::encode(element)
688 }
689 Self::Burn(element) => ::ethers_core::abi::AbiEncode::encode(element),
690 Self::DefaultOperators(element) => {
691 ::ethers_core::abi::AbiEncode::encode(element)
692 }
693 Self::Granularity(element) => {
694 ::ethers_core::abi::AbiEncode::encode(element)
695 }
696 Self::IsOperatorFor(element) => {
697 ::ethers_core::abi::AbiEncode::encode(element)
698 }
699 Self::Name(element) => ::ethers_core::abi::AbiEncode::encode(element),
700 Self::OperatorBurn(element) => {
701 ::ethers_core::abi::AbiEncode::encode(element)
702 }
703 Self::OperatorSend(element) => {
704 ::ethers_core::abi::AbiEncode::encode(element)
705 }
706 Self::RevokeOperator(element) => {
707 ::ethers_core::abi::AbiEncode::encode(element)
708 }
709 Self::Send(element) => ::ethers_core::abi::AbiEncode::encode(element),
710 Self::Symbol(element) => ::ethers_core::abi::AbiEncode::encode(element),
711 Self::TotalSupply(element) => {
712 ::ethers_core::abi::AbiEncode::encode(element)
713 }
714 }
715 }
716 }
717 impl ::core::fmt::Display for IERC777Calls {
718 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
719 match self {
720 Self::AuthorizeOperator(element) => ::core::fmt::Display::fmt(element, f),
721 Self::BalanceOf(element) => ::core::fmt::Display::fmt(element, f),
722 Self::Burn(element) => ::core::fmt::Display::fmt(element, f),
723 Self::DefaultOperators(element) => ::core::fmt::Display::fmt(element, f),
724 Self::Granularity(element) => ::core::fmt::Display::fmt(element, f),
725 Self::IsOperatorFor(element) => ::core::fmt::Display::fmt(element, f),
726 Self::Name(element) => ::core::fmt::Display::fmt(element, f),
727 Self::OperatorBurn(element) => ::core::fmt::Display::fmt(element, f),
728 Self::OperatorSend(element) => ::core::fmt::Display::fmt(element, f),
729 Self::RevokeOperator(element) => ::core::fmt::Display::fmt(element, f),
730 Self::Send(element) => ::core::fmt::Display::fmt(element, f),
731 Self::Symbol(element) => ::core::fmt::Display::fmt(element, f),
732 Self::TotalSupply(element) => ::core::fmt::Display::fmt(element, f),
733 }
734 }
735 }
736 impl ::core::convert::From<AuthorizeOperatorCall> for IERC777Calls {
737 fn from(value: AuthorizeOperatorCall) -> Self {
738 Self::AuthorizeOperator(value)
739 }
740 }
741 impl ::core::convert::From<BalanceOfCall> for IERC777Calls {
742 fn from(value: BalanceOfCall) -> Self {
743 Self::BalanceOf(value)
744 }
745 }
746 impl ::core::convert::From<BurnCall> for IERC777Calls {
747 fn from(value: BurnCall) -> Self {
748 Self::Burn(value)
749 }
750 }
751 impl ::core::convert::From<DefaultOperatorsCall> for IERC777Calls {
752 fn from(value: DefaultOperatorsCall) -> Self {
753 Self::DefaultOperators(value)
754 }
755 }
756 impl ::core::convert::From<GranularityCall> for IERC777Calls {
757 fn from(value: GranularityCall) -> Self {
758 Self::Granularity(value)
759 }
760 }
761 impl ::core::convert::From<IsOperatorForCall> for IERC777Calls {
762 fn from(value: IsOperatorForCall) -> Self {
763 Self::IsOperatorFor(value)
764 }
765 }
766 impl ::core::convert::From<NameCall> for IERC777Calls {
767 fn from(value: NameCall) -> Self {
768 Self::Name(value)
769 }
770 }
771 impl ::core::convert::From<OperatorBurnCall> for IERC777Calls {
772 fn from(value: OperatorBurnCall) -> Self {
773 Self::OperatorBurn(value)
774 }
775 }
776 impl ::core::convert::From<OperatorSendCall> for IERC777Calls {
777 fn from(value: OperatorSendCall) -> Self {
778 Self::OperatorSend(value)
779 }
780 }
781 impl ::core::convert::From<RevokeOperatorCall> for IERC777Calls {
782 fn from(value: RevokeOperatorCall) -> Self {
783 Self::RevokeOperator(value)
784 }
785 }
786 impl ::core::convert::From<SendCall> for IERC777Calls {
787 fn from(value: SendCall) -> Self {
788 Self::Send(value)
789 }
790 }
791 impl ::core::convert::From<SymbolCall> for IERC777Calls {
792 fn from(value: SymbolCall) -> Self {
793 Self::Symbol(value)
794 }
795 }
796 impl ::core::convert::From<TotalSupplyCall> for IERC777Calls {
797 fn from(value: TotalSupplyCall) -> Self {
798 Self::TotalSupply(value)
799 }
800 }
801 #[derive(
803 Clone,
804 ::ethers_contract::EthAbiType,
805 ::ethers_contract::EthAbiCodec,
806 Default,
807 Debug,
808 PartialEq,
809 Eq,
810 Hash
811 )]
812 pub struct BalanceOfReturn(pub ::ethers_core::types::U256);
813 #[derive(
815 Clone,
816 ::ethers_contract::EthAbiType,
817 ::ethers_contract::EthAbiCodec,
818 Default,
819 Debug,
820 PartialEq,
821 Eq,
822 Hash
823 )]
824 pub struct DefaultOperatorsReturn(
825 pub ::std::vec::Vec<::ethers_core::types::Address>,
826 );
827 #[derive(
829 Clone,
830 ::ethers_contract::EthAbiType,
831 ::ethers_contract::EthAbiCodec,
832 Default,
833 Debug,
834 PartialEq,
835 Eq,
836 Hash
837 )]
838 pub struct GranularityReturn(pub ::ethers_core::types::U256);
839 #[derive(
841 Clone,
842 ::ethers_contract::EthAbiType,
843 ::ethers_contract::EthAbiCodec,
844 Default,
845 Debug,
846 PartialEq,
847 Eq,
848 Hash
849 )]
850 pub struct IsOperatorForReturn(pub bool);
851 #[derive(
853 Clone,
854 ::ethers_contract::EthAbiType,
855 ::ethers_contract::EthAbiCodec,
856 Default,
857 Debug,
858 PartialEq,
859 Eq,
860 Hash
861 )]
862 pub struct NameReturn(pub ::std::string::String);
863 #[derive(
865 Clone,
866 ::ethers_contract::EthAbiType,
867 ::ethers_contract::EthAbiCodec,
868 Default,
869 Debug,
870 PartialEq,
871 Eq,
872 Hash
873 )]
874 pub struct SymbolReturn(pub ::std::string::String);
875 #[derive(
877 Clone,
878 ::ethers_contract::EthAbiType,
879 ::ethers_contract::EthAbiCodec,
880 Default,
881 Debug,
882 PartialEq,
883 Eq,
884 Hash
885 )]
886 pub struct TotalSupplyReturn(pub ::ethers_core::types::U256);
887}