1pub use erc721_enumerable::*;
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 erc721_enumerable {
13 #[rustfmt::skip]
14 const __ABI: &str = "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"address\",\"name\":\"approved\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\",\"components\":[],\"indexed\":true}],\"type\":\"event\",\"name\":\"Approval\",\"outputs\":[],\"anonymous\":false},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\",\"components\":[],\"indexed\":false}],\"type\":\"event\",\"name\":\"ApprovalForAll\",\"outputs\":[],\"anonymous\":false},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\",\"components\":[],\"indexed\":true}],\"type\":\"event\",\"name\":\"Transfer\",\"outputs\":[],\"anonymous\":false},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"approve\",\"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\":\"tokenId\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"getApproved\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\",\"components\":[]}]},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"ownerOf\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"safeTransferFrom\",\"outputs\":[]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\",\"components\":[]},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"safeTransferFrom\",\"outputs\":[]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"setApprovalForAll\",\"outputs\":[]},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\",\"components\":[]}]},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"tokenByIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"tokenOfOwnerByIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"tokenURI\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\",\"components\":[]}]},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"transferFrom\",\"outputs\":[]}]";
15 pub static ERC721ENUMERABLE_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 ERC721Enumerable<M>(::ethers_contract::Contract<M>);
19 impl<M> ::core::clone::Clone for ERC721Enumerable<M> {
20 fn clone(&self) -> Self {
21 Self(::core::clone::Clone::clone(&self.0))
22 }
23 }
24 impl<M> ::core::ops::Deref for ERC721Enumerable<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 ERC721Enumerable<M> {
31 fn deref_mut(&mut self) -> &mut Self::Target {
32 &mut self.0
33 }
34 }
35 impl<M> ::core::fmt::Debug for ERC721Enumerable<M> {
36 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
37 f.debug_tuple(stringify!(ERC721Enumerable)).field(&self.address()).finish()
38 }
39 }
40 impl<M: ::ethers_providers::Middleware> ERC721Enumerable<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 ERC721ENUMERABLE_ABI.clone(),
51 client,
52 ),
53 )
54 }
55 pub fn approve(
57 &self,
58 to: ::ethers_core::types::Address,
59 token_id: ::ethers_core::types::U256,
60 ) -> ::ethers_contract::builders::ContractCall<M, ()> {
61 self.0
62 .method_hash([9, 94, 167, 179], (to, token_id))
63 .expect("method not found (this should never happen)")
64 }
65 pub fn balance_of(
67 &self,
68 owner: ::ethers_core::types::Address,
69 ) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
70 self.0
71 .method_hash([112, 160, 130, 49], owner)
72 .expect("method not found (this should never happen)")
73 }
74 pub fn get_approved(
76 &self,
77 token_id: ::ethers_core::types::U256,
78 ) -> ::ethers_contract::builders::ContractCall<
79 M,
80 ::ethers_core::types::Address,
81 > {
82 self.0
83 .method_hash([8, 24, 18, 252], token_id)
84 .expect("method not found (this should never happen)")
85 }
86 pub fn is_approved_for_all(
88 &self,
89 owner: ::ethers_core::types::Address,
90 operator: ::ethers_core::types::Address,
91 ) -> ::ethers_contract::builders::ContractCall<M, bool> {
92 self.0
93 .method_hash([233, 133, 233, 197], (owner, operator))
94 .expect("method not found (this should never happen)")
95 }
96 pub fn name(
98 &self,
99 ) -> ::ethers_contract::builders::ContractCall<M, ::std::string::String> {
100 self.0
101 .method_hash([6, 253, 222, 3], ())
102 .expect("method not found (this should never happen)")
103 }
104 pub fn owner_of(
106 &self,
107 token_id: ::ethers_core::types::U256,
108 ) -> ::ethers_contract::builders::ContractCall<
109 M,
110 ::ethers_core::types::Address,
111 > {
112 self.0
113 .method_hash([99, 82, 33, 30], token_id)
114 .expect("method not found (this should never happen)")
115 }
116 pub fn safe_transfer_from(
118 &self,
119 from: ::ethers_core::types::Address,
120 to: ::ethers_core::types::Address,
121 token_id: ::ethers_core::types::U256,
122 ) -> ::ethers_contract::builders::ContractCall<M, ()> {
123 self.0
124 .method_hash([66, 132, 46, 14], (from, to, token_id))
125 .expect("method not found (this should never happen)")
126 }
127 pub fn safe_transfer_from_with_from_and_to_and_data(
129 &self,
130 from: ::ethers_core::types::Address,
131 to: ::ethers_core::types::Address,
132 token_id: ::ethers_core::types::U256,
133 data: ::ethers_core::types::Bytes,
134 ) -> ::ethers_contract::builders::ContractCall<M, ()> {
135 self.0
136 .method_hash([184, 141, 79, 222], (from, to, token_id, data))
137 .expect("method not found (this should never happen)")
138 }
139 pub fn set_approval_for_all(
141 &self,
142 operator: ::ethers_core::types::Address,
143 approved: bool,
144 ) -> ::ethers_contract::builders::ContractCall<M, ()> {
145 self.0
146 .method_hash([162, 44, 180, 101], (operator, approved))
147 .expect("method not found (this should never happen)")
148 }
149 pub fn supports_interface(
151 &self,
152 interface_id: [u8; 4],
153 ) -> ::ethers_contract::builders::ContractCall<M, bool> {
154 self.0
155 .method_hash([1, 255, 201, 167], interface_id)
156 .expect("method not found (this should never happen)")
157 }
158 pub fn symbol(
160 &self,
161 ) -> ::ethers_contract::builders::ContractCall<M, ::std::string::String> {
162 self.0
163 .method_hash([149, 216, 155, 65], ())
164 .expect("method not found (this should never happen)")
165 }
166 pub fn token_by_index(
168 &self,
169 index: ::ethers_core::types::U256,
170 ) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
171 self.0
172 .method_hash([79, 108, 204, 231], index)
173 .expect("method not found (this should never happen)")
174 }
175 pub fn token_of_owner_by_index(
177 &self,
178 owner: ::ethers_core::types::Address,
179 index: ::ethers_core::types::U256,
180 ) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
181 self.0
182 .method_hash([47, 116, 92, 89], (owner, index))
183 .expect("method not found (this should never happen)")
184 }
185 pub fn token_uri(
187 &self,
188 token_id: ::ethers_core::types::U256,
189 ) -> ::ethers_contract::builders::ContractCall<M, ::std::string::String> {
190 self.0
191 .method_hash([200, 123, 86, 221], token_id)
192 .expect("method not found (this should never happen)")
193 }
194 pub fn total_supply(
196 &self,
197 ) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
198 self.0
199 .method_hash([24, 22, 13, 221], ())
200 .expect("method not found (this should never happen)")
201 }
202 pub fn transfer_from(
204 &self,
205 from: ::ethers_core::types::Address,
206 to: ::ethers_core::types::Address,
207 token_id: ::ethers_core::types::U256,
208 ) -> ::ethers_contract::builders::ContractCall<M, ()> {
209 self.0
210 .method_hash([35, 184, 114, 221], (from, to, token_id))
211 .expect("method not found (this should never happen)")
212 }
213 pub fn approval_filter(
215 &self,
216 ) -> ::ethers_contract::builders::Event<::std::sync::Arc<M>, M, ApprovalFilter> {
217 self.0.event()
218 }
219 pub fn approval_for_all_filter(
221 &self,
222 ) -> ::ethers_contract::builders::Event<
223 ::std::sync::Arc<M>,
224 M,
225 ApprovalForAllFilter,
226 > {
227 self.0.event()
228 }
229 pub fn transfer_filter(
231 &self,
232 ) -> ::ethers_contract::builders::Event<::std::sync::Arc<M>, M, TransferFilter> {
233 self.0.event()
234 }
235 pub fn events(
237 &self,
238 ) -> ::ethers_contract::builders::Event<
239 ::std::sync::Arc<M>,
240 M,
241 ERC721EnumerableEvents,
242 > {
243 self.0.event_with_filter(::core::default::Default::default())
244 }
245 }
246 impl<M: ::ethers_providers::Middleware> From<::ethers_contract::Contract<M>>
247 for ERC721Enumerable<M> {
248 fn from(contract: ::ethers_contract::Contract<M>) -> Self {
249 Self::new(contract.address(), contract.client())
250 }
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 = "Approval", abi = "Approval(address,address,uint256)")]
263 pub struct ApprovalFilter {
264 #[ethevent(indexed)]
265 pub owner: ::ethers_core::types::Address,
266 #[ethevent(indexed)]
267 pub approved: ::ethers_core::types::Address,
268 #[ethevent(indexed)]
269 pub token_id: ::ethers_core::types::U256,
270 }
271 #[derive(
272 Clone,
273 ::ethers_contract::EthEvent,
274 ::ethers_contract::EthDisplay,
275 Default,
276 Debug,
277 PartialEq,
278 Eq,
279 Hash
280 )]
281 #[ethevent(name = "ApprovalForAll", abi = "ApprovalForAll(address,address,bool)")]
282 pub struct ApprovalForAllFilter {
283 #[ethevent(indexed)]
284 pub owner: ::ethers_core::types::Address,
285 #[ethevent(indexed)]
286 pub operator: ::ethers_core::types::Address,
287 pub approved: bool,
288 }
289 #[derive(
290 Clone,
291 ::ethers_contract::EthEvent,
292 ::ethers_contract::EthDisplay,
293 Default,
294 Debug,
295 PartialEq,
296 Eq,
297 Hash
298 )]
299 #[ethevent(name = "Transfer", abi = "Transfer(address,address,uint256)")]
300 pub struct TransferFilter {
301 #[ethevent(indexed)]
302 pub from: ::ethers_core::types::Address,
303 #[ethevent(indexed)]
304 pub to: ::ethers_core::types::Address,
305 #[ethevent(indexed)]
306 pub token_id: ::ethers_core::types::U256,
307 }
308 #[derive(Clone, ::ethers_contract::EthAbiType, Debug, PartialEq, Eq, Hash)]
310 pub enum ERC721EnumerableEvents {
311 ApprovalFilter(ApprovalFilter),
312 ApprovalForAllFilter(ApprovalForAllFilter),
313 TransferFilter(TransferFilter),
314 }
315 impl ::ethers_contract::EthLogDecode for ERC721EnumerableEvents {
316 fn decode_log(
317 log: &::ethers_core::abi::RawLog,
318 ) -> ::core::result::Result<Self, ::ethers_core::abi::Error> {
319 if let Ok(decoded) = ApprovalFilter::decode_log(log) {
320 return Ok(ERC721EnumerableEvents::ApprovalFilter(decoded));
321 }
322 if let Ok(decoded) = ApprovalForAllFilter::decode_log(log) {
323 return Ok(ERC721EnumerableEvents::ApprovalForAllFilter(decoded));
324 }
325 if let Ok(decoded) = TransferFilter::decode_log(log) {
326 return Ok(ERC721EnumerableEvents::TransferFilter(decoded));
327 }
328 Err(::ethers_core::abi::Error::InvalidData)
329 }
330 }
331 impl ::core::fmt::Display for ERC721EnumerableEvents {
332 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
333 match self {
334 Self::ApprovalFilter(element) => ::core::fmt::Display::fmt(element, f),
335 Self::ApprovalForAllFilter(element) => {
336 ::core::fmt::Display::fmt(element, f)
337 }
338 Self::TransferFilter(element) => ::core::fmt::Display::fmt(element, f),
339 }
340 }
341 }
342 impl ::core::convert::From<ApprovalFilter> for ERC721EnumerableEvents {
343 fn from(value: ApprovalFilter) -> Self {
344 Self::ApprovalFilter(value)
345 }
346 }
347 impl ::core::convert::From<ApprovalForAllFilter> for ERC721EnumerableEvents {
348 fn from(value: ApprovalForAllFilter) -> Self {
349 Self::ApprovalForAllFilter(value)
350 }
351 }
352 impl ::core::convert::From<TransferFilter> for ERC721EnumerableEvents {
353 fn from(value: TransferFilter) -> Self {
354 Self::TransferFilter(value)
355 }
356 }
357 #[derive(
359 Clone,
360 ::ethers_contract::EthCall,
361 ::ethers_contract::EthDisplay,
362 Default,
363 Debug,
364 PartialEq,
365 Eq,
366 Hash
367 )]
368 #[ethcall(name = "approve", abi = "approve(address,uint256)")]
369 pub struct ApproveCall {
370 pub to: ::ethers_core::types::Address,
371 pub token_id: ::ethers_core::types::U256,
372 }
373 #[derive(
375 Clone,
376 ::ethers_contract::EthCall,
377 ::ethers_contract::EthDisplay,
378 Default,
379 Debug,
380 PartialEq,
381 Eq,
382 Hash
383 )]
384 #[ethcall(name = "balanceOf", abi = "balanceOf(address)")]
385 pub struct BalanceOfCall {
386 pub owner: ::ethers_core::types::Address,
387 }
388 #[derive(
390 Clone,
391 ::ethers_contract::EthCall,
392 ::ethers_contract::EthDisplay,
393 Default,
394 Debug,
395 PartialEq,
396 Eq,
397 Hash
398 )]
399 #[ethcall(name = "getApproved", abi = "getApproved(uint256)")]
400 pub struct GetApprovedCall {
401 pub token_id: ::ethers_core::types::U256,
402 }
403 #[derive(
405 Clone,
406 ::ethers_contract::EthCall,
407 ::ethers_contract::EthDisplay,
408 Default,
409 Debug,
410 PartialEq,
411 Eq,
412 Hash
413 )]
414 #[ethcall(name = "isApprovedForAll", abi = "isApprovedForAll(address,address)")]
415 pub struct IsApprovedForAllCall {
416 pub owner: ::ethers_core::types::Address,
417 pub operator: ::ethers_core::types::Address,
418 }
419 #[derive(
421 Clone,
422 ::ethers_contract::EthCall,
423 ::ethers_contract::EthDisplay,
424 Default,
425 Debug,
426 PartialEq,
427 Eq,
428 Hash
429 )]
430 #[ethcall(name = "name", abi = "name()")]
431 pub struct NameCall;
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 = "ownerOf", abi = "ownerOf(uint256)")]
444 pub struct OwnerOfCall {
445 pub token_id: ::ethers_core::types::U256,
446 }
447 #[derive(
449 Clone,
450 ::ethers_contract::EthCall,
451 ::ethers_contract::EthDisplay,
452 Default,
453 Debug,
454 PartialEq,
455 Eq,
456 Hash
457 )]
458 #[ethcall(
459 name = "safeTransferFrom",
460 abi = "safeTransferFrom(address,address,uint256)"
461 )]
462 pub struct SafeTransferFromCall {
463 pub from: ::ethers_core::types::Address,
464 pub to: ::ethers_core::types::Address,
465 pub token_id: ::ethers_core::types::U256,
466 }
467 #[derive(
469 Clone,
470 ::ethers_contract::EthCall,
471 ::ethers_contract::EthDisplay,
472 Default,
473 Debug,
474 PartialEq,
475 Eq,
476 Hash
477 )]
478 #[ethcall(
479 name = "safeTransferFrom",
480 abi = "safeTransferFrom(address,address,uint256,bytes)"
481 )]
482 pub struct SafeTransferFromWithFromAndToAndDataCall {
483 pub from: ::ethers_core::types::Address,
484 pub to: ::ethers_core::types::Address,
485 pub token_id: ::ethers_core::types::U256,
486 pub data: ::ethers_core::types::Bytes,
487 }
488 #[derive(
490 Clone,
491 ::ethers_contract::EthCall,
492 ::ethers_contract::EthDisplay,
493 Default,
494 Debug,
495 PartialEq,
496 Eq,
497 Hash
498 )]
499 #[ethcall(name = "setApprovalForAll", abi = "setApprovalForAll(address,bool)")]
500 pub struct SetApprovalForAllCall {
501 pub operator: ::ethers_core::types::Address,
502 pub approved: bool,
503 }
504 #[derive(
506 Clone,
507 ::ethers_contract::EthCall,
508 ::ethers_contract::EthDisplay,
509 Default,
510 Debug,
511 PartialEq,
512 Eq,
513 Hash
514 )]
515 #[ethcall(name = "supportsInterface", abi = "supportsInterface(bytes4)")]
516 pub struct SupportsInterfaceCall {
517 pub interface_id: [u8; 4],
518 }
519 #[derive(
521 Clone,
522 ::ethers_contract::EthCall,
523 ::ethers_contract::EthDisplay,
524 Default,
525 Debug,
526 PartialEq,
527 Eq,
528 Hash
529 )]
530 #[ethcall(name = "symbol", abi = "symbol()")]
531 pub struct SymbolCall;
532 #[derive(
534 Clone,
535 ::ethers_contract::EthCall,
536 ::ethers_contract::EthDisplay,
537 Default,
538 Debug,
539 PartialEq,
540 Eq,
541 Hash
542 )]
543 #[ethcall(name = "tokenByIndex", abi = "tokenByIndex(uint256)")]
544 pub struct TokenByIndexCall {
545 pub index: ::ethers_core::types::U256,
546 }
547 #[derive(
549 Clone,
550 ::ethers_contract::EthCall,
551 ::ethers_contract::EthDisplay,
552 Default,
553 Debug,
554 PartialEq,
555 Eq,
556 Hash
557 )]
558 #[ethcall(
559 name = "tokenOfOwnerByIndex",
560 abi = "tokenOfOwnerByIndex(address,uint256)"
561 )]
562 pub struct TokenOfOwnerByIndexCall {
563 pub owner: ::ethers_core::types::Address,
564 pub index: ::ethers_core::types::U256,
565 }
566 #[derive(
568 Clone,
569 ::ethers_contract::EthCall,
570 ::ethers_contract::EthDisplay,
571 Default,
572 Debug,
573 PartialEq,
574 Eq,
575 Hash
576 )]
577 #[ethcall(name = "tokenURI", abi = "tokenURI(uint256)")]
578 pub struct TokenURICall {
579 pub token_id: ::ethers_core::types::U256,
580 }
581 #[derive(
583 Clone,
584 ::ethers_contract::EthCall,
585 ::ethers_contract::EthDisplay,
586 Default,
587 Debug,
588 PartialEq,
589 Eq,
590 Hash
591 )]
592 #[ethcall(name = "totalSupply", abi = "totalSupply()")]
593 pub struct TotalSupplyCall;
594 #[derive(
596 Clone,
597 ::ethers_contract::EthCall,
598 ::ethers_contract::EthDisplay,
599 Default,
600 Debug,
601 PartialEq,
602 Eq,
603 Hash
604 )]
605 #[ethcall(name = "transferFrom", abi = "transferFrom(address,address,uint256)")]
606 pub struct TransferFromCall {
607 pub from: ::ethers_core::types::Address,
608 pub to: ::ethers_core::types::Address,
609 pub token_id: ::ethers_core::types::U256,
610 }
611 #[derive(Clone, ::ethers_contract::EthAbiType, Debug, PartialEq, Eq, Hash)]
613 pub enum ERC721EnumerableCalls {
614 Approve(ApproveCall),
615 BalanceOf(BalanceOfCall),
616 GetApproved(GetApprovedCall),
617 IsApprovedForAll(IsApprovedForAllCall),
618 Name(NameCall),
619 OwnerOf(OwnerOfCall),
620 SafeTransferFrom(SafeTransferFromCall),
621 SafeTransferFromWithFromAndToAndData(SafeTransferFromWithFromAndToAndDataCall),
622 SetApprovalForAll(SetApprovalForAllCall),
623 SupportsInterface(SupportsInterfaceCall),
624 Symbol(SymbolCall),
625 TokenByIndex(TokenByIndexCall),
626 TokenOfOwnerByIndex(TokenOfOwnerByIndexCall),
627 TokenURI(TokenURICall),
628 TotalSupply(TotalSupplyCall),
629 TransferFrom(TransferFromCall),
630 }
631 impl ::ethers_core::abi::AbiDecode for ERC721EnumerableCalls {
632 fn decode(
633 data: impl AsRef<[u8]>,
634 ) -> ::core::result::Result<Self, ::ethers_core::abi::AbiError> {
635 let data = data.as_ref();
636 if let Ok(decoded)
637 = <ApproveCall as ::ethers_core::abi::AbiDecode>::decode(data) {
638 return Ok(Self::Approve(decoded));
639 }
640 if let Ok(decoded)
641 = <BalanceOfCall as ::ethers_core::abi::AbiDecode>::decode(data) {
642 return Ok(Self::BalanceOf(decoded));
643 }
644 if let Ok(decoded)
645 = <GetApprovedCall as ::ethers_core::abi::AbiDecode>::decode(data) {
646 return Ok(Self::GetApproved(decoded));
647 }
648 if let Ok(decoded)
649 = <IsApprovedForAllCall as ::ethers_core::abi::AbiDecode>::decode(data) {
650 return Ok(Self::IsApprovedForAll(decoded));
651 }
652 if let Ok(decoded)
653 = <NameCall as ::ethers_core::abi::AbiDecode>::decode(data) {
654 return Ok(Self::Name(decoded));
655 }
656 if let Ok(decoded)
657 = <OwnerOfCall as ::ethers_core::abi::AbiDecode>::decode(data) {
658 return Ok(Self::OwnerOf(decoded));
659 }
660 if let Ok(decoded)
661 = <SafeTransferFromCall as ::ethers_core::abi::AbiDecode>::decode(data) {
662 return Ok(Self::SafeTransferFrom(decoded));
663 }
664 if let Ok(decoded)
665 = <SafeTransferFromWithFromAndToAndDataCall as ::ethers_core::abi::AbiDecode>::decode(
666 data,
667 ) {
668 return Ok(Self::SafeTransferFromWithFromAndToAndData(decoded));
669 }
670 if let Ok(decoded)
671 = <SetApprovalForAllCall as ::ethers_core::abi::AbiDecode>::decode(
672 data,
673 ) {
674 return Ok(Self::SetApprovalForAll(decoded));
675 }
676 if let Ok(decoded)
677 = <SupportsInterfaceCall as ::ethers_core::abi::AbiDecode>::decode(
678 data,
679 ) {
680 return Ok(Self::SupportsInterface(decoded));
681 }
682 if let Ok(decoded)
683 = <SymbolCall as ::ethers_core::abi::AbiDecode>::decode(data) {
684 return Ok(Self::Symbol(decoded));
685 }
686 if let Ok(decoded)
687 = <TokenByIndexCall as ::ethers_core::abi::AbiDecode>::decode(data) {
688 return Ok(Self::TokenByIndex(decoded));
689 }
690 if let Ok(decoded)
691 = <TokenOfOwnerByIndexCall as ::ethers_core::abi::AbiDecode>::decode(
692 data,
693 ) {
694 return Ok(Self::TokenOfOwnerByIndex(decoded));
695 }
696 if let Ok(decoded)
697 = <TokenURICall as ::ethers_core::abi::AbiDecode>::decode(data) {
698 return Ok(Self::TokenURI(decoded));
699 }
700 if let Ok(decoded)
701 = <TotalSupplyCall as ::ethers_core::abi::AbiDecode>::decode(data) {
702 return Ok(Self::TotalSupply(decoded));
703 }
704 if let Ok(decoded)
705 = <TransferFromCall as ::ethers_core::abi::AbiDecode>::decode(data) {
706 return Ok(Self::TransferFrom(decoded));
707 }
708 Err(::ethers_core::abi::Error::InvalidData.into())
709 }
710 }
711 impl ::ethers_core::abi::AbiEncode for ERC721EnumerableCalls {
712 fn encode(self) -> Vec<u8> {
713 match self {
714 Self::Approve(element) => ::ethers_core::abi::AbiEncode::encode(element),
715 Self::BalanceOf(element) => {
716 ::ethers_core::abi::AbiEncode::encode(element)
717 }
718 Self::GetApproved(element) => {
719 ::ethers_core::abi::AbiEncode::encode(element)
720 }
721 Self::IsApprovedForAll(element) => {
722 ::ethers_core::abi::AbiEncode::encode(element)
723 }
724 Self::Name(element) => ::ethers_core::abi::AbiEncode::encode(element),
725 Self::OwnerOf(element) => ::ethers_core::abi::AbiEncode::encode(element),
726 Self::SafeTransferFrom(element) => {
727 ::ethers_core::abi::AbiEncode::encode(element)
728 }
729 Self::SafeTransferFromWithFromAndToAndData(element) => {
730 ::ethers_core::abi::AbiEncode::encode(element)
731 }
732 Self::SetApprovalForAll(element) => {
733 ::ethers_core::abi::AbiEncode::encode(element)
734 }
735 Self::SupportsInterface(element) => {
736 ::ethers_core::abi::AbiEncode::encode(element)
737 }
738 Self::Symbol(element) => ::ethers_core::abi::AbiEncode::encode(element),
739 Self::TokenByIndex(element) => {
740 ::ethers_core::abi::AbiEncode::encode(element)
741 }
742 Self::TokenOfOwnerByIndex(element) => {
743 ::ethers_core::abi::AbiEncode::encode(element)
744 }
745 Self::TokenURI(element) => ::ethers_core::abi::AbiEncode::encode(element),
746 Self::TotalSupply(element) => {
747 ::ethers_core::abi::AbiEncode::encode(element)
748 }
749 Self::TransferFrom(element) => {
750 ::ethers_core::abi::AbiEncode::encode(element)
751 }
752 }
753 }
754 }
755 impl ::core::fmt::Display for ERC721EnumerableCalls {
756 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
757 match self {
758 Self::Approve(element) => ::core::fmt::Display::fmt(element, f),
759 Self::BalanceOf(element) => ::core::fmt::Display::fmt(element, f),
760 Self::GetApproved(element) => ::core::fmt::Display::fmt(element, f),
761 Self::IsApprovedForAll(element) => ::core::fmt::Display::fmt(element, f),
762 Self::Name(element) => ::core::fmt::Display::fmt(element, f),
763 Self::OwnerOf(element) => ::core::fmt::Display::fmt(element, f),
764 Self::SafeTransferFrom(element) => ::core::fmt::Display::fmt(element, f),
765 Self::SafeTransferFromWithFromAndToAndData(element) => {
766 ::core::fmt::Display::fmt(element, f)
767 }
768 Self::SetApprovalForAll(element) => ::core::fmt::Display::fmt(element, f),
769 Self::SupportsInterface(element) => ::core::fmt::Display::fmt(element, f),
770 Self::Symbol(element) => ::core::fmt::Display::fmt(element, f),
771 Self::TokenByIndex(element) => ::core::fmt::Display::fmt(element, f),
772 Self::TokenOfOwnerByIndex(element) => {
773 ::core::fmt::Display::fmt(element, f)
774 }
775 Self::TokenURI(element) => ::core::fmt::Display::fmt(element, f),
776 Self::TotalSupply(element) => ::core::fmt::Display::fmt(element, f),
777 Self::TransferFrom(element) => ::core::fmt::Display::fmt(element, f),
778 }
779 }
780 }
781 impl ::core::convert::From<ApproveCall> for ERC721EnumerableCalls {
782 fn from(value: ApproveCall) -> Self {
783 Self::Approve(value)
784 }
785 }
786 impl ::core::convert::From<BalanceOfCall> for ERC721EnumerableCalls {
787 fn from(value: BalanceOfCall) -> Self {
788 Self::BalanceOf(value)
789 }
790 }
791 impl ::core::convert::From<GetApprovedCall> for ERC721EnumerableCalls {
792 fn from(value: GetApprovedCall) -> Self {
793 Self::GetApproved(value)
794 }
795 }
796 impl ::core::convert::From<IsApprovedForAllCall> for ERC721EnumerableCalls {
797 fn from(value: IsApprovedForAllCall) -> Self {
798 Self::IsApprovedForAll(value)
799 }
800 }
801 impl ::core::convert::From<NameCall> for ERC721EnumerableCalls {
802 fn from(value: NameCall) -> Self {
803 Self::Name(value)
804 }
805 }
806 impl ::core::convert::From<OwnerOfCall> for ERC721EnumerableCalls {
807 fn from(value: OwnerOfCall) -> Self {
808 Self::OwnerOf(value)
809 }
810 }
811 impl ::core::convert::From<SafeTransferFromCall> for ERC721EnumerableCalls {
812 fn from(value: SafeTransferFromCall) -> Self {
813 Self::SafeTransferFrom(value)
814 }
815 }
816 impl ::core::convert::From<SafeTransferFromWithFromAndToAndDataCall>
817 for ERC721EnumerableCalls {
818 fn from(value: SafeTransferFromWithFromAndToAndDataCall) -> Self {
819 Self::SafeTransferFromWithFromAndToAndData(value)
820 }
821 }
822 impl ::core::convert::From<SetApprovalForAllCall> for ERC721EnumerableCalls {
823 fn from(value: SetApprovalForAllCall) -> Self {
824 Self::SetApprovalForAll(value)
825 }
826 }
827 impl ::core::convert::From<SupportsInterfaceCall> for ERC721EnumerableCalls {
828 fn from(value: SupportsInterfaceCall) -> Self {
829 Self::SupportsInterface(value)
830 }
831 }
832 impl ::core::convert::From<SymbolCall> for ERC721EnumerableCalls {
833 fn from(value: SymbolCall) -> Self {
834 Self::Symbol(value)
835 }
836 }
837 impl ::core::convert::From<TokenByIndexCall> for ERC721EnumerableCalls {
838 fn from(value: TokenByIndexCall) -> Self {
839 Self::TokenByIndex(value)
840 }
841 }
842 impl ::core::convert::From<TokenOfOwnerByIndexCall> for ERC721EnumerableCalls {
843 fn from(value: TokenOfOwnerByIndexCall) -> Self {
844 Self::TokenOfOwnerByIndex(value)
845 }
846 }
847 impl ::core::convert::From<TokenURICall> for ERC721EnumerableCalls {
848 fn from(value: TokenURICall) -> Self {
849 Self::TokenURI(value)
850 }
851 }
852 impl ::core::convert::From<TotalSupplyCall> for ERC721EnumerableCalls {
853 fn from(value: TotalSupplyCall) -> Self {
854 Self::TotalSupply(value)
855 }
856 }
857 impl ::core::convert::From<TransferFromCall> for ERC721EnumerableCalls {
858 fn from(value: TransferFromCall) -> Self {
859 Self::TransferFrom(value)
860 }
861 }
862 #[derive(
864 Clone,
865 ::ethers_contract::EthAbiType,
866 ::ethers_contract::EthAbiCodec,
867 Default,
868 Debug,
869 PartialEq,
870 Eq,
871 Hash
872 )]
873 pub struct BalanceOfReturn(pub ::ethers_core::types::U256);
874 #[derive(
876 Clone,
877 ::ethers_contract::EthAbiType,
878 ::ethers_contract::EthAbiCodec,
879 Default,
880 Debug,
881 PartialEq,
882 Eq,
883 Hash
884 )]
885 pub struct GetApprovedReturn(pub ::ethers_core::types::Address);
886 #[derive(
888 Clone,
889 ::ethers_contract::EthAbiType,
890 ::ethers_contract::EthAbiCodec,
891 Default,
892 Debug,
893 PartialEq,
894 Eq,
895 Hash
896 )]
897 pub struct IsApprovedForAllReturn(pub bool);
898 #[derive(
900 Clone,
901 ::ethers_contract::EthAbiType,
902 ::ethers_contract::EthAbiCodec,
903 Default,
904 Debug,
905 PartialEq,
906 Eq,
907 Hash
908 )]
909 pub struct NameReturn(pub ::std::string::String);
910 #[derive(
912 Clone,
913 ::ethers_contract::EthAbiType,
914 ::ethers_contract::EthAbiCodec,
915 Default,
916 Debug,
917 PartialEq,
918 Eq,
919 Hash
920 )]
921 pub struct OwnerOfReturn(pub ::ethers_core::types::Address);
922 #[derive(
924 Clone,
925 ::ethers_contract::EthAbiType,
926 ::ethers_contract::EthAbiCodec,
927 Default,
928 Debug,
929 PartialEq,
930 Eq,
931 Hash
932 )]
933 pub struct SupportsInterfaceReturn(pub bool);
934 #[derive(
936 Clone,
937 ::ethers_contract::EthAbiType,
938 ::ethers_contract::EthAbiCodec,
939 Default,
940 Debug,
941 PartialEq,
942 Eq,
943 Hash
944 )]
945 pub struct SymbolReturn(pub ::std::string::String);
946 #[derive(
948 Clone,
949 ::ethers_contract::EthAbiType,
950 ::ethers_contract::EthAbiCodec,
951 Default,
952 Debug,
953 PartialEq,
954 Eq,
955 Hash
956 )]
957 pub struct TokenByIndexReturn(pub ::ethers_core::types::U256);
958 #[derive(
960 Clone,
961 ::ethers_contract::EthAbiType,
962 ::ethers_contract::EthAbiCodec,
963 Default,
964 Debug,
965 PartialEq,
966 Eq,
967 Hash
968 )]
969 pub struct TokenOfOwnerByIndexReturn(pub ::ethers_core::types::U256);
970 #[derive(
972 Clone,
973 ::ethers_contract::EthAbiType,
974 ::ethers_contract::EthAbiCodec,
975 Default,
976 Debug,
977 PartialEq,
978 Eq,
979 Hash
980 )]
981 pub struct TokenURIReturn(pub ::std::string::String);
982 #[derive(
984 Clone,
985 ::ethers_contract::EthAbiType,
986 ::ethers_contract::EthAbiCodec,
987 Default,
988 Debug,
989 PartialEq,
990 Eq,
991 Hash
992 )]
993 pub struct TotalSupplyReturn(pub ::ethers_core::types::U256);
994}