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

difftreelog

CORE-386 Fix after rebase

Trubnikov Sergey2022-06-09parent: #7b97719.patch.diff
in: master

6 files changed

modifiedpallets/common/src/erc.rsdiffbeforeafterboth
21};21};
22pub use pallet_evm::{PrecompileOutput, PrecompileResult, PrecompileHandle, account::CrossAccountId};22pub use pallet_evm::{PrecompileOutput, PrecompileResult, PrecompileHandle, account::CrossAccountId};
23use pallet_evm_coder_substrate::dispatch_to_evm;23use pallet_evm_coder_substrate::dispatch_to_evm;
24use sp_core::{H160, U256};
25use sp_std::vec::Vec;24use sp_std::vec::Vec;
26use up_data_structs::{Property, SponsoringRateLimit, NestingRule, OwnerRestrictedSet, AccessMode};25use up_data_structs::{Property, SponsoringRateLimit, NestingRule, OwnerRestrictedSet, AccessMode};
27use alloc::format;26use alloc::format;
290 Ok(caller)289 Ok(caller)
291}290}
292291
293fn save<T: Config>(collection: &CollectionHandle<T>) {292fn save<T: Config>(collection: &CollectionHandle<T>) -> Result<void> {
293 // TODO possibly delete for the lack of transaction
294 collection
295 .check_is_internal()
296 .map_err(dispatch_to_evm::<T>)?;
294 <crate::CollectionById<T>>::insert(collection.id, collection.collection.clone());297 <crate::CollectionById<T>>::insert(collection.id, collection.collection.clone());
295 Ok(())298 Ok(())
296}299}
modifiedpallets/common/src/lib.rsdiffbeforeafterboth
1133 user: &T::CrossAccountId,1133 user: &T::CrossAccountId,
1134 admin: bool,1134 admin: bool,
1135 ) -> DispatchResult {1135 ) -> DispatchResult {
1136 collection.check_is_mutable()?;
1137 collection.check_is_owner(sender)?;1136 collection.check_is_owner(sender)?;
11381137
1139 let was_admin = <IsAdmin<T>>::get((collection.id, user));1138 let was_admin = <IsAdmin<T>>::get((collection.id, user));
modifiedpallets/nonfungible/src/stubs/UniqueNFT.rawdiffbeforeafterboth

binary blob — no preview

modifiedpallets/nonfungible/src/stubs/UniqueNFT.soldiffbeforeafterboth
51 event MintingFinished();51 event MintingFinished();
52}52}
53
54// Selector: 2da6e59e
55contract Collection is Dummy, ERC165 {
56 // Selector: setCollectionProperty(string,bytes) 2f073f66
57 function setCollectionProperty(string memory key, bytes memory value)
58 public
59 {
60 require(false, stub_error);
61 key;
62 value;
63 dummy = 0;
64 }
65
66 // Selector: deleteCollectionProperty(string) 7b7debce
67 function deleteCollectionProperty(string memory key) public {
68 require(false, stub_error);
69 key;
70 dummy = 0;
71 }
72
73 // Throws error if key not found
74 //
75 // Selector: collectionProperty(string) cf24fd6d
76 function collectionProperty(string memory key)
77 public
78 view
79 returns (bytes memory)
80 {
81 require(false, stub_error);
82 key;
83 dummy;
84 return hex"";
85 }
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 // Selector: confirmCollectionSponsorship() 3c50e97a
95 function confirmCollectionSponsorship() public {
96 require(false, stub_error);
97 dummy = 0;
98 }
99
100 // Selector: setCollectionLimit(string,uint32) 6a3841db
101 function setCollectionLimit(string memory limit, uint32 value) public {
102 require(false, stub_error);
103 limit;
104 value;
105 dummy = 0;
106 }
107
108 // Selector: setCollectionLimit(string,bool) 993b7fba
109 function setCollectionLimit(string memory limit, bool value) public {
110 require(false, stub_error);
111 limit;
112 value;
113 dummy = 0;
114 }
115
116 // Selector: contractAddress() f6b4dfb4
117 function contractAddress() public view returns (address) {
118 require(false, stub_error);
119 dummy;
120 return 0x0000000000000000000000000000000000000000;
121 }
122
123 // Selector: addCollectionAdminSubstrate(uint256) 5730062b
124 function addCollectionAdminSubstrate(uint256 newAdmin) public view {
125 require(false, stub_error);
126 newAdmin;
127 dummy;
128 }
129
130 // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9
131 function removeCollectionAdminSubstrate(uint256 newAdmin) public view {
132 require(false, stub_error);
133 newAdmin;
134 dummy;
135 }
136
137 // Selector: addCollectionAdmin(address) 92e462c7
138 function addCollectionAdmin(address newAdmin) public view {
139 require(false, stub_error);
140 newAdmin;
141 dummy;
142 }
143
144 // Selector: removeAdmin(address) 1785f53c
145 function removeAdmin(address admin) public view {
146 require(false, stub_error);
147 admin;
148 dummy;
149 }
150
151 // Selector: setNesting(bool) e8fc50dd
152 function setNesting(bool enable) public {
153 require(false, stub_error);
154 enable;
155 dummy = 0;
156 }
157
158 // Selector: setNesting(bool,address[]) 7df12a9a
159 function setNesting(bool enable, address[] memory collections) public {
160 require(false, stub_error);
161 enable;
162 collections;
163 dummy = 0;
164 }
165
166 // Selector: setCollectionAccess(uint8) 41835d4c
167 function setCollectionAccess(uint8 mode) public {
168 require(false, stub_error);
169 mode;
170 dummy = 0;
171 }
172
173 // Selector: addToCollectionAllowList(address) 67844fe6
174 function addToCollectionAllowList(address user) public view {
175 require(false, stub_error);
176 user;
177 dummy;
178 }
179
180 // Selector: removeFromCollectionAllowList(address) 85c51acb
181 function removeFromCollectionAllowList(address user) public view {
182 require(false, stub_error);
183 user;
184 dummy;
185 }
186
187 // Selector: setMintMode(bool) 5dea9bd5
188 function setMintMode(bool mode) public {
189 require(false, stub_error);
190 mode;
191 dummy = 0;
192 }
193}
53194
54// Selector: 41369377195// Selector: 41369377
55contract TokenProperties is Dummy, ERC165 {196contract TokenProperties is Dummy, ERC165 {
330 }471 }
331}472}
332
333// Selector: 7d9262e6
334contract Collection is Dummy, ERC165 {
335 // Selector: setCollectionProperty(string,bytes) 2f073f66
336 function setCollectionProperty(string memory key, bytes memory value)
337 public
338 {
339 require(false, stub_error);
340 key;
341 value;
342 dummy = 0;
343 }
344
345 // Selector: deleteCollectionProperty(string) 7b7debce
346 function deleteCollectionProperty(string memory key) public {
347 require(false, stub_error);
348 key;
349 dummy = 0;
350 }
351
352 // Throws error if key not found
353 //
354 // Selector: collectionProperty(string) cf24fd6d
355 function collectionProperty(string memory key)
356 public
357 view
358 returns (bytes memory)
359 {
360 require(false, stub_error);
361 key;
362 dummy;
363 return hex"";
364 }
365
366 // Selector: ethSetSponsor(address) 8f9af356
367 function ethSetSponsor(address sponsor) public {
368 require(false, stub_error);
369 sponsor;
370 dummy = 0;
371 }
372
373 // Selector: ethConfirmSponsorship() a8580d1a
374 function ethConfirmSponsorship() public {
375 require(false, stub_error);
376 dummy = 0;
377 }
378
379 // Selector: setLimit(string,uint32) 68db30ca
380 function setLimit(string memory limit, uint32 value) public {
381 require(false, stub_error);
382 limit;
383 value;
384 dummy = 0;
385 }
386
387 // Selector: setLimit(string,bool) ea67e4c2
388 function setLimit(string memory limit, bool value) public {
389 require(false, stub_error);
390 limit;
391 value;
392 dummy = 0;
393 }
394
395 // Selector: contractAddress() f6b4dfb4
396 function contractAddress() public view returns (address) {
397 require(false, stub_error);
398 dummy;
399 return 0x0000000000000000000000000000000000000000;
400 }
401
402 // Selector: addCollectionAdminSubstrate(uint256) 5730062b
403 function addCollectionAdminSubstrate(uint256 newAdmin) public view {
404 require(false, stub_error);
405 newAdmin;
406 dummy;
407 }
408
409 // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9
410 function removeCollectionAdminSubstrate(uint256 newAdmin) public view {
411 require(false, stub_error);
412 newAdmin;
413 dummy;
414 }
415
416 // Selector: addCollectionAdmin(address) 92e462c7
417 function addCollectionAdmin(address newAdmin) public view {
418 require(false, stub_error);
419 newAdmin;
420 dummy;
421 }
422
423 // Selector: removeAdmin(address) 1785f53c
424 function removeAdmin(address admin) public view {
425 require(false, stub_error);
426 admin;
427 dummy;
428 }
429
430 // Selector: setNesting(bool) e8fc50dd
431 function setNesting(bool enable) public {
432 require(false, stub_error);
433 enable;
434 dummy = 0;
435 }
436
437 // Selector: setNesting(bool,address[]) 7df12a9a
438 function setNesting(bool enable, address[] memory collections) public {
439 require(false, stub_error);
440 enable;
441 collections;
442 dummy = 0;
443 }
444
445 // Selector: setAccess(string) 488f56aa
446 function setAccess(string memory mode) public {
447 require(false, stub_error);
448 mode;
449 dummy = 0;
450 }
451
452 // Selector: addToAllowList(address) 31f59102
453 function addToAllowList(address user) public view {
454 require(false, stub_error);
455 user;
456 dummy;
457 }
458
459 // Selector: removeFromAllowList(address) eba8dabc
460 function removeFromAllowList(address user) public view {
461 require(false, stub_error);
462 user;
463 dummy;
464 }
465
466 // Selector: setMintMode(bool) 5dea9bd5
467 function setMintMode(bool mode) public {
468 require(false, stub_error);
469 mode;
470 dummy = 0;
471 }
472}
473473
474// Selector: d74d154f474// Selector: d74d154f
475contract ERC721UniqueExtensions is Dummy, ERC165 {475contract ERC721UniqueExtensions is Dummy, ERC165 {
modifiedtests/src/eth/api/UniqueNFT.soldiffbeforeafterboth
42 event MintingFinished();42 event MintingFinished();
43}43}
44
45// Selector: 2da6e59e
46interface Collection is Dummy, ERC165 {
47 // Selector: setCollectionProperty(string,bytes) 2f073f66
48 function setCollectionProperty(string memory key, bytes memory value)
49 external;
50
51 // Selector: deleteCollectionProperty(string) 7b7debce
52 function deleteCollectionProperty(string memory key) external;
53
54 // Throws error if key not found
55 //
56 // Selector: collectionProperty(string) cf24fd6d
57 function collectionProperty(string memory key)
58 external
59 view
60 returns (bytes memory);
61
62 // Selector: setCollectionSponsor(address) 7623402e
63 function setCollectionSponsor(address sponsor) external;
64
65 // Selector: confirmCollectionSponsorship() 3c50e97a
66 function confirmCollectionSponsorship() external;
67
68 // Selector: setCollectionLimit(string,uint32) 6a3841db
69 function setCollectionLimit(string memory limit, uint32 value) external;
70
71 // Selector: setCollectionLimit(string,bool) 993b7fba
72 function setCollectionLimit(string memory limit, bool value) external;
73
74 // Selector: contractAddress() f6b4dfb4
75 function contractAddress() external view returns (address);
76
77 // Selector: addCollectionAdminSubstrate(uint256) 5730062b
78 function addCollectionAdminSubstrate(uint256 newAdmin) external view;
79
80 // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9
81 function removeCollectionAdminSubstrate(uint256 newAdmin) external view;
82
83 // Selector: addCollectionAdmin(address) 92e462c7
84 function addCollectionAdmin(address newAdmin) external view;
85
86 // Selector: removeAdmin(address) 1785f53c
87 function removeAdmin(address admin) external view;
88
89 // Selector: setNesting(bool) e8fc50dd
90 function setNesting(bool enable) external;
91
92 // Selector: setNesting(bool,address[]) 7df12a9a
93 function setNesting(bool enable, address[] memory collections) external;
94
95 // Selector: setCollectionAccess(uint8) 41835d4c
96 function setCollectionAccess(uint8 mode) external;
97
98 // Selector: addToCollectionAllowList(address) 67844fe6
99 function addToCollectionAllowList(address user) external view;
100
101 // Selector: removeFromCollectionAllowList(address) 85c51acb
102 function removeFromCollectionAllowList(address user) external view;
103
104 // Selector: setMintMode(bool) 5dea9bd5
105 function setMintMode(bool mode) external;
106}
44107
45// Selector: 41369377108// Selector: 41369377
46interface TokenProperties is Dummy, ERC165 {109interface TokenProperties is Dummy, ERC165 {
191 function totalSupply() external view returns (uint256);254 function totalSupply() external view returns (uint256);
192}255}
193
194// Selector: 7d9262e6
195interface Collection is Dummy, ERC165 {
196 // Selector: setCollectionProperty(string,bytes) 2f073f66
197 function setCollectionProperty(string memory key, bytes memory value)
198 external;
199
200 // Selector: deleteCollectionProperty(string) 7b7debce
201 function deleteCollectionProperty(string memory key) external;
202
203 // Throws error if key not found
204 //
205 // Selector: collectionProperty(string) cf24fd6d
206 function collectionProperty(string memory key)
207 external
208 view
209 returns (bytes memory);
210
211 // Selector: setCollectionSponsor(address) 7623402e
212 function setCollectionSponsor(address sponsor) external;
213
214 // Selector: confirmCollectionSponsorship() 3c50e97a
215 function confirmCollectionSponsorship() external;
216
217 // Selector: setCollectionLimit(string,uint32) 6a3841db
218 function setCollectionLimit(string memory limit, uint32 value) external;
219
220 // Selector: setCollectionLimit(string,bool) 993b7fba
221 function setCollectionLimit(string memory limit, bool value) external;
222
223 // Selector: contractAddress() f6b4dfb4
224 function contractAddress() external view returns (address);
225
226 // Selector: addCollectionAdminSubstrate(uint256) 5730062b
227 function addCollectionAdminSubstrate(uint256 newAdmin) external view;
228
229 // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9
230 function removeCollectionAdminSubstrate(uint256 newAdmin) external view;
231
232 // Selector: addCollectionAdmin(address) 92e462c7
233 function addCollectionAdmin(address newAdmin) external view;
234
235 // Selector: removeCollectionAdmin(address) fafd7b42
236 function removeCollectionAdmin(address admin) external view;
237
238 // Selector: setCollectionNesting(bool) 112d4586
239 function setCollectionNesting(bool enable) external;
240
241 // Selector: setCollectionNesting(bool,address[]) 64872396
242 function setCollectionNesting(bool enable, address[] memory collections)
243 external;
244
245 // Selector: setCollectionAccess(uint8) 41835d4c
246 function setCollectionAccess(uint8 mode) external;
247
248 // Selector: addToCollectionAllowList(address) 67844fe6
249 function addToCollectionAllowList(address user) external view;
250
251 // Selector: removeFromCollectionAllowList(address) 85c51acb
252 function removeFromCollectionAllowList(address user) external view;
253
254 // Selector: setCollectionMintMode(bool) 00018e84
255 function setCollectionMintMode(bool mode) external;
256}
257256
258// Selector: d74d154f257// Selector: d74d154f
259interface ERC721UniqueExtensions is Dummy, ERC165 {258interface ERC721UniqueExtensions is Dummy, ERC165 {
277 returns (bool);276 returns (bool);
278}277}
279
280// Selector: f56cd7fa
281interface Collection is Dummy, ERC165 {
282 // Selector: setCollectionProperty(string,bytes) 2f073f66
283 function setCollectionProperty(string memory key, bytes memory value)
284 external;
285
286 // Selector: deleteCollectionProperty(string) 7b7debce
287 function deleteCollectionProperty(string memory key) external;
288
289 // Throws error if key not found
290 //
291 // Selector: collectionProperty(string) cf24fd6d
292 function collectionProperty(string memory key)
293 external
294 view
295 returns (bytes memory);
296
297 // Selector: ethSetSponsor(address) 8f9af356
298 function ethSetSponsor(address sponsor) external;
299
300 // Selector: ethConfirmSponsorship() a8580d1a
301 function ethConfirmSponsorship() external;
302
303 // Selector: setLimit(string,uint32) 68db30ca
304 function setLimit(string memory limit, uint32 value) external;
305
306 // Selector: setLimit(string,bool) ea67e4c2
307 function setLimit(string memory limit, bool value) external;
308
309 // Selector: contractAddress() f6b4dfb4
310 function contractAddress() external view returns (address);
311
312 // Selector: addAdmin(address) 70480275
313 function addAdmin(address newAdmin) external view;
314
315 // Selector: removeAdmin(address) 1785f53c
316 function removeAdmin(address admin) external view;
317
318 // Selector: setNesting(bool) e8fc50dd
319 function setNesting(bool enable) external;
320
321 // Selector: setNesting(bool,address[]) 7df12a9a
322 function setNesting(bool enable, address[] memory collections) external;
323
324 // Selector: setAccess(string) 488f56aa
325 function setAccess(string memory mode) external;
326
327 // Selector: addToAllowList(address) 31f59102
328 function addToAllowList(address user) external view;
329
330 // Selector: removeFromAllowList(address) eba8dabc
331 function removeFromAllowList(address user) external view;
332
333 // Selector: setMintMode(bool) 5dea9bd5
334 function setMintMode(bool mode) external;
335}
336278
337interface UniqueNFT is279interface UniqueNFT is
338 Dummy,280 Dummy,
modifiedtests/src/eth/nonFungibleAbi.jsondiffbeforeafterboth
84 "inputs": [84 "inputs": [
85 { "internalType": "address", "name": "newAdmin", "type": "address" }85 { "internalType": "address", "name": "newAdmin", "type": "address" }
86 ],86 ],
87 "name": "addAdmin",87 "name": "addCollectionAdmin",
88 "outputs": [],88 "outputs": [],
89 "stateMutability": "view",89 "stateMutability": "view",
90 "type": "function"90 "type": "function"
102 "inputs": [102 "inputs": [
103 { "internalType": "address", "name": "user", "type": "address" }103 { "internalType": "address", "name": "user", "type": "address" }
104 ],104 ],
105 "name": "addToAllowList",105 "name": "addToCollectionAllowList",
106 "outputs": [],106 "outputs": [],
107 "stateMutability": "view",107 "stateMutability": "view",
108 "type": "function"108 "type": "function"
320 "inputs": [320 "inputs": [
321 { "internalType": "address", "name": "user", "type": "address" }321 { "internalType": "address", "name": "user", "type": "address" }
322 ],322 ],
323 "name": "removeFromAllowList",323 "name": "removeFromCollectionAllowList",
324 "outputs": [],324 "outputs": [],
325 "stateMutability": "view",325 "stateMutability": "view",
326 "type": "function"326 "type": "function"
348 "stateMutability": "nonpayable",348 "stateMutability": "nonpayable",
349 "type": "function"349 "type": "function"
350 },350 },
351 {
352 "inputs": [{ "internalType": "string", "name": "mode", "type": "string" }],
353 "name": "setAccess",
354 "outputs": [],
355 "stateMutability": "nonpayable",
356 "type": "function"
357 },
358 {351 {
359 "inputs": [352 "inputs": [
360 { "internalType": "address", "name": "operator", "type": "address" },353 { "internalType": "address", "name": "operator", "type": "address" },
392 "stateMutability": "nonpayable",385 "stateMutability": "nonpayable",
393 "type": "function"386 "type": "function"
394 },387 },
395 {
396 "inputs": [{ "internalType": "bool", "name": "mode", "type": "bool" }],
397 "name": "setCollectionMintMode",
398 "outputs": [],
399 "stateMutability": "nonpayable",
400 "type": "function"
401 },
402 {
403 "inputs": [{ "internalType": "bool", "name": "enable", "type": "bool" }],
404 "name": "setCollectionNesting",
405 "outputs": [],
406 "stateMutability": "nonpayable",
407 "type": "function"
408 },
409 {
410 "inputs": [
411 { "internalType": "bool", "name": "enable", "type": "bool" },
412 {
413 "internalType": "address[]",
414 "name": "collections",
415 "type": "address[]"
416 }
417 ],
418 "name": "setCollectionNesting",
419 "outputs": [],
420 "stateMutability": "nonpayable",
421 "type": "function"
422 },
423 {388 {
424 "inputs": [389 "inputs": [
425 { "internalType": "string", "name": "key", "type": "string" },390 { "internalType": "string", "name": "key", "type": "string" },