git.delta.rocks / unique-network / refs/commits / 9e1cf3ee12f3

difftreelog

Merge branch 'develop' into test/move-to-playgrounds

Max Andreev2022-08-25parents: #e1ae4a6 #cdbbf09.patch.diff
in: master

28 files changed

modified.docker/forkless-config/launch-config-forkless-data.j2diffbeforeafterboth
86 },86 },
87 "parachains": [87 "parachains": [
88 {88 {
89 "bin": "/unique-chain/target/release/unique-collator",89 "bin": "/unique-chain/current/release/unique-collator",
90 "upgradeBin": "/unique-chain/target/release/unique-collator",90 "upgradeBin": "/unique-chain/target/release/unique-collator",
91 "upgradeWasm": "/unique-chain/target/release/wbuild/{{ FEATURE }}/{{ RUNTIME }}_runtime.compact.compressed.wasm",91 "upgradeWasm": "/unique-chain/target/release/wbuild/{{ FEATURE }}/{{ RUNTIME }}_runtime.compact.compressed.wasm",
92 "id": "1000",92 "id": "1000",
modified.github/workflows/nodes-only-update.ymldiffbeforeafterboth
191 shell: bash191 shell: bash
192192
193 - name: Run tests before Node Parachain upgrade193 - name: Run tests before Node Parachain upgrade
194 run: |194 run: |
195 cd tests195 cd tests
196 yarn install196 yarn install
197 yarn add mochawesome197 yarn add mochawesome
198 echo "Ready to start tests"198 echo "Ready to start tests"
199 node scripts/readyness.js199 NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW}
200 NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW}
201 env:200 env:
202 RPC_URL: http://127.0.0.1:9933/201 RPC_URL: http://127.0.0.1:9933/
203202
267 shell: bash266 shell: bash
268267
269 - name: Run tests after Node Parachain upgrade268 - name: Run tests after Node Parachain upgrade
270 run: |269 run: |
271 cd tests270 cd tests
272 yarn install271 yarn install
273 yarn add mochawesome272 yarn add mochawesome
274 echo "Ready to start tests"273 echo "Ready to start tests"
275 node scripts/readyness.js274 NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW}
276 NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW}
277 env:275 env:
278 RPC_URL: http://127.0.0.1:9933/276 RPC_URL: http://127.0.0.1:9933/
279277
modifiedCargo.lockdiffbeforeafterboth
55525552
5553[[package]]5553[[package]]
5554name = "pallet-common"5554name = "pallet-common"
5555version = "0.1.5"5555version = "0.1.6"
5556dependencies = [5556dependencies = [
5557 "ethereum",5557 "ethereum",
5558 "evm-coder",5558 "evm-coder",
1247312473
12474[[package]]12474[[package]]
12475name = "up-common"12475name = "up-common"
12476version = "0.9.25"12476version = "0.9.27"
12477dependencies = [12477dependencies = [
12478 "fp-rpc",12478 "fp-rpc",
12479 "frame-support",12479 "frame-support",
modifiedpallets/common/CHANGELOG.mddiffbeforeafterboth
22
3All notable changes to this project will be documented in this file.3All notable changes to this project will be documented in this file.
44
5## [0.1.6] - 2022-08-16
6
7### Added
8- New Ethereum API methods: changeOwner, changeOwner(Substrate) and verifyOwnerOrAdmin(Substrate).
9
5<!-- bureaucrate goes here -->10<!-- bureaucrate goes here -->
6## [v0.1.5] 2022-08-1611## [v0.1.5] 2022-08-16
712
modifiedpallets/common/Cargo.tomldiffbeforeafterboth
1[package]1[package]
2name = "pallet-common"2name = "pallet-common"
3version = "0.1.5"3version = "0.1.6"
4license = "GPLv3"4license = "GPLv3"
5edition = "2021"5edition = "2021"
66
modifiedpallets/common/src/erc.rsdiffbeforeafterboth
31use alloc::format;31use alloc::format;
3232
33use crate::{Pallet, CollectionHandle, Config, CollectionProperties};33use crate::{
34 Pallet, CollectionHandle, Config, CollectionProperties,
35 eth::convert_substrate_address_to_cross_account_id,
36};
3437
35/// Events for ethereum collection helper.38/// Events for ethereum collection helper.
232 new_admin: uint256,235 new_admin: uint256,
233 ) -> Result<void> {236 ) -> Result<void> {
234 let caller = T::CrossAccountId::from_eth(caller);237 let caller = T::CrossAccountId::from_eth(caller);
235 let mut new_admin_arr: [u8; 32] = Default::default();
236 new_admin.to_big_endian(&mut new_admin_arr);
237 let account_id = T::AccountId::from(new_admin_arr);
238 let new_admin = T::CrossAccountId::from_sub(account_id);238 let new_admin = convert_substrate_address_to_cross_account_id::<T>(new_admin);
239 <Pallet<T>>::toggle_admin(self, &caller, &new_admin, true).map_err(dispatch_to_evm::<T>)?;239 <Pallet<T>>::toggle_admin(self, &caller, &new_admin, true).map_err(dispatch_to_evm::<T>)?;
240 Ok(())240 Ok(())
241 }241 }
248 admin: uint256,248 admin: uint256,
249 ) -> Result<void> {249 ) -> Result<void> {
250 let caller = T::CrossAccountId::from_eth(caller);250 let caller = T::CrossAccountId::from_eth(caller);
251 let mut admin_arr: [u8; 32] = Default::default();
252 admin.to_big_endian(&mut admin_arr);
253 let account_id = T::AccountId::from(admin_arr);
254 let admin = T::CrossAccountId::from_sub(account_id);251 let admin = convert_substrate_address_to_cross_account_id::<T>(admin);
255 <Pallet<T>>::toggle_admin(self, &caller, &admin, false).map_err(dispatch_to_evm::<T>)?;252 <Pallet<T>>::toggle_admin(self, &caller, &admin, false).map_err(dispatch_to_evm::<T>)?;
256 Ok(())253 Ok(())
257 }254 }
414 ///411 ///
415 /// @param user account to verify412 /// @param user account to verify
416 /// @return "true" if account is the owner or admin413 /// @return "true" if account is the owner or admin
414 #[solidity(rename_selector = "isOwnerOrAdmin")]
417 fn verify_owner_or_admin(&self, user: address) -> Result<bool> {415 fn is_owner_or_admin_eth(&self, user: address) -> Result<bool> {
416 let user = T::CrossAccountId::from_eth(user);
418 Ok(check_is_owner_or_admin(user, self)417 Ok(self.is_owner_or_admin(&user))
419 .map(|_| true)
420 .unwrap_or(false))
421 }418 }
419
420 /// Check that substrate account is the owner or admin of the collection
421 ///
422 /// @param user account to verify
423 /// @return "true" if account is the owner or admin
424 fn is_owner_or_admin_substrate(&self, user: uint256) -> Result<bool> {
425 let user = convert_substrate_address_to_cross_account_id::<T>(user);
426 Ok(self.is_owner_or_admin(&user))
427 }
422428
423 /// Returns collection type429 /// Returns collection type
424 ///430 ///
432 Ok(mode.into())438 Ok(mode.into())
433 }439 }
440
441 /// Changes collection owner to another account
442 ///
443 /// @dev Owner can be changed only by current owner
444 /// @param newOwner new owner account
445 fn set_owner(&mut self, caller: caller, new_owner: address) -> Result<void> {
446 let caller = T::CrossAccountId::from_eth(caller);
447 let new_owner = T::CrossAccountId::from_eth(new_owner);
448 self.set_owner_internal(caller, new_owner)
449 .map_err(dispatch_to_evm::<T>)
450 }
451
452 /// Changes collection owner to another substrate account
453 ///
454 /// @dev Owner can be changed only by current owner
455 /// @param newOwner new owner substrate account
456 fn set_owner_substrate(&mut self, caller: caller, new_owner: uint256) -> Result<void> {
457 let caller = T::CrossAccountId::from_eth(caller);
458 let new_owner = convert_substrate_address_to_cross_account_id::<T>(new_owner);
459 self.set_owner_internal(caller, new_owner)
460 .map_err(dispatch_to_evm::<T>)
461 }
434}462}
435463
436fn check_is_owner_or_admin<T: Config>(464fn check_is_owner_or_admin<T: Config>(
440 let caller = T::CrossAccountId::from_eth(caller);468 let caller = T::CrossAccountId::from_eth(caller);
441 collection469 collection
442 .check_is_owner_or_admin(&caller)470 .check_is_owner_or_admin(&caller)
443 .map_err(pallet_evm_coder_substrate::dispatch_to_evm::<T>)?;471 .map_err(dispatch_to_evm::<T>)?;
444 Ok(caller)472 Ok(caller)
445}473}
446474
447fn save<T: Config>(collection: &CollectionHandle<T>) -> Result<void> {475fn save<T: Config>(collection: &CollectionHandle<T>) -> Result<void> {
448 // TODO possibly delete for the lack of transaction476 // TODO possibly delete for the lack of transaction
477 collection.consume_store_writes(1)?;
449 collection478 collection
450 .check_is_internal()479 .check_is_internal()
451 .map_err(dispatch_to_evm::<T>)?;480 .map_err(dispatch_to_evm::<T>)?;
452 <crate::CollectionById<T>>::insert(collection.id, collection.collection.clone());481 collection.save().map_err(dispatch_to_evm::<T>)?;
453 Ok(())482 Ok(())
454}483}
455484
modifiedpallets/common/src/eth.rsdiffbeforeafterboth
1616
17//! The module contains a number of functions for converting and checking ethereum identifiers.17//! The module contains a number of functions for converting and checking ethereum identifiers.
1818
19use up_data_structs::CollectionId;19use evm_coder::{types::*};
20pub use pallet_evm::account::CrossAccountId;
20use sp_core::H160;21use sp_core::H160;
22use up_data_structs::CollectionId;
23
24use crate::Config;
2125
22// 0x17c4e6453Cc49AAAaEACA894e6D9683e00000001 - collection 126// 0x17c4e6453Cc49AAAaEACA894e6D9683e00000001 - collection 1
23// TODO: Unhardcode prefix27// TODO: Unhardcode prefix
48 address[0..16] == ETH_COLLECTION_PREFIX52 address[0..16] == ETH_COLLECTION_PREFIX
49}53}
54
55/// Converts Substrate address to CrossAccountId
56pub fn convert_substrate_address_to_cross_account_id<T: Config>(
57 address: uint256,
58) -> T::CrossAccountId
59where
60 T::AccountId: From<[u8; 32]>,
61{
62 let mut address_arr: [u8; 32] = Default::default();
63 address.to_big_endian(&mut address_arr);
64 let account_id = T::AccountId::from(address_arr);
65 T::CrossAccountId::from_sub(account_id)
66}
5067
modifiedpallets/common/src/lib.rsdiffbeforeafterboth
203 }203 }
204204
205 /// Save collection to storage.205 /// Save collection to storage.
206 pub fn save(self) -> DispatchResult {206 pub fn save(&self) -> DispatchResult {
207 <CollectionById<T>>::insert(self.id, self.collection);207 <CollectionById<T>>::insert(self.id, &self.collection);
208 Ok(())208 Ok(())
209 }209 }
210210
303 Ok(())303 Ok(())
304 }304 }
305
306 /// Changes collection owner to another account
307 fn set_owner_internal(
308 &mut self,
309 caller: T::CrossAccountId,
310 new_owner: T::CrossAccountId,
311 ) -> DispatchResult {
312 self.check_is_owner(&caller)?;
313 self.collection.owner = new_owner.as_sub().clone();
314 self.save()
315 }
305}316}
306317
307#[frame_support::pallet]318#[frame_support::pallet]
modifiedpallets/evm-contract-helpers/src/stubs/ContractHelpers.rawdiffbeforeafterboth

binary blob — no preview

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: ffe4da23
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: isOwnerOrAdmin(address) 9811b0c7
362 function isOwnerOrAdmin(address user) public view returns (bool) {
363 require(false, stub_error);
364 user;
365 dummy;
366 return false;
367 }
368
369 // Check that substrate account is the owner or admin of the collection
370 //
371 // @param user account to verify
372 // @return "true" if account is the owner or admin
373 //
374 // Selector: isOwnerOrAdminSubstrate(uint256) 68910e00
375 function isOwnerOrAdminSubstrate(uint256 user) public view returns (bool) {
376 require(false, stub_error);
377 user;
378 dummy;
379 return false;
380 }
381
382 // Returns collection type
383 //
384 // @return `Fungible` or `NFT` or `ReFungible`
385 //
386 // Selector: uniqueCollectionType() d34b55b8
387 function uniqueCollectionType() public returns (string memory) {
388 require(false, stub_error);
389 dummy = 0;
390 return "";
391 }
392
393 // Changes collection owner to another account
394 //
395 // @dev Owner can be changed only by current owner
396 // @param newOwner new owner account
397 //
398 // Selector: setOwner(address) 13af4035
399 function setOwner(address newOwner) public {
400 require(false, stub_error);
401 newOwner;
402 dummy = 0;
403 }
404
405 // Changes collection owner to another substrate account
406 //
407 // @dev Owner can be changed only by current owner
408 // @param newOwner new owner substrate account
409 //
410 // Selector: setOwnerSubstrate(uint256) b212138f
411 function setOwnerSubstrate(uint256 newOwner) public {
412 require(false, stub_error);
413 newOwner;
414 dummy = 0;
415 }
416}
380417
381contract UniqueFungible is418contract UniqueFungible is
382 Dummy,419 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 {
745 }494 }
746}495}
496
497// Selector: ffe4da23
498contract Collection is Dummy, ERC165 {
499 // Set collection property.
500 //
501 // @param key Property key.
502 // @param value Propery value.
503 //
504 // Selector: setCollectionProperty(string,bytes) 2f073f66
505 function setCollectionProperty(string memory key, bytes memory value)
506 public
507 {
508 require(false, stub_error);
509 key;
510 value;
511 dummy = 0;
512 }
513
514 // Delete collection property.
515 //
516 // @param key Property key.
517 //
518 // Selector: deleteCollectionProperty(string) 7b7debce
519 function deleteCollectionProperty(string memory key) public {
520 require(false, stub_error);
521 key;
522 dummy = 0;
523 }
524
525 // Get collection property.
526 //
527 // @dev Throws error if key not found.
528 //
529 // @param key Property key.
530 // @return bytes The property corresponding to the key.
531 //
532 // Selector: collectionProperty(string) cf24fd6d
533 function collectionProperty(string memory key)
534 public
535 view
536 returns (bytes memory)
537 {
538 require(false, stub_error);
539 key;
540 dummy;
541 return hex"";
542 }
543
544 // Set the sponsor of the collection.
545 //
546 // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.
547 //
548 // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.
549 //
550 // Selector: setCollectionSponsor(address) 7623402e
551 function setCollectionSponsor(address sponsor) public {
552 require(false, stub_error);
553 sponsor;
554 dummy = 0;
555 }
556
557 // Collection sponsorship confirmation.
558 //
559 // @dev After setting the sponsor for the collection, it must be confirmed with this function.
560 //
561 // Selector: confirmCollectionSponsorship() 3c50e97a
562 function confirmCollectionSponsorship() public {
563 require(false, stub_error);
564 dummy = 0;
565 }
566
567 // Set limits for the collection.
568 // @dev Throws error if limit not found.
569 // @param limit Name of the limit. Valid names:
570 // "accountTokenOwnershipLimit",
571 // "sponsoredDataSize",
572 // "sponsoredDataRateLimit",
573 // "tokenLimit",
574 // "sponsorTransferTimeout",
575 // "sponsorApproveTimeout"
576 // @param value Value of the limit.
577 //
578 // Selector: setCollectionLimit(string,uint32) 6a3841db
579 function setCollectionLimit(string memory limit, uint32 value) public {
580 require(false, stub_error);
581 limit;
582 value;
583 dummy = 0;
584 }
585
586 // Set limits for the collection.
587 // @dev Throws error if limit not found.
588 // @param limit Name of the limit. Valid names:
589 // "ownerCanTransfer",
590 // "ownerCanDestroy",
591 // "transfersEnabled"
592 // @param value Value of the limit.
593 //
594 // Selector: setCollectionLimit(string,bool) 993b7fba
595 function setCollectionLimit(string memory limit, bool value) public {
596 require(false, stub_error);
597 limit;
598 value;
599 dummy = 0;
600 }
601
602 // Get contract address.
603 //
604 // Selector: contractAddress() f6b4dfb4
605 function contractAddress() public view returns (address) {
606 require(false, stub_error);
607 dummy;
608 return 0x0000000000000000000000000000000000000000;
609 }
610
611 // Add collection admin by substrate address.
612 // @param new_admin Substrate administrator address.
613 //
614 // Selector: addCollectionAdminSubstrate(uint256) 5730062b
615 function addCollectionAdminSubstrate(uint256 newAdmin) public {
616 require(false, stub_error);
617 newAdmin;
618 dummy = 0;
619 }
620
621 // Remove collection admin by substrate address.
622 // @param admin Substrate administrator address.
623 //
624 // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9
625 function removeCollectionAdminSubstrate(uint256 admin) public {
626 require(false, stub_error);
627 admin;
628 dummy = 0;
629 }
630
631 // Add collection admin.
632 // @param new_admin Address of the added administrator.
633 //
634 // Selector: addCollectionAdmin(address) 92e462c7
635 function addCollectionAdmin(address newAdmin) public {
636 require(false, stub_error);
637 newAdmin;
638 dummy = 0;
639 }
640
641 // Remove collection admin.
642 //
643 // @param new_admin Address of the removed administrator.
644 //
645 // Selector: removeCollectionAdmin(address) fafd7b42
646 function removeCollectionAdmin(address admin) public {
647 require(false, stub_error);
648 admin;
649 dummy = 0;
650 }
651
652 // Toggle accessibility of collection nesting.
653 //
654 // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
655 //
656 // Selector: setCollectionNesting(bool) 112d4586
657 function setCollectionNesting(bool enable) public {
658 require(false, stub_error);
659 enable;
660 dummy = 0;
661 }
662
663 // Toggle accessibility of collection nesting.
664 //
665 // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
666 // @param collections Addresses of collections that will be available for nesting.
667 //
668 // Selector: setCollectionNesting(bool,address[]) 64872396
669 function setCollectionNesting(bool enable, address[] memory collections)
670 public
671 {
672 require(false, stub_error);
673 enable;
674 collections;
675 dummy = 0;
676 }
677
678 // Set the collection access method.
679 // @param mode Access mode
680 // 0 for Normal
681 // 1 for AllowList
682 //
683 // Selector: setCollectionAccess(uint8) 41835d4c
684 function setCollectionAccess(uint8 mode) public {
685 require(false, stub_error);
686 mode;
687 dummy = 0;
688 }
689
690 // Add the user to the allowed list.
691 //
692 // @param user Address of a trusted user.
693 //
694 // Selector: addToCollectionAllowList(address) 67844fe6
695 function addToCollectionAllowList(address user) public {
696 require(false, stub_error);
697 user;
698 dummy = 0;
699 }
700
701 // Remove the user from the allowed list.
702 //
703 // @param user Address of a removed user.
704 //
705 // Selector: removeFromCollectionAllowList(address) 85c51acb
706 function removeFromCollectionAllowList(address user) public {
707 require(false, stub_error);
708 user;
709 dummy = 0;
710 }
711
712 // Switch permission for minting.
713 //
714 // @param mode Enable if "true".
715 //
716 // Selector: setCollectionMintMode(bool) 00018e84
717 function setCollectionMintMode(bool mode) public {
718 require(false, stub_error);
719 mode;
720 dummy = 0;
721 }
722
723 // Check that account is the owner or admin of the collection
724 //
725 // @param user account to verify
726 // @return "true" if account is the owner or admin
727 //
728 // Selector: isOwnerOrAdmin(address) 9811b0c7
729 function isOwnerOrAdmin(address user) public view returns (bool) {
730 require(false, stub_error);
731 user;
732 dummy;
733 return false;
734 }
735
736 // Check that substrate account is the owner or admin of the collection
737 //
738 // @param user account to verify
739 // @return "true" if account is the owner or admin
740 //
741 // Selector: isOwnerOrAdminSubstrate(uint256) 68910e00
742 function isOwnerOrAdminSubstrate(uint256 user) public view returns (bool) {
743 require(false, stub_error);
744 user;
745 dummy;
746 return false;
747 }
748
749 // Returns collection type
750 //
751 // @return `Fungible` or `NFT` or `ReFungible`
752 //
753 // Selector: uniqueCollectionType() d34b55b8
754 function uniqueCollectionType() public returns (string memory) {
755 require(false, stub_error);
756 dummy = 0;
757 return "";
758 }
759
760 // Changes collection owner to another account
761 //
762 // @dev Owner can be changed only by current owner
763 // @param newOwner new owner account
764 //
765 // Selector: setOwner(address) 13af4035
766 function setOwner(address newOwner) public {
767 require(false, stub_error);
768 newOwner;
769 dummy = 0;
770 }
771
772 // Changes collection owner to another substrate account
773 //
774 // @dev Owner can be changed only by current owner
775 // @param newOwner new owner substrate account
776 //
777 // Selector: setOwnerSubstrate(uint256) b212138f
778 function setOwnerSubstrate(uint256 newOwner) public {
779 require(false, stub_error);
780 newOwner;
781 dummy = 0;
782 }
783}
747784
748contract UniqueNFT is785contract UniqueNFT is
749 Dummy,786 Dummy,
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: ffe4da23
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: isOwnerOrAdmin(address) 9811b0c7
741 function isOwnerOrAdmin(address user) public view returns (bool) {
742 require(false, stub_error);
743 user;
744 dummy;
745 return false;
746 }
747
748 // Check that substrate account is the owner or admin of the collection
749 //
750 // @param user account to verify
751 // @return "true" if account is the owner or admin
752 //
753 // Selector: isOwnerOrAdminSubstrate(uint256) 68910e00
754 function isOwnerOrAdminSubstrate(uint256 user) public view returns (bool) {
755 require(false, stub_error);
756 user;
757 dummy;
758 return false;
759 }
760
761 // Returns collection type
762 //
763 // @return `Fungible` or `NFT` or `ReFungible`
764 //
765 // Selector: uniqueCollectionType() d34b55b8
766 function uniqueCollectionType() public returns (string memory) {
767 require(false, stub_error);
768 dummy = 0;
769 return "";
770 }
771
772 // Changes collection owner to another account
773 //
774 // @dev Owner can be changed only by current owner
775 // @param newOwner new owner account
776 //
777 // Selector: setOwner(address) 13af4035
778 function setOwner(address newOwner) public {
779 require(false, stub_error);
780 newOwner;
781 dummy = 0;
782 }
783
784 // Changes collection owner to another substrate account
785 //
786 // @dev Owner can be changed only by current owner
787 // @param newOwner new owner substrate account
788 //
789 // Selector: setOwnerSubstrate(uint256) b212138f
790 function setOwnerSubstrate(uint256 newOwner) public {
791 require(false, stub_error);
792 newOwner;
793 dummy = 0;
794 }
795}
759796
760contract UniqueRefungible is797contract UniqueRefungible is
761 Dummy,798 Dummy,
modifiedpallets/refungible/src/stubs/UniqueRefungibleToken.rawdiffbeforeafterboth

binary blob — no preview

modifiedpallets/unique/src/eth/stubs/CollectionHelpers.rawdiffbeforeafterboth

binary blob — no preview

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: ffe4da23
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: isOwnerOrAdmin(address) 9811b0c7
221 function isOwnerOrAdmin(address user) external view returns (bool);
222
223 // Check that substrate account is the owner or admin of the collection
224 //
225 // @param user account to verify
226 // @return "true" if account is the owner or admin
227 //
228 // Selector: isOwnerOrAdminSubstrate(uint256) 68910e00
229 function isOwnerOrAdminSubstrate(uint256 user) external view returns (bool);
230
231 // Returns collection type
232 //
233 // @return `Fungible` or `NFT` or `ReFungible`
234 //
235 // Selector: uniqueCollectionType() d34b55b8
236 function uniqueCollectionType() external returns (string memory);
237
238 // Changes collection owner to another account
239 //
240 // @dev Owner can be changed only by current owner
241 // @param newOwner new owner account
242 //
243 // Selector: setOwner(address) 13af4035
244 function setOwner(address newOwner) external;
245
246 // Changes collection owner to another substrate account
247 //
248 // @dev Owner can be changed only by current owner
249 // @param newOwner new owner substrate account
250 //
251 // Selector: setOwnerSubstrate(uint256) b212138f
252 function setOwnerSubstrate(uint256 newOwner) external;
253}
230254
231interface UniqueFungible is255interface UniqueFungible is
232 Dummy,256 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 {
490 returns (bool);327 returns (bool);
491}328}
329
330// Selector: ffe4da23
331interface Collection is Dummy, ERC165 {
332 // Set collection property.
333 //
334 // @param key Property key.
335 // @param value Propery value.
336 //
337 // Selector: setCollectionProperty(string,bytes) 2f073f66
338 function setCollectionProperty(string memory key, bytes memory value)
339 external;
340
341 // Delete collection property.
342 //
343 // @param key Property key.
344 //
345 // Selector: deleteCollectionProperty(string) 7b7debce
346 function deleteCollectionProperty(string memory key) external;
347
348 // Get collection property.
349 //
350 // @dev Throws error if key not found.
351 //
352 // @param key Property key.
353 // @return bytes The property corresponding to the key.
354 //
355 // Selector: collectionProperty(string) cf24fd6d
356 function collectionProperty(string memory key)
357 external
358 view
359 returns (bytes memory);
360
361 // Set the sponsor of the collection.
362 //
363 // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.
364 //
365 // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.
366 //
367 // Selector: setCollectionSponsor(address) 7623402e
368 function setCollectionSponsor(address sponsor) external;
369
370 // Collection sponsorship confirmation.
371 //
372 // @dev After setting the sponsor for the collection, it must be confirmed with this function.
373 //
374 // Selector: confirmCollectionSponsorship() 3c50e97a
375 function confirmCollectionSponsorship() external;
376
377 // Set limits for the collection.
378 // @dev Throws error if limit not found.
379 // @param limit Name of the limit. Valid names:
380 // "accountTokenOwnershipLimit",
381 // "sponsoredDataSize",
382 // "sponsoredDataRateLimit",
383 // "tokenLimit",
384 // "sponsorTransferTimeout",
385 // "sponsorApproveTimeout"
386 // @param value Value of the limit.
387 //
388 // Selector: setCollectionLimit(string,uint32) 6a3841db
389 function setCollectionLimit(string memory limit, uint32 value) external;
390
391 // Set limits for the collection.
392 // @dev Throws error if limit not found.
393 // @param limit Name of the limit. Valid names:
394 // "ownerCanTransfer",
395 // "ownerCanDestroy",
396 // "transfersEnabled"
397 // @param value Value of the limit.
398 //
399 // Selector: setCollectionLimit(string,bool) 993b7fba
400 function setCollectionLimit(string memory limit, bool value) external;
401
402 // Get contract address.
403 //
404 // Selector: contractAddress() f6b4dfb4
405 function contractAddress() external view returns (address);
406
407 // Add collection admin by substrate address.
408 // @param new_admin Substrate administrator address.
409 //
410 // Selector: addCollectionAdminSubstrate(uint256) 5730062b
411 function addCollectionAdminSubstrate(uint256 newAdmin) external;
412
413 // Remove collection admin by substrate address.
414 // @param admin Substrate administrator address.
415 //
416 // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9
417 function removeCollectionAdminSubstrate(uint256 admin) external;
418
419 // Add collection admin.
420 // @param new_admin Address of the added administrator.
421 //
422 // Selector: addCollectionAdmin(address) 92e462c7
423 function addCollectionAdmin(address newAdmin) external;
424
425 // Remove collection admin.
426 //
427 // @param new_admin Address of the removed administrator.
428 //
429 // Selector: removeCollectionAdmin(address) fafd7b42
430 function removeCollectionAdmin(address admin) external;
431
432 // Toggle accessibility of collection nesting.
433 //
434 // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
435 //
436 // Selector: setCollectionNesting(bool) 112d4586
437 function setCollectionNesting(bool enable) external;
438
439 // Toggle accessibility of collection nesting.
440 //
441 // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
442 // @param collections Addresses of collections that will be available for nesting.
443 //
444 // Selector: setCollectionNesting(bool,address[]) 64872396
445 function setCollectionNesting(bool enable, address[] memory collections)
446 external;
447
448 // Set the collection access method.
449 // @param mode Access mode
450 // 0 for Normal
451 // 1 for AllowList
452 //
453 // Selector: setCollectionAccess(uint8) 41835d4c
454 function setCollectionAccess(uint8 mode) external;
455
456 // Add the user to the allowed list.
457 //
458 // @param user Address of a trusted user.
459 //
460 // Selector: addToCollectionAllowList(address) 67844fe6
461 function addToCollectionAllowList(address user) external;
462
463 // Remove the user from the allowed list.
464 //
465 // @param user Address of a removed user.
466 //
467 // Selector: removeFromCollectionAllowList(address) 85c51acb
468 function removeFromCollectionAllowList(address user) external;
469
470 // Switch permission for minting.
471 //
472 // @param mode Enable if "true".
473 //
474 // Selector: setCollectionMintMode(bool) 00018e84
475 function setCollectionMintMode(bool mode) external;
476
477 // Check that account is the owner or admin of the collection
478 //
479 // @param user account to verify
480 // @return "true" if account is the owner or admin
481 //
482 // Selector: isOwnerOrAdmin(address) 9811b0c7
483 function isOwnerOrAdmin(address user) external view returns (bool);
484
485 // Check that substrate account is the owner or admin of the collection
486 //
487 // @param user account to verify
488 // @return "true" if account is the owner or admin
489 //
490 // Selector: isOwnerOrAdminSubstrate(uint256) 68910e00
491 function isOwnerOrAdminSubstrate(uint256 user) external view returns (bool);
492
493 // Returns collection type
494 //
495 // @return `Fungible` or `NFT` or `ReFungible`
496 //
497 // Selector: uniqueCollectionType() d34b55b8
498 function uniqueCollectionType() external returns (string memory);
499
500 // Changes collection owner to another account
501 //
502 // @dev Owner can be changed only by current owner
503 // @param newOwner new owner account
504 //
505 // Selector: setOwner(address) 13af4035
506 function setOwner(address newOwner) external;
507
508 // Changes collection owner to another substrate account
509 //
510 // @dev Owner can be changed only by current owner
511 // @param newOwner new owner substrate account
512 //
513 // Selector: setOwnerSubstrate(uint256) b212138f
514 function setOwnerSubstrate(uint256 newOwner) external;
515}
492516
493interface UniqueNFT is517interface UniqueNFT is
494 Dummy,518 Dummy,
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: ffe4da23
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: isOwnerOrAdmin(address) 9811b0c7
493 function isOwnerOrAdmin(address user) external view returns (bool);
494
495 // Check that substrate account is the owner or admin of the collection
496 //
497 // @param user account to verify
498 // @return "true" if account is the owner or admin
499 //
500 // Selector: isOwnerOrAdminSubstrate(uint256) 68910e00
501 function isOwnerOrAdminSubstrate(uint256 user) external view returns (bool);
502
503 // Returns collection type
504 //
505 // @return `Fungible` or `NFT` or `ReFungible`
506 //
507 // Selector: uniqueCollectionType() d34b55b8
508 function uniqueCollectionType() external returns (string memory);
509
510 // Changes collection owner to another account
511 //
512 // @dev Owner can be changed only by current owner
513 // @param newOwner new owner account
514 //
515 // Selector: setOwner(address) 13af4035
516 function setOwner(address newOwner) external;
517
518 // Changes collection owner to another substrate account
519 //
520 // @dev Owner can be changed only by current owner
521 // @param newOwner new owner substrate account
522 //
523 // Selector: setOwnerSubstrate(uint256) b212138f
524 function setOwnerSubstrate(uint256 newOwner) external;
525}
502526
503interface UniqueRefungible is527interface UniqueRefungible is
504 Dummy,528 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,
27 subToEth,
25} from './util/helpers';28} from './util/helpers';
2629
27describe('Add collection admins', () => {30describe('Add collection admins', () => {
7174
72 const newAdmin = createEthAccount(web3);75 const newAdmin = createEthAccount(web3);
73 const collectionEvm = evmCollection(web3, owner, collectionIdAddress);76 const collectionEvm = evmCollection(web3, owner, collectionIdAddress);
74 expect(await collectionEvm.methods.verifyOwnerOrAdmin(newAdmin).call()).to.be.false;77 expect(await collectionEvm.methods.isOwnerOrAdmin(newAdmin).call()).to.be.false;
75 await collectionEvm.methods.addCollectionAdmin(newAdmin).send();78 await collectionEvm.methods.addCollectionAdmin(newAdmin).send();
76 expect(await collectionEvm.methods.verifyOwnerOrAdmin(newAdmin).call()).to.be.true;79 expect(await collectionEvm.methods.isOwnerOrAdmin(newAdmin).call()).to.be.true;
77 });80 });
7881
79 itWeb3('(!negative tests!) Add admin by ADMIN is not allowed', async ({api, web3, privateKeyWrapper}) => {82 itWeb3('(!negative tests!) Add admin by ADMIN is not allowed', async ({api, web3, privateKeyWrapper}) => {
311 });314 });
312});315});
316
317describe('Change owner tests', () => {
318 itWeb3('Change owner', async ({api, web3, privateKeyWrapper}) => {
319 const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
320 const newOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
321 const collectionHelper = evmCollectionHelpers(web3, owner);
322 const result = await collectionHelper.methods
323 .createNonfungibleCollection('A', 'B', 'C')
324 .send();
325 const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);
326 const collectionEvm = evmCollection(web3, owner, collectionIdAddress);
327
328 await collectionEvm.methods.setOwner(newOwner).send();
329
330 expect(await collectionEvm.methods.isOwnerOrAdmin(owner).call()).to.be.false;
331 expect(await collectionEvm.methods.isOwnerOrAdmin(newOwner).call()).to.be.true;
332 });
333
334 itWeb3('change owner call fee', async ({web3, api, privateKeyWrapper}) => {
335 const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
336 const newOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
337 const collectionHelper = evmCollectionHelpers(web3, owner);
338 const result = await collectionHelper.methods
339 .createNonfungibleCollection('A', 'B', 'C')
340 .send();
341 const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);
342 const collectionEvm = evmCollection(web3, owner, collectionIdAddress);
343
344 const cost = await recordEthFee(api, owner, () => collectionEvm.methods.setOwner(newOwner).send());
345 expect(cost < BigInt(0.2 * Number(UNIQUE)));
346 expect(cost > 0);
347 });
348
349 itWeb3('(!negative tests!) call setOwner by non owner', async ({api, web3, privateKeyWrapper}) => {
350 const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
351 const newOwner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
352 const collectionHelper = evmCollectionHelpers(web3, owner);
353 const result = await collectionHelper.methods
354 .createNonfungibleCollection('A', 'B', 'C')
355 .send();
356 const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);
357 const collectionEvm = evmCollection(web3, owner, collectionIdAddress);
358
359 await expect(collectionEvm.methods.setOwner(newOwner).send({from: newOwner})).to.be.rejected;
360 expect(await collectionEvm.methods.isOwnerOrAdmin(newOwner).call()).to.be.false;
361 });
362});
363
364describe('Change substrate owner tests', () => {
365 itWeb3('Change owner', async ({api, web3, privateKeyWrapper}) => {
366 const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
367 const newOwner = privateKeyWrapper('//Alice');
368 const collectionHelper = evmCollectionHelpers(web3, owner);
369 const result = await collectionHelper.methods
370 .createNonfungibleCollection('A', 'B', 'C')
371 .send();
372 const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);
373 const collectionEvm = evmCollection(web3, owner, collectionIdAddress);
374
375 expect(await collectionEvm.methods.isOwnerOrAdmin(owner).call()).to.be.true;
376 expect(await collectionEvm.methods.isOwnerOrAdminSubstrate(newOwner.addressRaw).call()).to.be.false;
377
378 await collectionEvm.methods.setOwnerSubstrate(newOwner.addressRaw).send();
379
380 expect(await collectionEvm.methods.isOwnerOrAdmin(owner).call()).to.be.false;
381 expect(await collectionEvm.methods.isOwnerOrAdminSubstrate(newOwner.addressRaw).call()).to.be.true;
382 });
383
384 itWeb3('change owner call fee', async ({web3, api, privateKeyWrapper}) => {
385 const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
386 const newOwner = privateKeyWrapper('//Alice');
387 const collectionHelper = evmCollectionHelpers(web3, owner);
388 const result = await collectionHelper.methods
389 .createNonfungibleCollection('A', 'B', 'C')
390 .send();
391 const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);
392 const collectionEvm = evmCollection(web3, owner, collectionIdAddress);
393
394 const cost = await recordEthFee(api, owner, () => collectionEvm.methods.setOwnerSubstrate(newOwner.addressRaw).send());
395 expect(cost < BigInt(0.2 * Number(UNIQUE)));
396 expect(cost > 0);
397 });
398
399 itWeb3('(!negative tests!) call setOwner by non owner', async ({api, web3, privateKeyWrapper}) => {
400 const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
401 const otherReceiver = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
402 const newOwner = privateKeyWrapper('//Alice');
403 const collectionHelper = evmCollectionHelpers(web3, owner);
404 const result = await collectionHelper.methods
405 .createNonfungibleCollection('A', 'B', 'C')
406 .send();
407 const {collectionIdAddress} = await getCollectionAddressFromResult(api, result);
408 const collectionEvm = evmCollection(web3, owner, collectionIdAddress);
409
410 await expect(collectionEvm.methods.setOwnerSubstrate(newOwner.addressRaw).send({from: otherReceiver})).to.be.rejected;
411 expect(await collectionEvm.methods.isOwnerOrAdminSubstrate(newOwner.addressRaw).call()).to.be.false;
412 });
413});
deletedtests/src/eth/fractionalizer/Fractionalizer.bindiffbeforeafterboth

no changes

modifiedtests/src/eth/fractionalizer/Fractionalizer.soldiffbeforeafterboth
64 "Wrong collection type. Collection is not refungible."64 "Wrong collection type. Collection is not refungible."
65 );65 );
66 require(66 require(
67 refungibleContract.verifyOwnerOrAdmin(address(this)),67 refungibleContract.isOwnerOrAdmin(address(this)),
68 "Fractionalizer contract should be an admin of the collection"68 "Fractionalizer contract should be an admin of the collection"
69 );69 );
70 rftCollection = _collection;70 rftCollection = _collection;
deletedtests/src/eth/fractionalizer/FractionalizerAbi.jsondiffbeforeafterboth

no changes

modifiedtests/src/eth/fungibleAbi.jsondiffbeforeafterboth
150 "stateMutability": "nonpayable",150 "stateMutability": "nonpayable",
151 "type": "function"151 "type": "function"
152 },152 },
153 {
154 "inputs": [
155 { "internalType": "address", "name": "user", "type": "address" }
156 ],
157 "name": "isOwnerOrAdmin",
158 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
159 "stateMutability": "view",
160 "type": "function"
161 },
162 {
163 "inputs": [
164 { "internalType": "uint256", "name": "user", "type": "uint256" }
165 ],
166 "name": "isOwnerOrAdminSubstrate",
167 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
168 "stateMutability": "view",
169 "type": "function"
170 },
153 {171 {
154 "inputs": [],172 "inputs": [],
155 "name": "name",173 "name": "name",
258 "stateMutability": "nonpayable",276 "stateMutability": "nonpayable",
259 "type": "function"277 "type": "function"
260 },278 },
279 {
280 "inputs": [
281 { "internalType": "address", "name": "newOwner", "type": "address" }
282 ],
283 "name": "setOwner",
284 "outputs": [],
285 "stateMutability": "nonpayable",
286 "type": "function"
287 },
288 {
289 "inputs": [
290 { "internalType": "uint256", "name": "newOwner", "type": "uint256" }
291 ],
292 "name": "setOwnerSubstrate",
293 "outputs": [],
294 "stateMutability": "nonpayable",
295 "type": "function"
296 },
261 {297 {
262 "inputs": [298 "inputs": [
263 { "internalType": "bytes4", "name": "interfaceID", "type": "bytes4" }299 { "internalType": "bytes4", "name": "interfaceID", "type": "bytes4" }
308 "outputs": [{ "internalType": "string", "name": "", "type": "string" }],344 "outputs": [{ "internalType": "string", "name": "", "type": "string" }],
309 "stateMutability": "nonpayable",345 "stateMutability": "nonpayable",
310 "type": "function"346 "type": "function"
311 },347 }
312 {
313 "inputs": [
314 { "internalType": "address", "name": "user", "type": "address" }
315 ],
316 "name": "verifyOwnerOrAdmin",
317 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
318 "stateMutability": "view",
319 "type": "function"
320 }
321]348]
322349
modifiedtests/src/eth/nonFungibleAbi.jsondiffbeforeafterboth
209 "stateMutability": "view",209 "stateMutability": "view",
210 "type": "function"210 "type": "function"
211 },211 },
212 {
213 "inputs": [
214 { "internalType": "address", "name": "user", "type": "address" }
215 ],
216 "name": "isOwnerOrAdmin",
217 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
218 "stateMutability": "view",
219 "type": "function"
220 },
221 {
222 "inputs": [
223 { "internalType": "uint256", "name": "user", "type": "uint256" }
224 ],
225 "name": "isOwnerOrAdminSubstrate",
226 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
227 "stateMutability": "view",
228 "type": "function"
229 },
212 {230 {
213 "inputs": [231 "inputs": [
214 { "internalType": "address", "name": "to", "type": "address" },232 { "internalType": "address", "name": "to", "type": "address" },
432 "stateMutability": "nonpayable",450 "stateMutability": "nonpayable",
433 "type": "function"451 "type": "function"
434 },452 },
453 {
454 "inputs": [
455 { "internalType": "address", "name": "newOwner", "type": "address" }
456 ],
457 "name": "setOwner",
458 "outputs": [],
459 "stateMutability": "nonpayable",
460 "type": "function"
461 },
462 {
463 "inputs": [
464 { "internalType": "uint256", "name": "newOwner", "type": "uint256" }
465 ],
466 "name": "setOwnerSubstrate",
467 "outputs": [],
468 "stateMutability": "nonpayable",
469 "type": "function"
470 },
435 {471 {
436 "inputs": [472 "inputs": [
437 { "internalType": "uint256", "name": "tokenId", "type": "uint256" },473 { "internalType": "uint256", "name": "tokenId", "type": "uint256" },
533 "outputs": [{ "internalType": "string", "name": "", "type": "string" }],569 "outputs": [{ "internalType": "string", "name": "", "type": "string" }],
534 "stateMutability": "nonpayable",570 "stateMutability": "nonpayable",
535 "type": "function"571 "type": "function"
536 },572 }
537 {
538 "inputs": [
539 { "internalType": "address", "name": "user", "type": "address" }
540 ],
541 "name": "verifyOwnerOrAdmin",
542 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
543 "stateMutability": "view",
544 "type": "function"
545 }
546]573]
547574
modifiedtests/src/eth/reFungibleAbi.jsondiffbeforeafterboth
209 "stateMutability": "view",209 "stateMutability": "view",
210 "type": "function"210 "type": "function"
211 },211 },
212 {
213 "inputs": [
214 { "internalType": "address", "name": "user", "type": "address" }
215 ],
216 "name": "isOwnerOrAdmin",
217 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
218 "stateMutability": "view",
219 "type": "function"
220 },
221 {
222 "inputs": [
223 { "internalType": "uint256", "name": "user", "type": "uint256" }
224 ],
225 "name": "isOwnerOrAdminSubstrate",
226 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
227 "stateMutability": "view",
228 "type": "function"
229 },
212 {230 {
213 "inputs": [231 "inputs": [
214 { "internalType": "address", "name": "to", "type": "address" },232 { "internalType": "address", "name": "to", "type": "address" },
432 "stateMutability": "nonpayable",450 "stateMutability": "nonpayable",
433 "type": "function"451 "type": "function"
434 },452 },
453 {
454 "inputs": [
455 { "internalType": "address", "name": "newOwner", "type": "address" }
456 ],
457 "name": "setOwner",
458 "outputs": [],
459 "stateMutability": "nonpayable",
460 "type": "function"
461 },
462 {
463 "inputs": [
464 { "internalType": "uint256", "name": "newOwner", "type": "uint256" }
465 ],
466 "name": "setOwnerSubstrate",
467 "outputs": [],
468 "stateMutability": "nonpayable",
469 "type": "function"
470 },
435 {471 {
436 "inputs": [472 "inputs": [
437 { "internalType": "uint256", "name": "tokenId", "type": "uint256" },473 { "internalType": "uint256", "name": "tokenId", "type": "uint256" },
542 "outputs": [{ "internalType": "string", "name": "", "type": "string" }],578 "outputs": [{ "internalType": "string", "name": "", "type": "string" }],
543 "stateMutability": "nonpayable",579 "stateMutability": "nonpayable",
544 "type": "function"580 "type": "function"
545 },581 }
546 {
547 "inputs": [
548 { "internalType": "address", "name": "user", "type": "address" }
549 ],
550 "name": "verifyOwnerOrAdmin",
551 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
552 "stateMutability": "view",
553 "type": "function"
554 }
555]582]
556583
deletedtests/src/eth/refungibleAbi.jsondiffbeforeafterboth

no changes