git.delta.rocks / unique-network / refs/commits / b24c73be918e

difftreelog

feature(common-pallet): add changeOwner method

Grigoriy Simonov2022-08-23parent: #565dfea.patch.diff
in: master

14 files changed

modifiedpallets/common/src/erc.rsdiffbeforeafterboth
431 };431 };
432 Ok(mode.into())432 Ok(mode.into())
433 }433 }
434
435 /// Changes collection owner
436 ///
437 /// @dev Owner can be changed only by current owner
438 /// @param newOwner new owner
439 fn change_owner(&mut self, caller: caller, new_owner: address) -> Result<void> {
440 let caller = T::CrossAccountId::from_eth(caller);
441 let new_owner = T::CrossAccountId::from_eth(new_owner);
442 self.change_owner_internal(caller, new_owner)
443 }
444
445impl<T: Config> CollectionHandle<T>
446where
447 T::AccountId: From<[u8; 32]>,
448{
449
450 fn change_owner_internal(&mut self, caller: T::CrossAccountId, new_owner: T::CrossAccountId) -> Result<void> {
451 self.check_is_owner(&caller).map_err(dispatch_to_evm::<T>)?;
452 self.collection.owner = new_owner.as_sub().clone();
453 save(self)
454 }
434}455}
435456
436fn check_is_owner_or_admin<T: Config>(457fn check_is_owner_or_admin<T: Config>(
440 let caller = T::CrossAccountId::from_eth(caller);461 let caller = T::CrossAccountId::from_eth(caller);
441 collection462 collection
442 .check_is_owner_or_admin(&caller)463 .check_is_owner_or_admin(&caller)
443 .map_err(pallet_evm_coder_substrate::dispatch_to_evm::<T>)?;464 .map_err(dispatch_to_evm::<T>)?;
444 Ok(caller)465 Ok(caller)
445}466}
446467
447fn save<T: Config>(collection: &CollectionHandle<T>) -> Result<void> {468fn save<T: Config>(collection: &CollectionHandle<T>) -> Result<void> {
448 // TODO possibly delete for the lack of transaction469 // TODO possibly delete for the lack of transaction
470 collection.consume_store_writes(1)?;
449 collection471 collection
450 .check_is_internal()472 .check_is_internal()
451 .map_err(dispatch_to_evm::<T>)?;473 .map_err(dispatch_to_evm::<T>)?;
modifiedpallets/fungible/src/stubs/UniqueFungible.rawdiffbeforeafterboth

binary blob — no preview

modifiedpallets/fungible/src/stubs/UniqueFungible.soldiffbeforeafterboth
31 );31 );
32}32}
33
34// Selector: 6cf113cd
35contract Collection is Dummy, ERC165 {
36 // Set collection property.
37 //
38 // @param key Property key.
39 // @param value Propery value.
40 //
41 // Selector: setCollectionProperty(string,bytes) 2f073f66
42 function setCollectionProperty(string memory key, bytes memory value)
43 public
44 {
45 require(false, stub_error);
46 key;
47 value;
48 dummy = 0;
49 }
50
51 // Delete collection property.
52 //
53 // @param key Property key.
54 //
55 // Selector: deleteCollectionProperty(string) 7b7debce
56 function deleteCollectionProperty(string memory key) public {
57 require(false, stub_error);
58 key;
59 dummy = 0;
60 }
61
62 // Get collection property.
63 //
64 // @dev Throws error if key not found.
65 //
66 // @param key Property key.
67 // @return bytes The property corresponding to the key.
68 //
69 // Selector: collectionProperty(string) cf24fd6d
70 function collectionProperty(string memory key)
71 public
72 view
73 returns (bytes memory)
74 {
75 require(false, stub_error);
76 key;
77 dummy;
78 return hex"";
79 }
80
81 // Set the sponsor of the collection.
82 //
83 // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.
84 //
85 // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.
86 //
87 // Selector: setCollectionSponsor(address) 7623402e
88 function setCollectionSponsor(address sponsor) public {
89 require(false, stub_error);
90 sponsor;
91 dummy = 0;
92 }
93
94 // Collection sponsorship confirmation.
95 //
96 // @dev After setting the sponsor for the collection, it must be confirmed with this function.
97 //
98 // Selector: confirmCollectionSponsorship() 3c50e97a
99 function confirmCollectionSponsorship() public {
100 require(false, stub_error);
101 dummy = 0;
102 }
103
104 // Set limits for the collection.
105 // @dev Throws error if limit not found.
106 // @param limit Name of the limit. Valid names:
107 // "accountTokenOwnershipLimit",
108 // "sponsoredDataSize",
109 // "sponsoredDataRateLimit",
110 // "tokenLimit",
111 // "sponsorTransferTimeout",
112 // "sponsorApproveTimeout"
113 // @param value Value of the limit.
114 //
115 // Selector: setCollectionLimit(string,uint32) 6a3841db
116 function setCollectionLimit(string memory limit, uint32 value) public {
117 require(false, stub_error);
118 limit;
119 value;
120 dummy = 0;
121 }
122
123 // Set limits for the collection.
124 // @dev Throws error if limit not found.
125 // @param limit Name of the limit. Valid names:
126 // "ownerCanTransfer",
127 // "ownerCanDestroy",
128 // "transfersEnabled"
129 // @param value Value of the limit.
130 //
131 // Selector: setCollectionLimit(string,bool) 993b7fba
132 function setCollectionLimit(string memory limit, bool value) public {
133 require(false, stub_error);
134 limit;
135 value;
136 dummy = 0;
137 }
138
139 // Get contract address.
140 //
141 // Selector: contractAddress() f6b4dfb4
142 function contractAddress() public view returns (address) {
143 require(false, stub_error);
144 dummy;
145 return 0x0000000000000000000000000000000000000000;
146 }
147
148 // Add collection admin by substrate address.
149 // @param new_admin Substrate administrator address.
150 //
151 // Selector: addCollectionAdminSubstrate(uint256) 5730062b
152 function addCollectionAdminSubstrate(uint256 newAdmin) public {
153 require(false, stub_error);
154 newAdmin;
155 dummy = 0;
156 }
157
158 // Remove collection admin by substrate address.
159 // @param admin Substrate administrator address.
160 //
161 // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9
162 function removeCollectionAdminSubstrate(uint256 admin) public {
163 require(false, stub_error);
164 admin;
165 dummy = 0;
166 }
167
168 // Add collection admin.
169 // @param new_admin Address of the added administrator.
170 //
171 // Selector: addCollectionAdmin(address) 92e462c7
172 function addCollectionAdmin(address newAdmin) public {
173 require(false, stub_error);
174 newAdmin;
175 dummy = 0;
176 }
177
178 // Remove collection admin.
179 //
180 // @param new_admin Address of the removed administrator.
181 //
182 // Selector: removeCollectionAdmin(address) fafd7b42
183 function removeCollectionAdmin(address admin) public {
184 require(false, stub_error);
185 admin;
186 dummy = 0;
187 }
188
189 // Toggle accessibility of collection nesting.
190 //
191 // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
192 //
193 // Selector: setCollectionNesting(bool) 112d4586
194 function setCollectionNesting(bool enable) public {
195 require(false, stub_error);
196 enable;
197 dummy = 0;
198 }
199
200 // Toggle accessibility of collection nesting.
201 //
202 // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
203 // @param collections Addresses of collections that will be available for nesting.
204 //
205 // Selector: setCollectionNesting(bool,address[]) 64872396
206 function setCollectionNesting(bool enable, address[] memory collections)
207 public
208 {
209 require(false, stub_error);
210 enable;
211 collections;
212 dummy = 0;
213 }
214
215 // Set the collection access method.
216 // @param mode Access mode
217 // 0 for Normal
218 // 1 for AllowList
219 //
220 // Selector: setCollectionAccess(uint8) 41835d4c
221 function setCollectionAccess(uint8 mode) public {
222 require(false, stub_error);
223 mode;
224 dummy = 0;
225 }
226
227 // Add the user to the allowed list.
228 //
229 // @param user Address of a trusted user.
230 //
231 // Selector: addToCollectionAllowList(address) 67844fe6
232 function addToCollectionAllowList(address user) public {
233 require(false, stub_error);
234 user;
235 dummy = 0;
236 }
237
238 // Remove the user from the allowed list.
239 //
240 // @param user Address of a removed user.
241 //
242 // Selector: removeFromCollectionAllowList(address) 85c51acb
243 function removeFromCollectionAllowList(address user) public {
244 require(false, stub_error);
245 user;
246 dummy = 0;
247 }
248
249 // Switch permission for minting.
250 //
251 // @param mode Enable if "true".
252 //
253 // Selector: setCollectionMintMode(bool) 00018e84
254 function setCollectionMintMode(bool mode) public {
255 require(false, stub_error);
256 mode;
257 dummy = 0;
258 }
259
260 // Check that account is the owner or admin of the collection
261 //
262 // @param user account to verify
263 // @return "true" if account is the owner or admin
264 //
265 // Selector: verifyOwnerOrAdmin(address) c2282493
266 function verifyOwnerOrAdmin(address user) public view returns (bool) {
267 require(false, stub_error);
268 user;
269 dummy;
270 return false;
271 }
272
273 // Returns collection type
274 //
275 // @return `Fungible` or `NFT` or `ReFungible`
276 //
277 // Selector: uniqueCollectionType() d34b55b8
278 function uniqueCollectionType() public returns (string memory) {
279 require(false, stub_error);
280 dummy = 0;
281 return "";
282 }
283}
28433
285// Selector: 79cc679034// Selector: 79cc6790
286contract ERC20UniqueExtensions is Dummy, ERC165 {35contract ERC20UniqueExtensions is Dummy, ERC165 {
378 }127 }
379}128}
129
130// Selector: ca08c92c
131contract Collection is Dummy, ERC165 {
132 // Set collection property.
133 //
134 // @param key Property key.
135 // @param value Propery value.
136 //
137 // Selector: setCollectionProperty(string,bytes) 2f073f66
138 function setCollectionProperty(string memory key, bytes memory value)
139 public
140 {
141 require(false, stub_error);
142 key;
143 value;
144 dummy = 0;
145 }
146
147 // Delete collection property.
148 //
149 // @param key Property key.
150 //
151 // Selector: deleteCollectionProperty(string) 7b7debce
152 function deleteCollectionProperty(string memory key) public {
153 require(false, stub_error);
154 key;
155 dummy = 0;
156 }
157
158 // Get collection property.
159 //
160 // @dev Throws error if key not found.
161 //
162 // @param key Property key.
163 // @return bytes The property corresponding to the key.
164 //
165 // Selector: collectionProperty(string) cf24fd6d
166 function collectionProperty(string memory key)
167 public
168 view
169 returns (bytes memory)
170 {
171 require(false, stub_error);
172 key;
173 dummy;
174 return hex"";
175 }
176
177 // Set the sponsor of the collection.
178 //
179 // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.
180 //
181 // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.
182 //
183 // Selector: setCollectionSponsor(address) 7623402e
184 function setCollectionSponsor(address sponsor) public {
185 require(false, stub_error);
186 sponsor;
187 dummy = 0;
188 }
189
190 // Collection sponsorship confirmation.
191 //
192 // @dev After setting the sponsor for the collection, it must be confirmed with this function.
193 //
194 // Selector: confirmCollectionSponsorship() 3c50e97a
195 function confirmCollectionSponsorship() public {
196 require(false, stub_error);
197 dummy = 0;
198 }
199
200 // Set limits for the collection.
201 // @dev Throws error if limit not found.
202 // @param limit Name of the limit. Valid names:
203 // "accountTokenOwnershipLimit",
204 // "sponsoredDataSize",
205 // "sponsoredDataRateLimit",
206 // "tokenLimit",
207 // "sponsorTransferTimeout",
208 // "sponsorApproveTimeout"
209 // @param value Value of the limit.
210 //
211 // Selector: setCollectionLimit(string,uint32) 6a3841db
212 function setCollectionLimit(string memory limit, uint32 value) public {
213 require(false, stub_error);
214 limit;
215 value;
216 dummy = 0;
217 }
218
219 // Set limits for the collection.
220 // @dev Throws error if limit not found.
221 // @param limit Name of the limit. Valid names:
222 // "ownerCanTransfer",
223 // "ownerCanDestroy",
224 // "transfersEnabled"
225 // @param value Value of the limit.
226 //
227 // Selector: setCollectionLimit(string,bool) 993b7fba
228 function setCollectionLimit(string memory limit, bool value) public {
229 require(false, stub_error);
230 limit;
231 value;
232 dummy = 0;
233 }
234
235 // Get contract address.
236 //
237 // Selector: contractAddress() f6b4dfb4
238 function contractAddress() public view returns (address) {
239 require(false, stub_error);
240 dummy;
241 return 0x0000000000000000000000000000000000000000;
242 }
243
244 // Add collection admin by substrate address.
245 // @param new_admin Substrate administrator address.
246 //
247 // Selector: addCollectionAdminSubstrate(uint256) 5730062b
248 function addCollectionAdminSubstrate(uint256 newAdmin) public {
249 require(false, stub_error);
250 newAdmin;
251 dummy = 0;
252 }
253
254 // Remove collection admin by substrate address.
255 // @param admin Substrate administrator address.
256 //
257 // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9
258 function removeCollectionAdminSubstrate(uint256 admin) public {
259 require(false, stub_error);
260 admin;
261 dummy = 0;
262 }
263
264 // Add collection admin.
265 // @param new_admin Address of the added administrator.
266 //
267 // Selector: addCollectionAdmin(address) 92e462c7
268 function addCollectionAdmin(address newAdmin) public {
269 require(false, stub_error);
270 newAdmin;
271 dummy = 0;
272 }
273
274 // Remove collection admin.
275 //
276 // @param new_admin Address of the removed administrator.
277 //
278 // Selector: removeCollectionAdmin(address) fafd7b42
279 function removeCollectionAdmin(address admin) public {
280 require(false, stub_error);
281 admin;
282 dummy = 0;
283 }
284
285 // Toggle accessibility of collection nesting.
286 //
287 // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
288 //
289 // Selector: setCollectionNesting(bool) 112d4586
290 function setCollectionNesting(bool enable) public {
291 require(false, stub_error);
292 enable;
293 dummy = 0;
294 }
295
296 // Toggle accessibility of collection nesting.
297 //
298 // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
299 // @param collections Addresses of collections that will be available for nesting.
300 //
301 // Selector: setCollectionNesting(bool,address[]) 64872396
302 function setCollectionNesting(bool enable, address[] memory collections)
303 public
304 {
305 require(false, stub_error);
306 enable;
307 collections;
308 dummy = 0;
309 }
310
311 // Set the collection access method.
312 // @param mode Access mode
313 // 0 for Normal
314 // 1 for AllowList
315 //
316 // Selector: setCollectionAccess(uint8) 41835d4c
317 function setCollectionAccess(uint8 mode) public {
318 require(false, stub_error);
319 mode;
320 dummy = 0;
321 }
322
323 // Add the user to the allowed list.
324 //
325 // @param user Address of a trusted user.
326 //
327 // Selector: addToCollectionAllowList(address) 67844fe6
328 function addToCollectionAllowList(address user) public {
329 require(false, stub_error);
330 user;
331 dummy = 0;
332 }
333
334 // Remove the user from the allowed list.
335 //
336 // @param user Address of a removed user.
337 //
338 // Selector: removeFromCollectionAllowList(address) 85c51acb
339 function removeFromCollectionAllowList(address user) public {
340 require(false, stub_error);
341 user;
342 dummy = 0;
343 }
344
345 // Switch permission for minting.
346 //
347 // @param mode Enable if "true".
348 //
349 // Selector: setCollectionMintMode(bool) 00018e84
350 function setCollectionMintMode(bool mode) public {
351 require(false, stub_error);
352 mode;
353 dummy = 0;
354 }
355
356 // Check that account is the owner or admin of the collection
357 //
358 // @param user account to verify
359 // @return "true" if account is the owner or admin
360 //
361 // Selector: verifyOwnerOrAdmin(address) c2282493
362 function verifyOwnerOrAdmin(address user) public view returns (bool) {
363 require(false, stub_error);
364 user;
365 dummy;
366 return false;
367 }
368
369 // Returns collection type
370 //
371 // @return `Fungible` or `NFT` or `ReFungible`
372 //
373 // Selector: uniqueCollectionType() d34b55b8
374 function uniqueCollectionType() public returns (string memory) {
375 require(false, stub_error);
376 dummy = 0;
377 return "";
378 }
379
380 // Changes collection owner
381 //
382 // @dev Owner can be changed only by current owner
383 // @param newOwner new owner
384 //
385 // Selector: changeOwner(address) a6f9dae1
386 function changeOwner(address newOwner) public {
387 require(false, stub_error);
388 newOwner;
389 dummy = 0;
390 }
391}
380392
381contract UniqueFungible is393contract UniqueFungible is
382 Dummy,394 Dummy,
modifiedpallets/nonfungible/src/stubs/UniqueNFT.rawdiffbeforeafterboth

binary blob — no preview

modifiedpallets/nonfungible/src/stubs/UniqueNFT.soldiffbeforeafterboth
373 }373 }
374}374}
375
376// Selector: 6cf113cd
377contract Collection is Dummy, ERC165 {
378 // Set collection property.
379 //
380 // @param key Property key.
381 // @param value Propery value.
382 //
383 // Selector: setCollectionProperty(string,bytes) 2f073f66
384 function setCollectionProperty(string memory key, bytes memory value)
385 public
386 {
387 require(false, stub_error);
388 key;
389 value;
390 dummy = 0;
391 }
392
393 // Delete collection property.
394 //
395 // @param key Property key.
396 //
397 // Selector: deleteCollectionProperty(string) 7b7debce
398 function deleteCollectionProperty(string memory key) public {
399 require(false, stub_error);
400 key;
401 dummy = 0;
402 }
403
404 // Get collection property.
405 //
406 // @dev Throws error if key not found.
407 //
408 // @param key Property key.
409 // @return bytes The property corresponding to the key.
410 //
411 // Selector: collectionProperty(string) cf24fd6d
412 function collectionProperty(string memory key)
413 public
414 view
415 returns (bytes memory)
416 {
417 require(false, stub_error);
418 key;
419 dummy;
420 return hex"";
421 }
422
423 // Set the sponsor of the collection.
424 //
425 // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.
426 //
427 // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.
428 //
429 // Selector: setCollectionSponsor(address) 7623402e
430 function setCollectionSponsor(address sponsor) public {
431 require(false, stub_error);
432 sponsor;
433 dummy = 0;
434 }
435
436 // Collection sponsorship confirmation.
437 //
438 // @dev After setting the sponsor for the collection, it must be confirmed with this function.
439 //
440 // Selector: confirmCollectionSponsorship() 3c50e97a
441 function confirmCollectionSponsorship() public {
442 require(false, stub_error);
443 dummy = 0;
444 }
445
446 // Set limits for the collection.
447 // @dev Throws error if limit not found.
448 // @param limit Name of the limit. Valid names:
449 // "accountTokenOwnershipLimit",
450 // "sponsoredDataSize",
451 // "sponsoredDataRateLimit",
452 // "tokenLimit",
453 // "sponsorTransferTimeout",
454 // "sponsorApproveTimeout"
455 // @param value Value of the limit.
456 //
457 // Selector: setCollectionLimit(string,uint32) 6a3841db
458 function setCollectionLimit(string memory limit, uint32 value) public {
459 require(false, stub_error);
460 limit;
461 value;
462 dummy = 0;
463 }
464
465 // Set limits for the collection.
466 // @dev Throws error if limit not found.
467 // @param limit Name of the limit. Valid names:
468 // "ownerCanTransfer",
469 // "ownerCanDestroy",
470 // "transfersEnabled"
471 // @param value Value of the limit.
472 //
473 // Selector: setCollectionLimit(string,bool) 993b7fba
474 function setCollectionLimit(string memory limit, bool value) public {
475 require(false, stub_error);
476 limit;
477 value;
478 dummy = 0;
479 }
480
481 // Get contract address.
482 //
483 // Selector: contractAddress() f6b4dfb4
484 function contractAddress() public view returns (address) {
485 require(false, stub_error);
486 dummy;
487 return 0x0000000000000000000000000000000000000000;
488 }
489
490 // Add collection admin by substrate address.
491 // @param new_admin Substrate administrator address.
492 //
493 // Selector: addCollectionAdminSubstrate(uint256) 5730062b
494 function addCollectionAdminSubstrate(uint256 newAdmin) public {
495 require(false, stub_error);
496 newAdmin;
497 dummy = 0;
498 }
499
500 // Remove collection admin by substrate address.
501 // @param admin Substrate administrator address.
502 //
503 // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9
504 function removeCollectionAdminSubstrate(uint256 admin) public {
505 require(false, stub_error);
506 admin;
507 dummy = 0;
508 }
509
510 // Add collection admin.
511 // @param new_admin Address of the added administrator.
512 //
513 // Selector: addCollectionAdmin(address) 92e462c7
514 function addCollectionAdmin(address newAdmin) public {
515 require(false, stub_error);
516 newAdmin;
517 dummy = 0;
518 }
519
520 // Remove collection admin.
521 //
522 // @param new_admin Address of the removed administrator.
523 //
524 // Selector: removeCollectionAdmin(address) fafd7b42
525 function removeCollectionAdmin(address admin) public {
526 require(false, stub_error);
527 admin;
528 dummy = 0;
529 }
530
531 // Toggle accessibility of collection nesting.
532 //
533 // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
534 //
535 // Selector: setCollectionNesting(bool) 112d4586
536 function setCollectionNesting(bool enable) public {
537 require(false, stub_error);
538 enable;
539 dummy = 0;
540 }
541
542 // Toggle accessibility of collection nesting.
543 //
544 // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
545 // @param collections Addresses of collections that will be available for nesting.
546 //
547 // Selector: setCollectionNesting(bool,address[]) 64872396
548 function setCollectionNesting(bool enable, address[] memory collections)
549 public
550 {
551 require(false, stub_error);
552 enable;
553 collections;
554 dummy = 0;
555 }
556
557 // Set the collection access method.
558 // @param mode Access mode
559 // 0 for Normal
560 // 1 for AllowList
561 //
562 // Selector: setCollectionAccess(uint8) 41835d4c
563 function setCollectionAccess(uint8 mode) public {
564 require(false, stub_error);
565 mode;
566 dummy = 0;
567 }
568
569 // Add the user to the allowed list.
570 //
571 // @param user Address of a trusted user.
572 //
573 // Selector: addToCollectionAllowList(address) 67844fe6
574 function addToCollectionAllowList(address user) public {
575 require(false, stub_error);
576 user;
577 dummy = 0;
578 }
579
580 // Remove the user from the allowed list.
581 //
582 // @param user Address of a removed user.
583 //
584 // Selector: removeFromCollectionAllowList(address) 85c51acb
585 function removeFromCollectionAllowList(address user) public {
586 require(false, stub_error);
587 user;
588 dummy = 0;
589 }
590
591 // Switch permission for minting.
592 //
593 // @param mode Enable if "true".
594 //
595 // Selector: setCollectionMintMode(bool) 00018e84
596 function setCollectionMintMode(bool mode) public {
597 require(false, stub_error);
598 mode;
599 dummy = 0;
600 }
601
602 // Check that account is the owner or admin of the collection
603 //
604 // @param user account to verify
605 // @return "true" if account is the owner or admin
606 //
607 // Selector: verifyOwnerOrAdmin(address) c2282493
608 function verifyOwnerOrAdmin(address user) public view returns (bool) {
609 require(false, stub_error);
610 user;
611 dummy;
612 return false;
613 }
614
615 // Returns collection type
616 //
617 // @return `Fungible` or `NFT` or `ReFungible`
618 //
619 // Selector: uniqueCollectionType() d34b55b8
620 function uniqueCollectionType() public returns (string memory) {
621 require(false, stub_error);
622 dummy = 0;
623 return "";
624 }
625}
626375
627// Selector: 780e9d63376// Selector: 780e9d63
628contract ERC721Enumerable is Dummy, ERC165 {377contract ERC721Enumerable is Dummy, ERC165 {
666 }415 }
667}416}
417
418// Selector: ca08c92c
419contract Collection is Dummy, ERC165 {
420 // Set collection property.
421 //
422 // @param key Property key.
423 // @param value Propery value.
424 //
425 // Selector: setCollectionProperty(string,bytes) 2f073f66
426 function setCollectionProperty(string memory key, bytes memory value)
427 public
428 {
429 require(false, stub_error);
430 key;
431 value;
432 dummy = 0;
433 }
434
435 // Delete collection property.
436 //
437 // @param key Property key.
438 //
439 // Selector: deleteCollectionProperty(string) 7b7debce
440 function deleteCollectionProperty(string memory key) public {
441 require(false, stub_error);
442 key;
443 dummy = 0;
444 }
445
446 // Get collection property.
447 //
448 // @dev Throws error if key not found.
449 //
450 // @param key Property key.
451 // @return bytes The property corresponding to the key.
452 //
453 // Selector: collectionProperty(string) cf24fd6d
454 function collectionProperty(string memory key)
455 public
456 view
457 returns (bytes memory)
458 {
459 require(false, stub_error);
460 key;
461 dummy;
462 return hex"";
463 }
464
465 // Set the sponsor of the collection.
466 //
467 // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.
468 //
469 // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.
470 //
471 // Selector: setCollectionSponsor(address) 7623402e
472 function setCollectionSponsor(address sponsor) public {
473 require(false, stub_error);
474 sponsor;
475 dummy = 0;
476 }
477
478 // Collection sponsorship confirmation.
479 //
480 // @dev After setting the sponsor for the collection, it must be confirmed with this function.
481 //
482 // Selector: confirmCollectionSponsorship() 3c50e97a
483 function confirmCollectionSponsorship() public {
484 require(false, stub_error);
485 dummy = 0;
486 }
487
488 // Set limits for the collection.
489 // @dev Throws error if limit not found.
490 // @param limit Name of the limit. Valid names:
491 // "accountTokenOwnershipLimit",
492 // "sponsoredDataSize",
493 // "sponsoredDataRateLimit",
494 // "tokenLimit",
495 // "sponsorTransferTimeout",
496 // "sponsorApproveTimeout"
497 // @param value Value of the limit.
498 //
499 // Selector: setCollectionLimit(string,uint32) 6a3841db
500 function setCollectionLimit(string memory limit, uint32 value) public {
501 require(false, stub_error);
502 limit;
503 value;
504 dummy = 0;
505 }
506
507 // Set limits for the collection.
508 // @dev Throws error if limit not found.
509 // @param limit Name of the limit. Valid names:
510 // "ownerCanTransfer",
511 // "ownerCanDestroy",
512 // "transfersEnabled"
513 // @param value Value of the limit.
514 //
515 // Selector: setCollectionLimit(string,bool) 993b7fba
516 function setCollectionLimit(string memory limit, bool value) public {
517 require(false, stub_error);
518 limit;
519 value;
520 dummy = 0;
521 }
522
523 // Get contract address.
524 //
525 // Selector: contractAddress() f6b4dfb4
526 function contractAddress() public view returns (address) {
527 require(false, stub_error);
528 dummy;
529 return 0x0000000000000000000000000000000000000000;
530 }
531
532 // Add collection admin by substrate address.
533 // @param new_admin Substrate administrator address.
534 //
535 // Selector: addCollectionAdminSubstrate(uint256) 5730062b
536 function addCollectionAdminSubstrate(uint256 newAdmin) public {
537 require(false, stub_error);
538 newAdmin;
539 dummy = 0;
540 }
541
542 // Remove collection admin by substrate address.
543 // @param admin Substrate administrator address.
544 //
545 // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9
546 function removeCollectionAdminSubstrate(uint256 admin) public {
547 require(false, stub_error);
548 admin;
549 dummy = 0;
550 }
551
552 // Add collection admin.
553 // @param new_admin Address of the added administrator.
554 //
555 // Selector: addCollectionAdmin(address) 92e462c7
556 function addCollectionAdmin(address newAdmin) public {
557 require(false, stub_error);
558 newAdmin;
559 dummy = 0;
560 }
561
562 // Remove collection admin.
563 //
564 // @param new_admin Address of the removed administrator.
565 //
566 // Selector: removeCollectionAdmin(address) fafd7b42
567 function removeCollectionAdmin(address admin) public {
568 require(false, stub_error);
569 admin;
570 dummy = 0;
571 }
572
573 // Toggle accessibility of collection nesting.
574 //
575 // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
576 //
577 // Selector: setCollectionNesting(bool) 112d4586
578 function setCollectionNesting(bool enable) public {
579 require(false, stub_error);
580 enable;
581 dummy = 0;
582 }
583
584 // Toggle accessibility of collection nesting.
585 //
586 // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
587 // @param collections Addresses of collections that will be available for nesting.
588 //
589 // Selector: setCollectionNesting(bool,address[]) 64872396
590 function setCollectionNesting(bool enable, address[] memory collections)
591 public
592 {
593 require(false, stub_error);
594 enable;
595 collections;
596 dummy = 0;
597 }
598
599 // Set the collection access method.
600 // @param mode Access mode
601 // 0 for Normal
602 // 1 for AllowList
603 //
604 // Selector: setCollectionAccess(uint8) 41835d4c
605 function setCollectionAccess(uint8 mode) public {
606 require(false, stub_error);
607 mode;
608 dummy = 0;
609 }
610
611 // Add the user to the allowed list.
612 //
613 // @param user Address of a trusted user.
614 //
615 // Selector: addToCollectionAllowList(address) 67844fe6
616 function addToCollectionAllowList(address user) public {
617 require(false, stub_error);
618 user;
619 dummy = 0;
620 }
621
622 // Remove the user from the allowed list.
623 //
624 // @param user Address of a removed user.
625 //
626 // Selector: removeFromCollectionAllowList(address) 85c51acb
627 function removeFromCollectionAllowList(address user) public {
628 require(false, stub_error);
629 user;
630 dummy = 0;
631 }
632
633 // Switch permission for minting.
634 //
635 // @param mode Enable if "true".
636 //
637 // Selector: setCollectionMintMode(bool) 00018e84
638 function setCollectionMintMode(bool mode) public {
639 require(false, stub_error);
640 mode;
641 dummy = 0;
642 }
643
644 // Check that account is the owner or admin of the collection
645 //
646 // @param user account to verify
647 // @return "true" if account is the owner or admin
648 //
649 // Selector: verifyOwnerOrAdmin(address) c2282493
650 function verifyOwnerOrAdmin(address user) public view returns (bool) {
651 require(false, stub_error);
652 user;
653 dummy;
654 return false;
655 }
656
657 // Returns collection type
658 //
659 // @return `Fungible` or `NFT` or `ReFungible`
660 //
661 // Selector: uniqueCollectionType() d34b55b8
662 function uniqueCollectionType() public returns (string memory) {
663 require(false, stub_error);
664 dummy = 0;
665 return "";
666 }
667
668 // Changes collection owner
669 //
670 // @dev Owner can be changed only by current owner
671 // @param newOwner new owner
672 //
673 // Selector: changeOwner(address) a6f9dae1
674 function changeOwner(address newOwner) public {
675 require(false, stub_error);
676 newOwner;
677 dummy = 0;
678 }
679}
668680
669// Selector: d74d154f681// Selector: d74d154f
670contract ERC721UniqueExtensions is Dummy, ERC165 {682contract ERC721UniqueExtensions is Dummy, ERC165 {
modifiedpallets/refungible/src/stubs/UniqueRefungible.rawdiffbeforeafterboth

binary blob — no preview

modifiedpallets/refungible/src/stubs/UniqueRefungible.soldiffbeforeafterboth
371 }371 }
372}372}
373
374// Selector: 6cf113cd
375contract Collection is Dummy, ERC165 {
376 // Set collection property.
377 //
378 // @param key Property key.
379 // @param value Propery value.
380 //
381 // Selector: setCollectionProperty(string,bytes) 2f073f66
382 function setCollectionProperty(string memory key, bytes memory value)
383 public
384 {
385 require(false, stub_error);
386 key;
387 value;
388 dummy = 0;
389 }
390
391 // Delete collection property.
392 //
393 // @param key Property key.
394 //
395 // Selector: deleteCollectionProperty(string) 7b7debce
396 function deleteCollectionProperty(string memory key) public {
397 require(false, stub_error);
398 key;
399 dummy = 0;
400 }
401
402 // Get collection property.
403 //
404 // @dev Throws error if key not found.
405 //
406 // @param key Property key.
407 // @return bytes The property corresponding to the key.
408 //
409 // Selector: collectionProperty(string) cf24fd6d
410 function collectionProperty(string memory key)
411 public
412 view
413 returns (bytes memory)
414 {
415 require(false, stub_error);
416 key;
417 dummy;
418 return hex"";
419 }
420
421 // Set the sponsor of the collection.
422 //
423 // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.
424 //
425 // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.
426 //
427 // Selector: setCollectionSponsor(address) 7623402e
428 function setCollectionSponsor(address sponsor) public {
429 require(false, stub_error);
430 sponsor;
431 dummy = 0;
432 }
433
434 // Collection sponsorship confirmation.
435 //
436 // @dev After setting the sponsor for the collection, it must be confirmed with this function.
437 //
438 // Selector: confirmCollectionSponsorship() 3c50e97a
439 function confirmCollectionSponsorship() public {
440 require(false, stub_error);
441 dummy = 0;
442 }
443
444 // Set limits for the collection.
445 // @dev Throws error if limit not found.
446 // @param limit Name of the limit. Valid names:
447 // "accountTokenOwnershipLimit",
448 // "sponsoredDataSize",
449 // "sponsoredDataRateLimit",
450 // "tokenLimit",
451 // "sponsorTransferTimeout",
452 // "sponsorApproveTimeout"
453 // @param value Value of the limit.
454 //
455 // Selector: setCollectionLimit(string,uint32) 6a3841db
456 function setCollectionLimit(string memory limit, uint32 value) public {
457 require(false, stub_error);
458 limit;
459 value;
460 dummy = 0;
461 }
462
463 // Set limits for the collection.
464 // @dev Throws error if limit not found.
465 // @param limit Name of the limit. Valid names:
466 // "ownerCanTransfer",
467 // "ownerCanDestroy",
468 // "transfersEnabled"
469 // @param value Value of the limit.
470 //
471 // Selector: setCollectionLimit(string,bool) 993b7fba
472 function setCollectionLimit(string memory limit, bool value) public {
473 require(false, stub_error);
474 limit;
475 value;
476 dummy = 0;
477 }
478
479 // Get contract address.
480 //
481 // Selector: contractAddress() f6b4dfb4
482 function contractAddress() public view returns (address) {
483 require(false, stub_error);
484 dummy;
485 return 0x0000000000000000000000000000000000000000;
486 }
487
488 // Add collection admin by substrate address.
489 // @param new_admin Substrate administrator address.
490 //
491 // Selector: addCollectionAdminSubstrate(uint256) 5730062b
492 function addCollectionAdminSubstrate(uint256 newAdmin) public {
493 require(false, stub_error);
494 newAdmin;
495 dummy = 0;
496 }
497
498 // Remove collection admin by substrate address.
499 // @param admin Substrate administrator address.
500 //
501 // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9
502 function removeCollectionAdminSubstrate(uint256 admin) public {
503 require(false, stub_error);
504 admin;
505 dummy = 0;
506 }
507
508 // Add collection admin.
509 // @param new_admin Address of the added administrator.
510 //
511 // Selector: addCollectionAdmin(address) 92e462c7
512 function addCollectionAdmin(address newAdmin) public {
513 require(false, stub_error);
514 newAdmin;
515 dummy = 0;
516 }
517
518 // Remove collection admin.
519 //
520 // @param new_admin Address of the removed administrator.
521 //
522 // Selector: removeCollectionAdmin(address) fafd7b42
523 function removeCollectionAdmin(address admin) public {
524 require(false, stub_error);
525 admin;
526 dummy = 0;
527 }
528
529 // Toggle accessibility of collection nesting.
530 //
531 // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
532 //
533 // Selector: setCollectionNesting(bool) 112d4586
534 function setCollectionNesting(bool enable) public {
535 require(false, stub_error);
536 enable;
537 dummy = 0;
538 }
539
540 // Toggle accessibility of collection nesting.
541 //
542 // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
543 // @param collections Addresses of collections that will be available for nesting.
544 //
545 // Selector: setCollectionNesting(bool,address[]) 64872396
546 function setCollectionNesting(bool enable, address[] memory collections)
547 public
548 {
549 require(false, stub_error);
550 enable;
551 collections;
552 dummy = 0;
553 }
554
555 // Set the collection access method.
556 // @param mode Access mode
557 // 0 for Normal
558 // 1 for AllowList
559 //
560 // Selector: setCollectionAccess(uint8) 41835d4c
561 function setCollectionAccess(uint8 mode) public {
562 require(false, stub_error);
563 mode;
564 dummy = 0;
565 }
566
567 // Add the user to the allowed list.
568 //
569 // @param user Address of a trusted user.
570 //
571 // Selector: addToCollectionAllowList(address) 67844fe6
572 function addToCollectionAllowList(address user) public {
573 require(false, stub_error);
574 user;
575 dummy = 0;
576 }
577
578 // Remove the user from the allowed list.
579 //
580 // @param user Address of a removed user.
581 //
582 // Selector: removeFromCollectionAllowList(address) 85c51acb
583 function removeFromCollectionAllowList(address user) public {
584 require(false, stub_error);
585 user;
586 dummy = 0;
587 }
588
589 // Switch permission for minting.
590 //
591 // @param mode Enable if "true".
592 //
593 // Selector: setCollectionMintMode(bool) 00018e84
594 function setCollectionMintMode(bool mode) public {
595 require(false, stub_error);
596 mode;
597 dummy = 0;
598 }
599
600 // Check that account is the owner or admin of the collection
601 //
602 // @param user account to verify
603 // @return "true" if account is the owner or admin
604 //
605 // Selector: verifyOwnerOrAdmin(address) c2282493
606 function verifyOwnerOrAdmin(address user) public view returns (bool) {
607 require(false, stub_error);
608 user;
609 dummy;
610 return false;
611 }
612
613 // Returns collection type
614 //
615 // @return `Fungible` or `NFT` or `ReFungible`
616 //
617 // Selector: uniqueCollectionType() d34b55b8
618 function uniqueCollectionType() public returns (string memory) {
619 require(false, stub_error);
620 dummy = 0;
621 return "";
622 }
623}
624373
625// Selector: 780e9d63374// Selector: 780e9d63
626contract ERC721Enumerable is Dummy, ERC165 {375contract ERC721Enumerable is Dummy, ERC165 {
757 }506 }
758}507}
508
509// Selector: ca08c92c
510contract Collection is Dummy, ERC165 {
511 // Set collection property.
512 //
513 // @param key Property key.
514 // @param value Propery value.
515 //
516 // Selector: setCollectionProperty(string,bytes) 2f073f66
517 function setCollectionProperty(string memory key, bytes memory value)
518 public
519 {
520 require(false, stub_error);
521 key;
522 value;
523 dummy = 0;
524 }
525
526 // Delete collection property.
527 //
528 // @param key Property key.
529 //
530 // Selector: deleteCollectionProperty(string) 7b7debce
531 function deleteCollectionProperty(string memory key) public {
532 require(false, stub_error);
533 key;
534 dummy = 0;
535 }
536
537 // Get collection property.
538 //
539 // @dev Throws error if key not found.
540 //
541 // @param key Property key.
542 // @return bytes The property corresponding to the key.
543 //
544 // Selector: collectionProperty(string) cf24fd6d
545 function collectionProperty(string memory key)
546 public
547 view
548 returns (bytes memory)
549 {
550 require(false, stub_error);
551 key;
552 dummy;
553 return hex"";
554 }
555
556 // Set the sponsor of the collection.
557 //
558 // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.
559 //
560 // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.
561 //
562 // Selector: setCollectionSponsor(address) 7623402e
563 function setCollectionSponsor(address sponsor) public {
564 require(false, stub_error);
565 sponsor;
566 dummy = 0;
567 }
568
569 // Collection sponsorship confirmation.
570 //
571 // @dev After setting the sponsor for the collection, it must be confirmed with this function.
572 //
573 // Selector: confirmCollectionSponsorship() 3c50e97a
574 function confirmCollectionSponsorship() public {
575 require(false, stub_error);
576 dummy = 0;
577 }
578
579 // Set limits for the collection.
580 // @dev Throws error if limit not found.
581 // @param limit Name of the limit. Valid names:
582 // "accountTokenOwnershipLimit",
583 // "sponsoredDataSize",
584 // "sponsoredDataRateLimit",
585 // "tokenLimit",
586 // "sponsorTransferTimeout",
587 // "sponsorApproveTimeout"
588 // @param value Value of the limit.
589 //
590 // Selector: setCollectionLimit(string,uint32) 6a3841db
591 function setCollectionLimit(string memory limit, uint32 value) public {
592 require(false, stub_error);
593 limit;
594 value;
595 dummy = 0;
596 }
597
598 // Set limits for the collection.
599 // @dev Throws error if limit not found.
600 // @param limit Name of the limit. Valid names:
601 // "ownerCanTransfer",
602 // "ownerCanDestroy",
603 // "transfersEnabled"
604 // @param value Value of the limit.
605 //
606 // Selector: setCollectionLimit(string,bool) 993b7fba
607 function setCollectionLimit(string memory limit, bool value) public {
608 require(false, stub_error);
609 limit;
610 value;
611 dummy = 0;
612 }
613
614 // Get contract address.
615 //
616 // Selector: contractAddress() f6b4dfb4
617 function contractAddress() public view returns (address) {
618 require(false, stub_error);
619 dummy;
620 return 0x0000000000000000000000000000000000000000;
621 }
622
623 // Add collection admin by substrate address.
624 // @param new_admin Substrate administrator address.
625 //
626 // Selector: addCollectionAdminSubstrate(uint256) 5730062b
627 function addCollectionAdminSubstrate(uint256 newAdmin) public {
628 require(false, stub_error);
629 newAdmin;
630 dummy = 0;
631 }
632
633 // Remove collection admin by substrate address.
634 // @param admin Substrate administrator address.
635 //
636 // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9
637 function removeCollectionAdminSubstrate(uint256 admin) public {
638 require(false, stub_error);
639 admin;
640 dummy = 0;
641 }
642
643 // Add collection admin.
644 // @param new_admin Address of the added administrator.
645 //
646 // Selector: addCollectionAdmin(address) 92e462c7
647 function addCollectionAdmin(address newAdmin) public {
648 require(false, stub_error);
649 newAdmin;
650 dummy = 0;
651 }
652
653 // Remove collection admin.
654 //
655 // @param new_admin Address of the removed administrator.
656 //
657 // Selector: removeCollectionAdmin(address) fafd7b42
658 function removeCollectionAdmin(address admin) public {
659 require(false, stub_error);
660 admin;
661 dummy = 0;
662 }
663
664 // Toggle accessibility of collection nesting.
665 //
666 // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
667 //
668 // Selector: setCollectionNesting(bool) 112d4586
669 function setCollectionNesting(bool enable) public {
670 require(false, stub_error);
671 enable;
672 dummy = 0;
673 }
674
675 // Toggle accessibility of collection nesting.
676 //
677 // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
678 // @param collections Addresses of collections that will be available for nesting.
679 //
680 // Selector: setCollectionNesting(bool,address[]) 64872396
681 function setCollectionNesting(bool enable, address[] memory collections)
682 public
683 {
684 require(false, stub_error);
685 enable;
686 collections;
687 dummy = 0;
688 }
689
690 // Set the collection access method.
691 // @param mode Access mode
692 // 0 for Normal
693 // 1 for AllowList
694 //
695 // Selector: setCollectionAccess(uint8) 41835d4c
696 function setCollectionAccess(uint8 mode) public {
697 require(false, stub_error);
698 mode;
699 dummy = 0;
700 }
701
702 // Add the user to the allowed list.
703 //
704 // @param user Address of a trusted user.
705 //
706 // Selector: addToCollectionAllowList(address) 67844fe6
707 function addToCollectionAllowList(address user) public {
708 require(false, stub_error);
709 user;
710 dummy = 0;
711 }
712
713 // Remove the user from the allowed list.
714 //
715 // @param user Address of a removed user.
716 //
717 // Selector: removeFromCollectionAllowList(address) 85c51acb
718 function removeFromCollectionAllowList(address user) public {
719 require(false, stub_error);
720 user;
721 dummy = 0;
722 }
723
724 // Switch permission for minting.
725 //
726 // @param mode Enable if "true".
727 //
728 // Selector: setCollectionMintMode(bool) 00018e84
729 function setCollectionMintMode(bool mode) public {
730 require(false, stub_error);
731 mode;
732 dummy = 0;
733 }
734
735 // Check that account is the owner or admin of the collection
736 //
737 // @param user account to verify
738 // @return "true" if account is the owner or admin
739 //
740 // Selector: verifyOwnerOrAdmin(address) c2282493
741 function verifyOwnerOrAdmin(address user) public view returns (bool) {
742 require(false, stub_error);
743 user;
744 dummy;
745 return false;
746 }
747
748 // Returns collection type
749 //
750 // @return `Fungible` or `NFT` or `ReFungible`
751 //
752 // Selector: uniqueCollectionType() d34b55b8
753 function uniqueCollectionType() public returns (string memory) {
754 require(false, stub_error);
755 dummy = 0;
756 return "";
757 }
758
759 // Changes collection owner
760 //
761 // @dev Owner can be changed only by current owner
762 // @param newOwner new owner
763 //
764 // Selector: changeOwner(address) a6f9dae1
765 function changeOwner(address newOwner) public {
766 require(false, stub_error);
767 newOwner;
768 dummy = 0;
769 }
770}
759771
760contract UniqueRefungible is772contract UniqueRefungible is
761 Dummy,773 Dummy,
modifiedtests/src/eth/api/UniqueFungible.soldiffbeforeafterboth
22 );22 );
23}23}
24
25// Selector: 6cf113cd
26interface Collection is Dummy, ERC165 {
27 // Set collection property.
28 //
29 // @param key Property key.
30 // @param value Propery value.
31 //
32 // Selector: setCollectionProperty(string,bytes) 2f073f66
33 function setCollectionProperty(string memory key, bytes memory value)
34 external;
35
36 // Delete collection property.
37 //
38 // @param key Property key.
39 //
40 // Selector: deleteCollectionProperty(string) 7b7debce
41 function deleteCollectionProperty(string memory key) external;
42
43 // Get collection property.
44 //
45 // @dev Throws error if key not found.
46 //
47 // @param key Property key.
48 // @return bytes The property corresponding to the key.
49 //
50 // Selector: collectionProperty(string) cf24fd6d
51 function collectionProperty(string memory key)
52 external
53 view
54 returns (bytes memory);
55
56 // Set the sponsor of the collection.
57 //
58 // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.
59 //
60 // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.
61 //
62 // Selector: setCollectionSponsor(address) 7623402e
63 function setCollectionSponsor(address sponsor) external;
64
65 // Collection sponsorship confirmation.
66 //
67 // @dev After setting the sponsor for the collection, it must be confirmed with this function.
68 //
69 // Selector: confirmCollectionSponsorship() 3c50e97a
70 function confirmCollectionSponsorship() external;
71
72 // Set limits for the collection.
73 // @dev Throws error if limit not found.
74 // @param limit Name of the limit. Valid names:
75 // "accountTokenOwnershipLimit",
76 // "sponsoredDataSize",
77 // "sponsoredDataRateLimit",
78 // "tokenLimit",
79 // "sponsorTransferTimeout",
80 // "sponsorApproveTimeout"
81 // @param value Value of the limit.
82 //
83 // Selector: setCollectionLimit(string,uint32) 6a3841db
84 function setCollectionLimit(string memory limit, uint32 value) external;
85
86 // Set limits for the collection.
87 // @dev Throws error if limit not found.
88 // @param limit Name of the limit. Valid names:
89 // "ownerCanTransfer",
90 // "ownerCanDestroy",
91 // "transfersEnabled"
92 // @param value Value of the limit.
93 //
94 // Selector: setCollectionLimit(string,bool) 993b7fba
95 function setCollectionLimit(string memory limit, bool value) external;
96
97 // Get contract address.
98 //
99 // Selector: contractAddress() f6b4dfb4
100 function contractAddress() external view returns (address);
101
102 // Add collection admin by substrate address.
103 // @param new_admin Substrate administrator address.
104 //
105 // Selector: addCollectionAdminSubstrate(uint256) 5730062b
106 function addCollectionAdminSubstrate(uint256 newAdmin) external;
107
108 // Remove collection admin by substrate address.
109 // @param admin Substrate administrator address.
110 //
111 // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9
112 function removeCollectionAdminSubstrate(uint256 admin) external;
113
114 // Add collection admin.
115 // @param new_admin Address of the added administrator.
116 //
117 // Selector: addCollectionAdmin(address) 92e462c7
118 function addCollectionAdmin(address newAdmin) external;
119
120 // Remove collection admin.
121 //
122 // @param new_admin Address of the removed administrator.
123 //
124 // Selector: removeCollectionAdmin(address) fafd7b42
125 function removeCollectionAdmin(address admin) external;
126
127 // Toggle accessibility of collection nesting.
128 //
129 // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
130 //
131 // Selector: setCollectionNesting(bool) 112d4586
132 function setCollectionNesting(bool enable) external;
133
134 // Toggle accessibility of collection nesting.
135 //
136 // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
137 // @param collections Addresses of collections that will be available for nesting.
138 //
139 // Selector: setCollectionNesting(bool,address[]) 64872396
140 function setCollectionNesting(bool enable, address[] memory collections)
141 external;
142
143 // Set the collection access method.
144 // @param mode Access mode
145 // 0 for Normal
146 // 1 for AllowList
147 //
148 // Selector: setCollectionAccess(uint8) 41835d4c
149 function setCollectionAccess(uint8 mode) external;
150
151 // Add the user to the allowed list.
152 //
153 // @param user Address of a trusted user.
154 //
155 // Selector: addToCollectionAllowList(address) 67844fe6
156 function addToCollectionAllowList(address user) external;
157
158 // Remove the user from the allowed list.
159 //
160 // @param user Address of a removed user.
161 //
162 // Selector: removeFromCollectionAllowList(address) 85c51acb
163 function removeFromCollectionAllowList(address user) external;
164
165 // Switch permission for minting.
166 //
167 // @param mode Enable if "true".
168 //
169 // Selector: setCollectionMintMode(bool) 00018e84
170 function setCollectionMintMode(bool mode) external;
171
172 // Check that account is the owner or admin of the collection
173 //
174 // @param user account to verify
175 // @return "true" if account is the owner or admin
176 //
177 // Selector: verifyOwnerOrAdmin(address) c2282493
178 function verifyOwnerOrAdmin(address user) external view returns (bool);
179
180 // Returns collection type
181 //
182 // @return `Fungible` or `NFT` or `ReFungible`
183 //
184 // Selector: uniqueCollectionType() d34b55b8
185 function uniqueCollectionType() external returns (string memory);
186}
18724
188// Selector: 79cc679025// Selector: 79cc6790
189interface ERC20UniqueExtensions is Dummy, ERC165 {26interface ERC20UniqueExtensions is Dummy, ERC165 {
228 returns (uint256);65 returns (uint256);
229}66}
67
68// Selector: ca08c92c
69interface Collection is Dummy, ERC165 {
70 // Set collection property.
71 //
72 // @param key Property key.
73 // @param value Propery value.
74 //
75 // Selector: setCollectionProperty(string,bytes) 2f073f66
76 function setCollectionProperty(string memory key, bytes memory value)
77 external;
78
79 // Delete collection property.
80 //
81 // @param key Property key.
82 //
83 // Selector: deleteCollectionProperty(string) 7b7debce
84 function deleteCollectionProperty(string memory key) external;
85
86 // Get collection property.
87 //
88 // @dev Throws error if key not found.
89 //
90 // @param key Property key.
91 // @return bytes The property corresponding to the key.
92 //
93 // Selector: collectionProperty(string) cf24fd6d
94 function collectionProperty(string memory key)
95 external
96 view
97 returns (bytes memory);
98
99 // Set the sponsor of the collection.
100 //
101 // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.
102 //
103 // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.
104 //
105 // Selector: setCollectionSponsor(address) 7623402e
106 function setCollectionSponsor(address sponsor) external;
107
108 // Collection sponsorship confirmation.
109 //
110 // @dev After setting the sponsor for the collection, it must be confirmed with this function.
111 //
112 // Selector: confirmCollectionSponsorship() 3c50e97a
113 function confirmCollectionSponsorship() external;
114
115 // Set limits for the collection.
116 // @dev Throws error if limit not found.
117 // @param limit Name of the limit. Valid names:
118 // "accountTokenOwnershipLimit",
119 // "sponsoredDataSize",
120 // "sponsoredDataRateLimit",
121 // "tokenLimit",
122 // "sponsorTransferTimeout",
123 // "sponsorApproveTimeout"
124 // @param value Value of the limit.
125 //
126 // Selector: setCollectionLimit(string,uint32) 6a3841db
127 function setCollectionLimit(string memory limit, uint32 value) external;
128
129 // Set limits for the collection.
130 // @dev Throws error if limit not found.
131 // @param limit Name of the limit. Valid names:
132 // "ownerCanTransfer",
133 // "ownerCanDestroy",
134 // "transfersEnabled"
135 // @param value Value of the limit.
136 //
137 // Selector: setCollectionLimit(string,bool) 993b7fba
138 function setCollectionLimit(string memory limit, bool value) external;
139
140 // Get contract address.
141 //
142 // Selector: contractAddress() f6b4dfb4
143 function contractAddress() external view returns (address);
144
145 // Add collection admin by substrate address.
146 // @param new_admin Substrate administrator address.
147 //
148 // Selector: addCollectionAdminSubstrate(uint256) 5730062b
149 function addCollectionAdminSubstrate(uint256 newAdmin) external;
150
151 // Remove collection admin by substrate address.
152 // @param admin Substrate administrator address.
153 //
154 // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9
155 function removeCollectionAdminSubstrate(uint256 admin) external;
156
157 // Add collection admin.
158 // @param new_admin Address of the added administrator.
159 //
160 // Selector: addCollectionAdmin(address) 92e462c7
161 function addCollectionAdmin(address newAdmin) external;
162
163 // Remove collection admin.
164 //
165 // @param new_admin Address of the removed administrator.
166 //
167 // Selector: removeCollectionAdmin(address) fafd7b42
168 function removeCollectionAdmin(address admin) external;
169
170 // Toggle accessibility of collection nesting.
171 //
172 // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
173 //
174 // Selector: setCollectionNesting(bool) 112d4586
175 function setCollectionNesting(bool enable) external;
176
177 // Toggle accessibility of collection nesting.
178 //
179 // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
180 // @param collections Addresses of collections that will be available for nesting.
181 //
182 // Selector: setCollectionNesting(bool,address[]) 64872396
183 function setCollectionNesting(bool enable, address[] memory collections)
184 external;
185
186 // Set the collection access method.
187 // @param mode Access mode
188 // 0 for Normal
189 // 1 for AllowList
190 //
191 // Selector: setCollectionAccess(uint8) 41835d4c
192 function setCollectionAccess(uint8 mode) external;
193
194 // Add the user to the allowed list.
195 //
196 // @param user Address of a trusted user.
197 //
198 // Selector: addToCollectionAllowList(address) 67844fe6
199 function addToCollectionAllowList(address user) external;
200
201 // Remove the user from the allowed list.
202 //
203 // @param user Address of a removed user.
204 //
205 // Selector: removeFromCollectionAllowList(address) 85c51acb
206 function removeFromCollectionAllowList(address user) external;
207
208 // Switch permission for minting.
209 //
210 // @param mode Enable if "true".
211 //
212 // Selector: setCollectionMintMode(bool) 00018e84
213 function setCollectionMintMode(bool mode) external;
214
215 // Check that account is the owner or admin of the collection
216 //
217 // @param user account to verify
218 // @return "true" if account is the owner or admin
219 //
220 // Selector: verifyOwnerOrAdmin(address) c2282493
221 function verifyOwnerOrAdmin(address user) external view returns (bool);
222
223 // Returns collection type
224 //
225 // @return `Fungible` or `NFT` or `ReFungible`
226 //
227 // Selector: uniqueCollectionType() d34b55b8
228 function uniqueCollectionType() external returns (string memory);
229
230 // Changes collection owner
231 //
232 // @dev Owner can be changed only by current owner
233 // @param newOwner new owner
234 //
235 // Selector: changeOwner(address) a6f9dae1
236 function changeOwner(address newOwner) external;
237}
230238
231interface UniqueFungible is239interface UniqueFungible is
232 Dummy,240 Dummy,
modifiedtests/src/eth/api/UniqueNFT.soldiffbeforeafterboth
250 function finishMinting() external returns (bool);250 function finishMinting() external returns (bool);
251}251}
252
253// Selector: 6cf113cd
254interface Collection is Dummy, ERC165 {
255 // Set collection property.
256 //
257 // @param key Property key.
258 // @param value Propery value.
259 //
260 // Selector: setCollectionProperty(string,bytes) 2f073f66
261 function setCollectionProperty(string memory key, bytes memory value)
262 external;
263
264 // Delete collection property.
265 //
266 // @param key Property key.
267 //
268 // Selector: deleteCollectionProperty(string) 7b7debce
269 function deleteCollectionProperty(string memory key) external;
270
271 // Get collection property.
272 //
273 // @dev Throws error if key not found.
274 //
275 // @param key Property key.
276 // @return bytes The property corresponding to the key.
277 //
278 // Selector: collectionProperty(string) cf24fd6d
279 function collectionProperty(string memory key)
280 external
281 view
282 returns (bytes memory);
283
284 // Set the sponsor of the collection.
285 //
286 // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.
287 //
288 // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.
289 //
290 // Selector: setCollectionSponsor(address) 7623402e
291 function setCollectionSponsor(address sponsor) external;
292
293 // Collection sponsorship confirmation.
294 //
295 // @dev After setting the sponsor for the collection, it must be confirmed with this function.
296 //
297 // Selector: confirmCollectionSponsorship() 3c50e97a
298 function confirmCollectionSponsorship() external;
299
300 // Set limits for the collection.
301 // @dev Throws error if limit not found.
302 // @param limit Name of the limit. Valid names:
303 // "accountTokenOwnershipLimit",
304 // "sponsoredDataSize",
305 // "sponsoredDataRateLimit",
306 // "tokenLimit",
307 // "sponsorTransferTimeout",
308 // "sponsorApproveTimeout"
309 // @param value Value of the limit.
310 //
311 // Selector: setCollectionLimit(string,uint32) 6a3841db
312 function setCollectionLimit(string memory limit, uint32 value) external;
313
314 // Set limits for the collection.
315 // @dev Throws error if limit not found.
316 // @param limit Name of the limit. Valid names:
317 // "ownerCanTransfer",
318 // "ownerCanDestroy",
319 // "transfersEnabled"
320 // @param value Value of the limit.
321 //
322 // Selector: setCollectionLimit(string,bool) 993b7fba
323 function setCollectionLimit(string memory limit, bool value) external;
324
325 // Get contract address.
326 //
327 // Selector: contractAddress() f6b4dfb4
328 function contractAddress() external view returns (address);
329
330 // Add collection admin by substrate address.
331 // @param new_admin Substrate administrator address.
332 //
333 // Selector: addCollectionAdminSubstrate(uint256) 5730062b
334 function addCollectionAdminSubstrate(uint256 newAdmin) external;
335
336 // Remove collection admin by substrate address.
337 // @param admin Substrate administrator address.
338 //
339 // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9
340 function removeCollectionAdminSubstrate(uint256 admin) external;
341
342 // Add collection admin.
343 // @param new_admin Address of the added administrator.
344 //
345 // Selector: addCollectionAdmin(address) 92e462c7
346 function addCollectionAdmin(address newAdmin) external;
347
348 // Remove collection admin.
349 //
350 // @param new_admin Address of the removed administrator.
351 //
352 // Selector: removeCollectionAdmin(address) fafd7b42
353 function removeCollectionAdmin(address admin) external;
354
355 // Toggle accessibility of collection nesting.
356 //
357 // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
358 //
359 // Selector: setCollectionNesting(bool) 112d4586
360 function setCollectionNesting(bool enable) external;
361
362 // Toggle accessibility of collection nesting.
363 //
364 // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
365 // @param collections Addresses of collections that will be available for nesting.
366 //
367 // Selector: setCollectionNesting(bool,address[]) 64872396
368 function setCollectionNesting(bool enable, address[] memory collections)
369 external;
370
371 // Set the collection access method.
372 // @param mode Access mode
373 // 0 for Normal
374 // 1 for AllowList
375 //
376 // Selector: setCollectionAccess(uint8) 41835d4c
377 function setCollectionAccess(uint8 mode) external;
378
379 // Add the user to the allowed list.
380 //
381 // @param user Address of a trusted user.
382 //
383 // Selector: addToCollectionAllowList(address) 67844fe6
384 function addToCollectionAllowList(address user) external;
385
386 // Remove the user from the allowed list.
387 //
388 // @param user Address of a removed user.
389 //
390 // Selector: removeFromCollectionAllowList(address) 85c51acb
391 function removeFromCollectionAllowList(address user) external;
392
393 // Switch permission for minting.
394 //
395 // @param mode Enable if "true".
396 //
397 // Selector: setCollectionMintMode(bool) 00018e84
398 function setCollectionMintMode(bool mode) external;
399
400 // Check that account is the owner or admin of the collection
401 //
402 // @param user account to verify
403 // @return "true" if account is the owner or admin
404 //
405 // Selector: verifyOwnerOrAdmin(address) c2282493
406 function verifyOwnerOrAdmin(address user) external view returns (bool);
407
408 // Returns collection type
409 //
410 // @return `Fungible` or `NFT` or `ReFungible`
411 //
412 // Selector: uniqueCollectionType() d34b55b8
413 function uniqueCollectionType() external returns (string memory);
414}
415252
416// Selector: 780e9d63253// Selector: 780e9d63
417interface ERC721Enumerable is Dummy, ERC165 {254interface ERC721Enumerable is Dummy, ERC165 {
439 function totalSupply() external view returns (uint256);276 function totalSupply() external view returns (uint256);
440}277}
278
279// Selector: ca08c92c
280interface Collection is Dummy, ERC165 {
281 // Set collection property.
282 //
283 // @param key Property key.
284 // @param value Propery value.
285 //
286 // Selector: setCollectionProperty(string,bytes) 2f073f66
287 function setCollectionProperty(string memory key, bytes memory value)
288 external;
289
290 // Delete collection property.
291 //
292 // @param key Property key.
293 //
294 // Selector: deleteCollectionProperty(string) 7b7debce
295 function deleteCollectionProperty(string memory key) external;
296
297 // Get collection property.
298 //
299 // @dev Throws error if key not found.
300 //
301 // @param key Property key.
302 // @return bytes The property corresponding to the key.
303 //
304 // Selector: collectionProperty(string) cf24fd6d
305 function collectionProperty(string memory key)
306 external
307 view
308 returns (bytes memory);
309
310 // Set the sponsor of the collection.
311 //
312 // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.
313 //
314 // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.
315 //
316 // Selector: setCollectionSponsor(address) 7623402e
317 function setCollectionSponsor(address sponsor) external;
318
319 // Collection sponsorship confirmation.
320 //
321 // @dev After setting the sponsor for the collection, it must be confirmed with this function.
322 //
323 // Selector: confirmCollectionSponsorship() 3c50e97a
324 function confirmCollectionSponsorship() external;
325
326 // Set limits for the collection.
327 // @dev Throws error if limit not found.
328 // @param limit Name of the limit. Valid names:
329 // "accountTokenOwnershipLimit",
330 // "sponsoredDataSize",
331 // "sponsoredDataRateLimit",
332 // "tokenLimit",
333 // "sponsorTransferTimeout",
334 // "sponsorApproveTimeout"
335 // @param value Value of the limit.
336 //
337 // Selector: setCollectionLimit(string,uint32) 6a3841db
338 function setCollectionLimit(string memory limit, uint32 value) external;
339
340 // Set limits for the collection.
341 // @dev Throws error if limit not found.
342 // @param limit Name of the limit. Valid names:
343 // "ownerCanTransfer",
344 // "ownerCanDestroy",
345 // "transfersEnabled"
346 // @param value Value of the limit.
347 //
348 // Selector: setCollectionLimit(string,bool) 993b7fba
349 function setCollectionLimit(string memory limit, bool value) external;
350
351 // Get contract address.
352 //
353 // Selector: contractAddress() f6b4dfb4
354 function contractAddress() external view returns (address);
355
356 // Add collection admin by substrate address.
357 // @param new_admin Substrate administrator address.
358 //
359 // Selector: addCollectionAdminSubstrate(uint256) 5730062b
360 function addCollectionAdminSubstrate(uint256 newAdmin) external;
361
362 // Remove collection admin by substrate address.
363 // @param admin Substrate administrator address.
364 //
365 // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9
366 function removeCollectionAdminSubstrate(uint256 admin) external;
367
368 // Add collection admin.
369 // @param new_admin Address of the added administrator.
370 //
371 // Selector: addCollectionAdmin(address) 92e462c7
372 function addCollectionAdmin(address newAdmin) external;
373
374 // Remove collection admin.
375 //
376 // @param new_admin Address of the removed administrator.
377 //
378 // Selector: removeCollectionAdmin(address) fafd7b42
379 function removeCollectionAdmin(address admin) external;
380
381 // Toggle accessibility of collection nesting.
382 //
383 // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
384 //
385 // Selector: setCollectionNesting(bool) 112d4586
386 function setCollectionNesting(bool enable) external;
387
388 // Toggle accessibility of collection nesting.
389 //
390 // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
391 // @param collections Addresses of collections that will be available for nesting.
392 //
393 // Selector: setCollectionNesting(bool,address[]) 64872396
394 function setCollectionNesting(bool enable, address[] memory collections)
395 external;
396
397 // Set the collection access method.
398 // @param mode Access mode
399 // 0 for Normal
400 // 1 for AllowList
401 //
402 // Selector: setCollectionAccess(uint8) 41835d4c
403 function setCollectionAccess(uint8 mode) external;
404
405 // Add the user to the allowed list.
406 //
407 // @param user Address of a trusted user.
408 //
409 // Selector: addToCollectionAllowList(address) 67844fe6
410 function addToCollectionAllowList(address user) external;
411
412 // Remove the user from the allowed list.
413 //
414 // @param user Address of a removed user.
415 //
416 // Selector: removeFromCollectionAllowList(address) 85c51acb
417 function removeFromCollectionAllowList(address user) external;
418
419 // Switch permission for minting.
420 //
421 // @param mode Enable if "true".
422 //
423 // Selector: setCollectionMintMode(bool) 00018e84
424 function setCollectionMintMode(bool mode) external;
425
426 // Check that account is the owner or admin of the collection
427 //
428 // @param user account to verify
429 // @return "true" if account is the owner or admin
430 //
431 // Selector: verifyOwnerOrAdmin(address) c2282493
432 function verifyOwnerOrAdmin(address user) external view returns (bool);
433
434 // Returns collection type
435 //
436 // @return `Fungible` or `NFT` or `ReFungible`
437 //
438 // Selector: uniqueCollectionType() d34b55b8
439 function uniqueCollectionType() external returns (string memory);
440
441 // Changes collection owner
442 //
443 // @dev Owner can be changed only by current owner
444 // @param newOwner new owner
445 //
446 // Selector: changeOwner(address) a6f9dae1
447 function changeOwner(address newOwner) external;
448}
441449
442// Selector: d74d154f450// Selector: d74d154f
443interface ERC721UniqueExtensions is Dummy, ERC165 {451interface ERC721UniqueExtensions is Dummy, ERC165 {
modifiedtests/src/eth/api/UniqueRefungible.soldiffbeforeafterboth
248 function finishMinting() external returns (bool);248 function finishMinting() external returns (bool);
249}249}
250
251// Selector: 6cf113cd
252interface Collection is Dummy, ERC165 {
253 // Set collection property.
254 //
255 // @param key Property key.
256 // @param value Propery value.
257 //
258 // Selector: setCollectionProperty(string,bytes) 2f073f66
259 function setCollectionProperty(string memory key, bytes memory value)
260 external;
261
262 // Delete collection property.
263 //
264 // @param key Property key.
265 //
266 // Selector: deleteCollectionProperty(string) 7b7debce
267 function deleteCollectionProperty(string memory key) external;
268
269 // Get collection property.
270 //
271 // @dev Throws error if key not found.
272 //
273 // @param key Property key.
274 // @return bytes The property corresponding to the key.
275 //
276 // Selector: collectionProperty(string) cf24fd6d
277 function collectionProperty(string memory key)
278 external
279 view
280 returns (bytes memory);
281
282 // Set the sponsor of the collection.
283 //
284 // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.
285 //
286 // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.
287 //
288 // Selector: setCollectionSponsor(address) 7623402e
289 function setCollectionSponsor(address sponsor) external;
290
291 // Collection sponsorship confirmation.
292 //
293 // @dev After setting the sponsor for the collection, it must be confirmed with this function.
294 //
295 // Selector: confirmCollectionSponsorship() 3c50e97a
296 function confirmCollectionSponsorship() external;
297
298 // Set limits for the collection.
299 // @dev Throws error if limit not found.
300 // @param limit Name of the limit. Valid names:
301 // "accountTokenOwnershipLimit",
302 // "sponsoredDataSize",
303 // "sponsoredDataRateLimit",
304 // "tokenLimit",
305 // "sponsorTransferTimeout",
306 // "sponsorApproveTimeout"
307 // @param value Value of the limit.
308 //
309 // Selector: setCollectionLimit(string,uint32) 6a3841db
310 function setCollectionLimit(string memory limit, uint32 value) external;
311
312 // Set limits for the collection.
313 // @dev Throws error if limit not found.
314 // @param limit Name of the limit. Valid names:
315 // "ownerCanTransfer",
316 // "ownerCanDestroy",
317 // "transfersEnabled"
318 // @param value Value of the limit.
319 //
320 // Selector: setCollectionLimit(string,bool) 993b7fba
321 function setCollectionLimit(string memory limit, bool value) external;
322
323 // Get contract address.
324 //
325 // Selector: contractAddress() f6b4dfb4
326 function contractAddress() external view returns (address);
327
328 // Add collection admin by substrate address.
329 // @param new_admin Substrate administrator address.
330 //
331 // Selector: addCollectionAdminSubstrate(uint256) 5730062b
332 function addCollectionAdminSubstrate(uint256 newAdmin) external;
333
334 // Remove collection admin by substrate address.
335 // @param admin Substrate administrator address.
336 //
337 // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9
338 function removeCollectionAdminSubstrate(uint256 admin) external;
339
340 // Add collection admin.
341 // @param new_admin Address of the added administrator.
342 //
343 // Selector: addCollectionAdmin(address) 92e462c7
344 function addCollectionAdmin(address newAdmin) external;
345
346 // Remove collection admin.
347 //
348 // @param new_admin Address of the removed administrator.
349 //
350 // Selector: removeCollectionAdmin(address) fafd7b42
351 function removeCollectionAdmin(address admin) external;
352
353 // Toggle accessibility of collection nesting.
354 //
355 // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
356 //
357 // Selector: setCollectionNesting(bool) 112d4586
358 function setCollectionNesting(bool enable) external;
359
360 // Toggle accessibility of collection nesting.
361 //
362 // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
363 // @param collections Addresses of collections that will be available for nesting.
364 //
365 // Selector: setCollectionNesting(bool,address[]) 64872396
366 function setCollectionNesting(bool enable, address[] memory collections)
367 external;
368
369 // Set the collection access method.
370 // @param mode Access mode
371 // 0 for Normal
372 // 1 for AllowList
373 //
374 // Selector: setCollectionAccess(uint8) 41835d4c
375 function setCollectionAccess(uint8 mode) external;
376
377 // Add the user to the allowed list.
378 //
379 // @param user Address of a trusted user.
380 //
381 // Selector: addToCollectionAllowList(address) 67844fe6
382 function addToCollectionAllowList(address user) external;
383
384 // Remove the user from the allowed list.
385 //
386 // @param user Address of a removed user.
387 //
388 // Selector: removeFromCollectionAllowList(address) 85c51acb
389 function removeFromCollectionAllowList(address user) external;
390
391 // Switch permission for minting.
392 //
393 // @param mode Enable if "true".
394 //
395 // Selector: setCollectionMintMode(bool) 00018e84
396 function setCollectionMintMode(bool mode) external;
397
398 // Check that account is the owner or admin of the collection
399 //
400 // @param user account to verify
401 // @return "true" if account is the owner or admin
402 //
403 // Selector: verifyOwnerOrAdmin(address) c2282493
404 function verifyOwnerOrAdmin(address user) external view returns (bool);
405
406 // Returns collection type
407 //
408 // @return `Fungible` or `NFT` or `ReFungible`
409 //
410 // Selector: uniqueCollectionType() d34b55b8
411 function uniqueCollectionType() external returns (string memory);
412}
413250
414// Selector: 780e9d63251// Selector: 780e9d63
415interface ERC721Enumerable is Dummy, ERC165 {252interface ERC721Enumerable is Dummy, ERC165 {
500 returns (address);337 returns (address);
501}338}
339
340// Selector: ca08c92c
341interface Collection is Dummy, ERC165 {
342 // Set collection property.
343 //
344 // @param key Property key.
345 // @param value Propery value.
346 //
347 // Selector: setCollectionProperty(string,bytes) 2f073f66
348 function setCollectionProperty(string memory key, bytes memory value)
349 external;
350
351 // Delete collection property.
352 //
353 // @param key Property key.
354 //
355 // Selector: deleteCollectionProperty(string) 7b7debce
356 function deleteCollectionProperty(string memory key) external;
357
358 // Get collection property.
359 //
360 // @dev Throws error if key not found.
361 //
362 // @param key Property key.
363 // @return bytes The property corresponding to the key.
364 //
365 // Selector: collectionProperty(string) cf24fd6d
366 function collectionProperty(string memory key)
367 external
368 view
369 returns (bytes memory);
370
371 // Set the sponsor of the collection.
372 //
373 // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.
374 //
375 // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.
376 //
377 // Selector: setCollectionSponsor(address) 7623402e
378 function setCollectionSponsor(address sponsor) external;
379
380 // Collection sponsorship confirmation.
381 //
382 // @dev After setting the sponsor for the collection, it must be confirmed with this function.
383 //
384 // Selector: confirmCollectionSponsorship() 3c50e97a
385 function confirmCollectionSponsorship() external;
386
387 // Set limits for the collection.
388 // @dev Throws error if limit not found.
389 // @param limit Name of the limit. Valid names:
390 // "accountTokenOwnershipLimit",
391 // "sponsoredDataSize",
392 // "sponsoredDataRateLimit",
393 // "tokenLimit",
394 // "sponsorTransferTimeout",
395 // "sponsorApproveTimeout"
396 // @param value Value of the limit.
397 //
398 // Selector: setCollectionLimit(string,uint32) 6a3841db
399 function setCollectionLimit(string memory limit, uint32 value) external;
400
401 // Set limits for the collection.
402 // @dev Throws error if limit not found.
403 // @param limit Name of the limit. Valid names:
404 // "ownerCanTransfer",
405 // "ownerCanDestroy",
406 // "transfersEnabled"
407 // @param value Value of the limit.
408 //
409 // Selector: setCollectionLimit(string,bool) 993b7fba
410 function setCollectionLimit(string memory limit, bool value) external;
411
412 // Get contract address.
413 //
414 // Selector: contractAddress() f6b4dfb4
415 function contractAddress() external view returns (address);
416
417 // Add collection admin by substrate address.
418 // @param new_admin Substrate administrator address.
419 //
420 // Selector: addCollectionAdminSubstrate(uint256) 5730062b
421 function addCollectionAdminSubstrate(uint256 newAdmin) external;
422
423 // Remove collection admin by substrate address.
424 // @param admin Substrate administrator address.
425 //
426 // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9
427 function removeCollectionAdminSubstrate(uint256 admin) external;
428
429 // Add collection admin.
430 // @param new_admin Address of the added administrator.
431 //
432 // Selector: addCollectionAdmin(address) 92e462c7
433 function addCollectionAdmin(address newAdmin) external;
434
435 // Remove collection admin.
436 //
437 // @param new_admin Address of the removed administrator.
438 //
439 // Selector: removeCollectionAdmin(address) fafd7b42
440 function removeCollectionAdmin(address admin) external;
441
442 // Toggle accessibility of collection nesting.
443 //
444 // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
445 //
446 // Selector: setCollectionNesting(bool) 112d4586
447 function setCollectionNesting(bool enable) external;
448
449 // Toggle accessibility of collection nesting.
450 //
451 // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
452 // @param collections Addresses of collections that will be available for nesting.
453 //
454 // Selector: setCollectionNesting(bool,address[]) 64872396
455 function setCollectionNesting(bool enable, address[] memory collections)
456 external;
457
458 // Set the collection access method.
459 // @param mode Access mode
460 // 0 for Normal
461 // 1 for AllowList
462 //
463 // Selector: setCollectionAccess(uint8) 41835d4c
464 function setCollectionAccess(uint8 mode) external;
465
466 // Add the user to the allowed list.
467 //
468 // @param user Address of a trusted user.
469 //
470 // Selector: addToCollectionAllowList(address) 67844fe6
471 function addToCollectionAllowList(address user) external;
472
473 // Remove the user from the allowed list.
474 //
475 // @param user Address of a removed user.
476 //
477 // Selector: removeFromCollectionAllowList(address) 85c51acb
478 function removeFromCollectionAllowList(address user) external;
479
480 // Switch permission for minting.
481 //
482 // @param mode Enable if "true".
483 //
484 // Selector: setCollectionMintMode(bool) 00018e84
485 function setCollectionMintMode(bool mode) external;
486
487 // Check that account is the owner or admin of the collection
488 //
489 // @param user account to verify
490 // @return "true" if account is the owner or admin
491 //
492 // Selector: verifyOwnerOrAdmin(address) c2282493
493 function verifyOwnerOrAdmin(address user) external view returns (bool);
494
495 // Returns collection type
496 //
497 // @return `Fungible` or `NFT` or `ReFungible`
498 //
499 // Selector: uniqueCollectionType() d34b55b8
500 function uniqueCollectionType() external returns (string memory);
501
502 // Changes collection owner
503 //
504 // @dev Owner can be changed only by current owner
505 // @param newOwner new owner
506 //
507 // Selector: changeOwner(address) a6f9dae1
508 function changeOwner(address newOwner) external;
509}
502510
503interface UniqueRefungible is511interface UniqueRefungible is
504 Dummy,512 Dummy,
modifiedtests/src/eth/collectionAdmin.test.tsdiffbeforeafterboth
1515
16import {expect} from 'chai';16import {expect} from 'chai';
17import privateKey from '../substrate/privateKey';17import privateKey from '../substrate/privateKey';
18import { UNIQUE } from '../util/helpers';
18import {19import {
19 createEthAccount,20 createEthAccount,
20 createEthAccountWithBalance, 21 createEthAccountWithBalance,
21 evmCollection, 22 evmCollection,
22 evmCollectionHelpers, 23 evmCollectionHelpers,
23 getCollectionAddressFromResult, 24 getCollectionAddressFromResult,
24 itWeb3,25 itWeb3,
26 recordEthFee,
25} from './util/helpers';27} from './util/helpers';
2628
27describe('Add collection admins', () => {29describe('Add collection admins', () => {
311 });313 });
312});314});
315
316describe('Change owner tests', () => {
317 itWeb3('Change owner', async ({api, web3, privateKeyWrapper}) => {
318 const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
319 const newOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
320 const collectionHelper = evmCollectionHelpers(web3, owner);
321 const result = await collectionHelper.methods
322 .createNonfungibleCollection('A', 'B', 'C')
323 .send();
324 const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);
325 const collectionEvm = evmCollection(web3, owner, collectionIdAddress);
326
327 await collectionEvm.methods.changeOwner(newOwner).send();
328
329 expect(await collectionEvm.methods.verifyOwnerOrAdmin(owner).call()).to.be.false;
330 expect(await collectionEvm.methods.verifyOwnerOrAdmin(newOwner).call()).to.be.true;
331 });
332
333 itWeb3('change owner call fee', async ({web3, api, privateKeyWrapper}) => {
334 const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
335 const newOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
336 const collectionHelper = evmCollectionHelpers(web3, owner);
337 const result = await collectionHelper.methods
338 .createNonfungibleCollection('A', 'B', 'C')
339 .send();
340 const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);
341 const collectionEvm = evmCollection(web3, owner, collectionIdAddress);
342
343 const cost = await recordEthFee(api, owner, () => collectionEvm.methods.changeOwner(newOwner).send());
344 expect(cost < BigInt(0.2 * Number(UNIQUE)));
345 expect(cost > 0);
346 });
347
348 itWeb3('(!negative tests!) call changeOwner by not owner', async ({api, web3, privateKeyWrapper}) => {
349 const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
350 const newOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
351 const collectionHelper = evmCollectionHelpers(web3, owner);
352 const result = await collectionHelper.methods
353 .createNonfungibleCollection('A', 'B', 'C')
354 .send();
355 const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);
356 const collectionEvm = evmCollection(web3, owner, collectionIdAddress);
357
358 await expect(collectionEvm.methods.changeOwner(newOwner).send({from: newOwner})).to.be.rejected;
359 expect(await collectionEvm.methods.verifyOwnerOrAdmin(newOwner).call()).to.be.false;
360 });
361});
modifiedtests/src/eth/fungibleAbi.jsondiffbeforeafterboth
115 "stateMutability": "nonpayable",115 "stateMutability": "nonpayable",
116 "type": "function"116 "type": "function"
117 },117 },
118 {
119 "inputs": [
120 { "internalType": "address", "name": "newOwner", "type": "address" }
121 ],
122 "name": "changeOwner",
123 "outputs": [],
124 "stateMutability": "nonpayable",
125 "type": "function"
126 },
118 {127 {
119 "inputs": [{ "internalType": "string", "name": "key", "type": "string" }],128 "inputs": [{ "internalType": "string", "name": "key", "type": "string" }],
120 "name": "collectionProperty",129 "name": "collectionProperty",
modifiedtests/src/eth/nonFungibleAbi.jsondiffbeforeafterboth
145 "stateMutability": "nonpayable",145 "stateMutability": "nonpayable",
146 "type": "function"146 "type": "function"
147 },147 },
148 {
149 "inputs": [
150 { "internalType": "address", "name": "newOwner", "type": "address" }
151 ],
152 "name": "changeOwner",
153 "outputs": [],
154 "stateMutability": "nonpayable",
155 "type": "function"
156 },
148 {157 {
149 "inputs": [{ "internalType": "string", "name": "key", "type": "string" }],158 "inputs": [{ "internalType": "string", "name": "key", "type": "string" }],
150 "name": "collectionProperty",159 "name": "collectionProperty",
modifiedtests/src/eth/reFungibleAbi.jsondiffbeforeafterboth
145 "stateMutability": "nonpayable",145 "stateMutability": "nonpayable",
146 "type": "function"146 "type": "function"
147 },147 },
148 {
149 "inputs": [
150 { "internalType": "address", "name": "newOwner", "type": "address" }
151 ],
152 "name": "changeOwner",
153 "outputs": [],
154 "stateMutability": "nonpayable",
155 "type": "function"
156 },
148 {157 {
149 "inputs": [{ "internalType": "string", "name": "key", "type": "string" }],158 "inputs": [{ "internalType": "string", "name": "key", "type": "string" }],
150 "name": "collectionProperty",159 "name": "collectionProperty",