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

difftreelog

chore code review requests

Grigoriy Simonov2022-10-12parent: #0649e61.patch.diff
in: master

20 files changed

modifiedpallets/nonfungible/src/erc.rsdiffbeforeafterboth
34use sp_std::vec::Vec;34use sp_std::vec::Vec;
35use pallet_common::{35use pallet_common::{
36 erc::{36 erc::{
37 CommonEvmHandler, PrecompileResult, CollectionCall,37 CommonEvmHandler, PrecompileResult, CollectionCall, static_property::key,
38 static_property::{key, value as property_value},38 static_property::value,
39 },39 },
40 CollectionHandle, CollectionPropertyPermissions,40 CollectionHandle, CollectionPropertyPermissions,
41};41};
42use pallet_evm::{account::CrossAccountId, PrecompileHandle};42use pallet_evm::{account::CrossAccountId, PrecompileHandle};
43use pallet_evm_coder_substrate::call;43use pallet_evm_coder_substrate::call;
44use pallet_structure::{SelfWeightOf as StructureWeight, weights::WeightInfo as _};44use pallet_structure::{SelfWeightOf as StructureWeight, weights::WeightInfo as _};
45use alloc::string::ToString;
4645
47use crate::{46use crate::{
48 AccountBalance, Config, CreateItemData, NonfungibleHandle, Pallet, TokenData, TokensMinted,47 AccountBalance, Config, CreateItemData, NonfungibleHandle, Pallet, TokenData, TokensMinted,
226 /// @return token's const_metadata225 /// @return token's const_metadata
227 #[solidity(rename_selector = "tokenURI")]226 #[solidity(rename_selector = "tokenURI")]
228 fn token_uri(&self, token_id: uint256) -> Result<string> {227 fn token_uri(&self, token_id: uint256) -> Result<string> {
228 if !self.supports_metadata() {
229 return Ok("".into());
230 }
231
229 let token_id_u32: u32 = token_id.try_into().map_err(|_| "token id overflow")?;232 let token_id_u32: u32 = token_id.try_into().map_err(|_| "token id overflow")?;
230233
231 if let Ok(url) = get_token_property(self, token_id_u32, &key::url()) {234 match get_token_property(self, token_id_u32, &key::url()).as_deref() {
232 if !url.is_empty() {235 Err(_) | Ok("") => (),
233 return Ok(url);
234 }
235 } else if !self.supports_metadata() {236 Ok(url) => {
236 return Err("tokenURI not set".into());237 return Ok(url.into());
237 }238 }
239 };
238240
239 if let Some(base_uri) =241 let base_uri =
240 pallet_common::Pallet::<T>::get_collection_property(self.id, &key::base_uri())242 pallet_common::Pallet::<T>::get_collection_property(self.id, &key::base_uri())
241 {
242 if !base_uri.is_empty() {243 .map(BoundedVec::into_inner)
243 let base_uri = string::from_utf8(base_uri.into_inner()).map_err(|e| {244 .map(string::from_utf8)
245 .transpose()
246 .map_err(|e| {
244 Error::Revert(alloc::format!(247 Error::Revert(alloc::format!(
245 "Can not convert value \"baseURI\" to string with error \"{}\"",248 "Can not convert value \"baseURI\" to string with error \"{}\"",
246 e249 e
247 ))250 ))
248 })?;251 })?;
249 if let Ok(suffix) = get_token_property(self, token_id_u32, &key::suffix()) {252
250 if !suffix.is_empty() {253 let base_uri = match base_uri.as_deref() {
251 return Ok(base_uri + suffix.as_str());254 None | Some("") => {
252 }
253 }
254
255 return Ok(base_uri);
256 }
257 }
258
259 Ok("".into())255 return Ok("".into());
256 }
257 Some(base_uri) => base_uri.into(),
258 };
259
260 Ok(
261 match get_token_property(self, token_id_u32, &key::suffix()).as_deref() {
262 Err(_) | Ok("") => base_uri,
263 Ok(suffix) => base_uri + suffix,
264 },
265 )
260 }266 }
261}267}
262268
706 }712 }
707}713}
714
715impl<T: Config> NonfungibleHandle<T> {
716 pub fn supports_metadata(&self) -> bool {
717 if let Some(erc721_metadata) =
718 pallet_common::Pallet::<T>::get_collection_property(self.id, &key::erc721_metadata())
719 {
720 *erc721_metadata.into_inner() == *value::ERC721_METADATA_SUPPORTED
721 } else {
722 false
723 }
724 }
725}
708726
709#[solidity_interface(727#[solidity_interface(
710 name = UniqueNFT,728 name = UniqueNFT,
711 is(729 is(
712 ERC721,730 ERC721,
713 ERC721Metadata(if(this.supports_metadata())),
714 ERC721Enumerable,731 ERC721Enumerable,
715 ERC721UniqueExtensions,732 ERC721UniqueExtensions,
716 ERC721Mintable,733 ERC721Mintable,
717 ERC721Burnable,734 ERC721Burnable,
718 Collection(via(common_mut returns CollectionHandle<T>)),735 Collection(via(common_mut returns CollectionHandle<T>)),
719 TokenProperties,736 TokenProperties,
737 ERC721Metadata(if(this.supports_metadata())),
720 )738 )
721)]739)]
722impl<T: Config> NonfungibleHandle<T> where T::AccountId: From<[u8; 32]> + AsRef<[u8; 32]> {}740impl<T: Config> NonfungibleHandle<T> where T::AccountId: From<[u8; 32]> + AsRef<[u8; 32]> {}
modifiedpallets/nonfungible/src/lib.rsdiffbeforeafterboth
297 }297 }
298}298}
299
300impl<T: Config> NonfungibleHandle<T> {
301 pub fn supports_metadata(&self) -> bool {
302 if let Some(erc721_metadata) =
303 pallet_common::Pallet::<T>::get_collection_property(self.id, &key::erc721_metadata())
304 {
305 *erc721_metadata.into_inner() == *value::ERC721_METADATA_SUPPORTED
306 } else {
307 false
308 }
309 }
310}
311299
312impl<T: Config> WithRecorder<T> for NonfungibleHandle<T> {300impl<T: Config> WithRecorder<T> for NonfungibleHandle<T> {
313 fn recorder(&self) -> &SubstrateRecorder<T> {301 fn recorder(&self) -> &SubstrateRecorder<T> {
modifiedpallets/nonfungible/src/stubs/UniqueNFT.rawdiffbeforeafterboth

binary blob — no preview

modifiedpallets/nonfungible/src/stubs/UniqueNFT.soldiffbeforeafterboth
17 }17 }
18}18}
19
20/// @title ERC-721 Non-Fungible Token Standard, optional metadata extension
21/// @dev See https://eips.ethereum.org/EIPS/eip-721
22/// @dev the ERC-165 identifier for this interface is 0x5b5e139f
23contract ERC721Metadata is Dummy, ERC165 {
24 /// @notice A descriptive name for a collection of NFTs in this contract
25 /// @dev EVM selector for this function is: 0x06fdde03,
26 /// or in textual repr: name()
27 function name() public view returns (string memory) {
28 require(false, stub_error);
29 dummy;
30 return "";
31 }
32
33 /// @notice An abbreviated name for NFTs in this contract
34 /// @dev EVM selector for this function is: 0x95d89b41,
35 /// or in textual repr: symbol()
36 function symbol() public view returns (string memory) {
37 require(false, stub_error);
38 dummy;
39 return "";
40 }
41
42 /// @notice A distinct Uniform Resource Identifier (URI) for a given asset.
43 ///
44 /// @dev If the token has a `url` property and it is not empty, it is returned.
45 /// Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`.
46 /// If the collection property `baseURI` is empty or absent, return "" (empty string)
47 /// otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix
48 /// otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings).
49 ///
50 /// @return token's const_metadata
51 /// @dev EVM selector for this function is: 0xc87b56dd,
52 /// or in textual repr: tokenURI(uint256)
53 function tokenURI(uint256 tokenId) public view returns (string memory) {
54 require(false, stub_error);
55 tokenId;
56 dummy;
57 return "";
58 }
59}
1960
20/// @title A contract that allows to set and delete token properties and change token property permissions.61/// @title A contract that allows to set and delete token properties and change token property permissions.
21/// @dev the ERC-165 identifier for this interface is 0x4136937762/// @dev the ERC-165 identifier for this interface is 0x41369377
177 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.218 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
178 /// @dev EVM selector for this function is: 0x6ec0a9f1,219 /// @dev EVM selector for this function is: 0x6ec0a9f1,
179 /// or in textual repr: collectionSponsor()220 /// or in textual repr: collectionSponsor()
180 function collectionSponsor() public view returns (Tuple17 memory) {221 function collectionSponsor() public view returns (Tuple15 memory) {
181 require(false, stub_error);222 require(false, stub_error);
182 dummy;223 dummy;
183 return Tuple17(0x0000000000000000000000000000000000000000, 0);224 return Tuple15(0x0000000000000000000000000000000000000000, 0);
184 }225 }
185226
186 /// Set limits for the collection.227 /// Set limits for the collection.
359 /// If address is canonical then substrate mirror is zero and vice versa.400 /// If address is canonical then substrate mirror is zero and vice versa.
360 /// @dev EVM selector for this function is: 0xdf727d3b,401 /// @dev EVM selector for this function is: 0xdf727d3b,
361 /// or in textual repr: collectionOwner()402 /// or in textual repr: collectionOwner()
362 function collectionOwner() public view returns (Tuple17 memory) {403 function collectionOwner() public view returns (Tuple15 memory) {
363 require(false, stub_error);404 require(false, stub_error);
364 dummy;405 dummy;
365 return Tuple17(0x0000000000000000000000000000000000000000, 0);406 return Tuple15(0x0000000000000000000000000000000000000000, 0);
366 }407 }
367408
368 /// Changes collection owner to another account409 /// Changes collection owner to another account
379}420}
380421
381/// @dev anonymous struct422/// @dev anonymous struct
382struct Tuple17 {423struct Tuple15 {
383 address field_0;424 address field_0;
384 uint256 field_1;425 uint256 field_1;
385}426}
525 /// @param tokens array of pairs of token ID and token URI for minted tokens566 /// @param tokens array of pairs of token ID and token URI for minted tokens
526 /// @dev EVM selector for this function is: 0x36543006,567 /// @dev EVM selector for this function is: 0x36543006,
527 /// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[])568 /// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[])
528 function mintBulkWithTokenURI(address to, Tuple8[] memory tokens) public returns (bool) {569 function mintBulkWithTokenURI(address to, Tuple6[] memory tokens) public returns (bool) {
529 require(false, stub_error);570 require(false, stub_error);
530 to;571 to;
531 tokens;572 tokens;
535}576}
536577
537/// @dev anonymous struct578/// @dev anonymous struct
538struct Tuple8 {579struct Tuple6 {
539 uint256 field_0;580 uint256 field_0;
540 string field_1;581 string field_1;
541}582}
580 }621 }
581}622}
582
583/// @title ERC-721 Non-Fungible Token Standard, optional metadata extension
584/// @dev See https://eips.ethereum.org/EIPS/eip-721
585/// @dev the ERC-165 identifier for this interface is 0x5b5e139f
586contract ERC721Metadata is Dummy, ERC165 {
587 /// @notice A descriptive name for a collection of NFTs in this contract
588 /// @dev EVM selector for this function is: 0x06fdde03,
589 /// or in textual repr: name()
590 function name() public view returns (string memory) {
591 require(false, stub_error);
592 dummy;
593 return "";
594 }
595
596 /// @notice An abbreviated name for NFTs in this contract
597 /// @dev EVM selector for this function is: 0x95d89b41,
598 /// or in textual repr: symbol()
599 function symbol() public view returns (string memory) {
600 require(false, stub_error);
601 dummy;
602 return "";
603 }
604
605 /// @notice A distinct Uniform Resource Identifier (URI) for a given asset.
606 ///
607 /// @dev If the token has a `url` property and it is not empty, it is returned.
608 /// Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`.
609 /// If the collection property `baseURI` is empty or absent, return "" (empty string)
610 /// otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix
611 /// otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings).
612 ///
613 /// @return token's const_metadata
614 /// @dev EVM selector for this function is: 0xc87b56dd,
615 /// or in textual repr: tokenURI(uint256)
616 function tokenURI(uint256 tokenId) public view returns (string memory) {
617 require(false, stub_error);
618 tokenId;
619 dummy;
620 return "";
621 }
622}
623623
624/// @dev inlined interface624/// @dev inlined interface
625contract ERC721Events {625contract ERC721Events {
766 Dummy,766 Dummy,
767 ERC165,767 ERC165,
768 ERC721,768 ERC721,
769 ERC721Metadata,
770 ERC721Enumerable,769 ERC721Enumerable,
771 ERC721UniqueExtensions,770 ERC721UniqueExtensions,
772 ERC721Mintable,771 ERC721Mintable,
773 ERC721Burnable,772 ERC721Burnable,
774 Collection,773 Collection,
775 TokenProperties774 TokenProperties,
775 ERC721Metadata
776{}776{}
777777
modifiedpallets/refungible/src/erc.rsdiffbeforeafterboth
2121
22extern crate alloc;22extern crate alloc;
2323
24use alloc::string::ToString;
25use core::{24use core::{
26 char::{REPLACEMENT_CHARACTER, decode_utf16},25 char::{REPLACEMENT_CHARACTER, decode_utf16},
27 convert::TryInto,26 convert::TryInto,
28};27};
29use evm_coder::{ToLog, execution::*, generate_stubgen, solidity, solidity_interface, types::*, weight};28use evm_coder::{ToLog, execution::*, generate_stubgen, solidity, solidity_interface, types::*, weight};
30use frame_support::BoundedBTreeMap;29use frame_support::{BoundedBTreeMap, BoundedVec};
31use pallet_common::{30use pallet_common::{
32 CollectionHandle, CollectionPropertyPermissions,31 CollectionHandle, CollectionPropertyPermissions,
33 erc::{32 erc::{CommonEvmHandler, CollectionCall, static_property::key, static_property::value},
34 CommonEvmHandler, CollectionCall,
35 static_property::{key, value as property_value},
36 },
37};33};
38use pallet_evm::{account::CrossAccountId, PrecompileHandle};34use pallet_evm::{account::CrossAccountId, PrecompileHandle};
222 /// @return token's const_metadata218 /// @return token's const_metadata
223 #[solidity(rename_selector = "tokenURI")]219 #[solidity(rename_selector = "tokenURI")]
224 fn token_uri(&self, token_id: uint256) -> Result<string> {220 fn token_uri(&self, token_id: uint256) -> Result<string> {
221 if !self.supports_metadata() {
222 return Ok("".into());
223 }
224
225 let token_id_u32: u32 = token_id.try_into().map_err(|_| "token id overflow")?;225 let token_id_u32: u32 = token_id.try_into().map_err(|_| "token id overflow")?;
226226
227 if let Ok(url) = get_token_property(self, token_id_u32, &key::url()) {227 match get_token_property(self, token_id_u32, &key::url()).as_deref() {
228 if !url.is_empty() {228 Err(_) | Ok("") => (),
229 return Ok(url);
230 }
231 } else if !self.supports_metadata() {229 Ok(url) => {
232 return Err("tokenURI not set".into());230 return Ok(url.into());
233 }231 }
232 };
234233
235 if let Some(base_uri) =234 let base_uri =
236 pallet_common::Pallet::<T>::get_collection_property(self.id, &key::base_uri())235 pallet_common::Pallet::<T>::get_collection_property(self.id, &key::base_uri())
237 {
238 if !base_uri.is_empty() {236 .map(BoundedVec::into_inner)
239 let base_uri = string::from_utf8(base_uri.into_inner()).map_err(|e| {237 .map(string::from_utf8)
238 .transpose()
239 .map_err(|e| {
240 Error::Revert(alloc::format!(240 Error::Revert(alloc::format!(
241 "Can not convert value \"baseURI\" to string with error \"{}\"",241 "Can not convert value \"baseURI\" to string with error \"{}\"",
242 e242 e
243 ))243 ))
244 })?;244 })?;
245 if let Ok(suffix) = get_token_property(self, token_id_u32, &key::suffix()) {245
246 if !suffix.is_empty() {246 let base_uri = match base_uri.as_deref() {
247 return Ok(base_uri + suffix.as_str());247 None | Some("") => {
248 }
249 }
250
251 return Ok(base_uri);
252 }
253 }
254
255 Ok("".into())248 return Ok("".into());
249 }
250 Some(base_uri) => base_uri.into(),
251 };
252
253 Ok(
254 match get_token_property(self, token_id_u32, &key::suffix()).as_deref() {
255 Err(_) | Ok("") => base_uri,
256 Ok(suffix) => base_uri + suffix,
257 },
258 )
256 }259 }
257}260}
258261
765 }768 }
766}769}
770
771impl<T: Config> RefungibleHandle<T> {
772 pub fn supports_metadata(&self) -> bool {
773 if let Some(erc721_metadata) =
774 pallet_common::Pallet::<T>::get_collection_property(self.id, &key::erc721_metadata())
775 {
776 *erc721_metadata.into_inner() == *value::ERC721_METADATA_SUPPORTED
777 } else {
778 false
779 }
780 }
781}
767782
768#[solidity_interface(783#[solidity_interface(
769 name = UniqueRefungible,784 name = UniqueRefungible,
770 is(785 is(
771 ERC721,786 ERC721,
772 ERC721Metadata(if(this.supports_metadata())),
773 ERC721Enumerable,787 ERC721Enumerable,
774 ERC721UniqueExtensions,788 ERC721UniqueExtensions,
775 ERC721Mintable,789 ERC721Mintable,
776 ERC721Burnable,790 ERC721Burnable,
777 Collection(via(common_mut returns CollectionHandle<T>)),791 Collection(via(common_mut returns CollectionHandle<T>)),
778 TokenProperties,792 TokenProperties,
793 ERC721Metadata(if(this.supports_metadata())),
779 )794 )
780)]795)]
781impl<T: Config> RefungibleHandle<T> where T::AccountId: From<[u8; 32]> + AsRef<[u8; 32]> {}796impl<T: Config> RefungibleHandle<T> where T::AccountId: From<[u8; 32]> + AsRef<[u8; 32]> {}
modifiedpallets/refungible/src/lib.rsdiffbeforeafterboth
304 }304 }
305}305}
306
307impl<T: Config> RefungibleHandle<T> {
308 pub fn supports_metadata(&self) -> bool {
309 if let Some(erc721_metadata) =
310 pallet_common::Pallet::<T>::get_collection_property(self.id, &key::erc721_metadata())
311 {
312 *erc721_metadata.into_inner() == *value::ERC721_METADATA_SUPPORTED
313 } else {
314 false
315 }
316 }
317}
318306
319impl<T: Config> Deref for RefungibleHandle<T> {307impl<T: Config> Deref for RefungibleHandle<T> {
320 type Target = pallet_common::CollectionHandle<T>;308 type Target = pallet_common::CollectionHandle<T>;
modifiedpallets/refungible/src/stubs/UniqueRefungible.rawdiffbeforeafterboth

binary blob — no preview

modifiedpallets/refungible/src/stubs/UniqueRefungible.soldiffbeforeafterboth
17 }17 }
18}18}
19
20/// @dev the ERC-165 identifier for this interface is 0x5b5e139f
21contract ERC721Metadata is Dummy, ERC165 {
22 /// @notice A descriptive name for a collection of RFTs in this contract
23 /// @dev EVM selector for this function is: 0x06fdde03,
24 /// or in textual repr: name()
25 function name() public view returns (string memory) {
26 require(false, stub_error);
27 dummy;
28 return "";
29 }
30
31 /// @notice An abbreviated name for RFTs in this contract
32 /// @dev EVM selector for this function is: 0x95d89b41,
33 /// or in textual repr: symbol()
34 function symbol() public view returns (string memory) {
35 require(false, stub_error);
36 dummy;
37 return "";
38 }
39
40 /// @notice A distinct Uniform Resource Identifier (URI) for a given asset.
41 ///
42 /// @dev If the token has a `url` property and it is not empty, it is returned.
43 /// Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`.
44 /// If the collection property `baseURI` is empty or absent, return "" (empty string)
45 /// otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix
46 /// otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings).
47 ///
48 /// @return token's const_metadata
49 /// @dev EVM selector for this function is: 0xc87b56dd,
50 /// or in textual repr: tokenURI(uint256)
51 function tokenURI(uint256 tokenId) public view returns (string memory) {
52 require(false, stub_error);
53 tokenId;
54 dummy;
55 return "";
56 }
57}
1958
20/// @title A contract that allows to set and delete token properties and change token property permissions.59/// @title A contract that allows to set and delete token properties and change token property permissions.
21/// @dev the ERC-165 identifier for this interface is 0x4136937760/// @dev the ERC-165 identifier for this interface is 0x41369377
177 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.216 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
178 /// @dev EVM selector for this function is: 0x6ec0a9f1,217 /// @dev EVM selector for this function is: 0x6ec0a9f1,
179 /// or in textual repr: collectionSponsor()218 /// or in textual repr: collectionSponsor()
180 function collectionSponsor() public view returns (Tuple17 memory) {219 function collectionSponsor() public view returns (Tuple15 memory) {
181 require(false, stub_error);220 require(false, stub_error);
182 dummy;221 dummy;
183 return Tuple17(0x0000000000000000000000000000000000000000, 0);222 return Tuple15(0x0000000000000000000000000000000000000000, 0);
184 }223 }
185224
186 /// Set limits for the collection.225 /// Set limits for the collection.
359 /// If address is canonical then substrate mirror is zero and vice versa.398 /// If address is canonical then substrate mirror is zero and vice versa.
360 /// @dev EVM selector for this function is: 0xdf727d3b,399 /// @dev EVM selector for this function is: 0xdf727d3b,
361 /// or in textual repr: collectionOwner()400 /// or in textual repr: collectionOwner()
362 function collectionOwner() public view returns (Tuple17 memory) {401 function collectionOwner() public view returns (Tuple15 memory) {
363 require(false, stub_error);402 require(false, stub_error);
364 dummy;403 dummy;
365 return Tuple17(0x0000000000000000000000000000000000000000, 0);404 return Tuple15(0x0000000000000000000000000000000000000000, 0);
366 }405 }
367406
368 /// Changes collection owner to another account407 /// Changes collection owner to another account
379}418}
380419
381/// @dev anonymous struct420/// @dev anonymous struct
382struct Tuple17 {421struct Tuple15 {
383 address field_0;422 address field_0;
384 uint256 field_1;423 uint256 field_1;
385}424}
527 /// @param tokens array of pairs of token ID and token URI for minted tokens566 /// @param tokens array of pairs of token ID and token URI for minted tokens
528 /// @dev EVM selector for this function is: 0x36543006,567 /// @dev EVM selector for this function is: 0x36543006,
529 /// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[])568 /// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[])
530 function mintBulkWithTokenURI(address to, Tuple8[] memory tokens) public returns (bool) {569 function mintBulkWithTokenURI(address to, Tuple6[] memory tokens) public returns (bool) {
531 require(false, stub_error);570 require(false, stub_error);
532 to;571 to;
533 tokens;572 tokens;
549}588}
550589
551/// @dev anonymous struct590/// @dev anonymous struct
552struct Tuple8 {591struct Tuple6 {
553 uint256 field_0;592 uint256 field_0;
554 string field_1;593 string field_1;
555}594}
594 }633 }
595}634}
596
597/// @dev the ERC-165 identifier for this interface is 0x5b5e139f
598contract ERC721Metadata is Dummy, ERC165 {
599 /// @notice A descriptive name for a collection of RFTs in this contract
600 /// @dev EVM selector for this function is: 0x06fdde03,
601 /// or in textual repr: name()
602 function name() public view returns (string memory) {
603 require(false, stub_error);
604 dummy;
605 return "";
606 }
607
608 /// @notice An abbreviated name for RFTs in this contract
609 /// @dev EVM selector for this function is: 0x95d89b41,
610 /// or in textual repr: symbol()
611 function symbol() public view returns (string memory) {
612 require(false, stub_error);
613 dummy;
614 return "";
615 }
616
617 /// @notice A distinct Uniform Resource Identifier (URI) for a given asset.
618 ///
619 /// @dev If the token has a `url` property and it is not empty, it is returned.
620 /// Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`.
621 /// If the collection property `baseURI` is empty or absent, return "" (empty string)
622 /// otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix
623 /// otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings).
624 ///
625 /// @return token's const_metadata
626 /// @dev EVM selector for this function is: 0xc87b56dd,
627 /// or in textual repr: tokenURI(uint256)
628 function tokenURI(uint256 tokenId) public view returns (string memory) {
629 require(false, stub_error);
630 tokenId;
631 dummy;
632 return "";
633 }
634}
635635
636/// @dev inlined interface636/// @dev inlined interface
637contract ERC721Events {637contract ERC721Events {
776 Dummy,776 Dummy,
777 ERC165,777 ERC165,
778 ERC721,778 ERC721,
779 ERC721Metadata,
780 ERC721Enumerable,779 ERC721Enumerable,
781 ERC721UniqueExtensions,780 ERC721UniqueExtensions,
782 ERC721Mintable,781 ERC721Mintable,
783 ERC721Burnable,782 ERC721Burnable,
784 Collection,783 Collection,
785 TokenProperties784 TokenProperties,
785 ERC721Metadata
786{}786{}
787787
modifiedpallets/unique/src/eth/mod.rsdiffbeforeafterboth
335 )335 )
336 }336 }
337
338 #[weight(<SelfWeightOf<T>>::create_collection())]
339 #[deprecated(note = "mathod was renamed to `create_rft_collection`, prefer it instead")]
340 fn create_refungible_collection(
341 &mut self,
342 caller: caller,
343 value: value,
344 name: string,
345 description: string,
346 token_prefix: string,
347 ) -> Result<address> {
348 create_refungible_collection_internal::<T>(
349 caller,
350 value,
351 name,
352 description,
353 token_prefix,
354 Default::default(),
355 false,
356 )
357 }
358337
359 #[weight(<SelfWeightOf<T>>::create_collection())]338 #[weight(<SelfWeightOf<T>>::create_collection())]
360 #[solidity(rename_selector = "createERC721MetadataCompatibleRFTCollection")]339 #[solidity(rename_selector = "createERC721MetadataCompatibleRFTCollection")]
modifiedpallets/unique/src/eth/stubs/CollectionHelpers.rawdiffbeforeafterboth

binary blob — no preview

modifiedpallets/unique/src/eth/stubs/CollectionHelpers.soldiffbeforeafterboth
23}23}
2424
25/// @title Contract, which allows users to operate with collections25/// @title Contract, which allows users to operate with collections
26/// @dev the ERC-165 identifier for this interface is 0x95eb98f426/// @dev the ERC-165 identifier for this interface is 0xd14d1221
27contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents {27contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents {
28 /// Create an NFT collection28 /// Create an NFT collection
29 /// @param name Name of the collection29 /// @param name Name of the collection
97 return 0x0000000000000000000000000000000000000000;97 return 0x0000000000000000000000000000000000000000;
98 }98 }
99
100 /// @dev EVM selector for this function is: 0x44a68ad5,
101 /// or in textual repr: createRefungibleCollection(string,string,string)
102 function createRefungibleCollection(
103 string memory name,
104 string memory description,
105 string memory tokenPrefix
106 ) public payable returns (address) {
107 require(false, stub_error);
108 name;
109 description;
110 tokenPrefix;
111 dummy = 0;
112 return 0x0000000000000000000000000000000000000000;
113 }
11499
115 /// @dev EVM selector for this function is: 0xa5596388,100 /// @dev EVM selector for this function is: 0xa5596388,
116 /// or in textual repr: createERC721MetadataCompatibleRFTCollection(string,string,string,string)101 /// or in textual repr: createERC721MetadataCompatibleRFTCollection(string,string,string,string)
modifiedtests/src/eth/api/CollectionHelpers.soldiffbeforeafterboth
18}18}
1919
20/// @title Contract, which allows users to operate with collections20/// @title Contract, which allows users to operate with collections
21/// @dev the ERC-165 identifier for this interface is 0x95eb98f421/// @dev the ERC-165 identifier for this interface is 0xd14d1221
22interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents {22interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents {
23 /// Create an NFT collection23 /// Create an NFT collection
24 /// @param name Name of the collection24 /// @param name Name of the collection
63 string memory tokenPrefix63 string memory tokenPrefix
64 ) external payable returns (address);64 ) external payable returns (address);
65
66 /// @dev EVM selector for this function is: 0x44a68ad5,
67 /// or in textual repr: createRefungibleCollection(string,string,string)
68 function createRefungibleCollection(
69 string memory name,
70 string memory description,
71 string memory tokenPrefix
72 ) external payable returns (address);
7365
74 /// @dev EVM selector for this function is: 0xa5596388,66 /// @dev EVM selector for this function is: 0xa5596388,
75 /// or in textual repr: createERC721MetadataCompatibleRFTCollection(string,string,string,string)67 /// or in textual repr: createERC721MetadataCompatibleRFTCollection(string,string,string,string)
modifiedtests/src/eth/api/UniqueNFT.soldiffbeforeafterboth
12 function supportsInterface(bytes4 interfaceID) external view returns (bool);12 function supportsInterface(bytes4 interfaceID) external view returns (bool);
13}13}
14
15/// @title ERC-721 Non-Fungible Token Standard, optional metadata extension
16/// @dev See https://eips.ethereum.org/EIPS/eip-721
17/// @dev the ERC-165 identifier for this interface is 0x5b5e139f
18interface ERC721Metadata is Dummy, ERC165 {
19 /// @notice A descriptive name for a collection of NFTs in this contract
20 /// @dev EVM selector for this function is: 0x06fdde03,
21 /// or in textual repr: name()
22 function name() external view returns (string memory);
23
24 /// @notice An abbreviated name for NFTs in this contract
25 /// @dev EVM selector for this function is: 0x95d89b41,
26 /// or in textual repr: symbol()
27 function symbol() external view returns (string memory);
28
29 /// @notice A distinct Uniform Resource Identifier (URI) for a given asset.
30 ///
31 /// @dev If the token has a `url` property and it is not empty, it is returned.
32 /// Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`.
33 /// If the collection property `baseURI` is empty or absent, return "" (empty string)
34 /// otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix
35 /// otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings).
36 ///
37 /// @return token's const_metadata
38 /// @dev EVM selector for this function is: 0xc87b56dd,
39 /// or in textual repr: tokenURI(uint256)
40 function tokenURI(uint256 tokenId) external view returns (string memory);
41}
1442
15/// @title A contract that allows to set and delete token properties and change token property permissions.43/// @title A contract that allows to set and delete token properties and change token property permissions.
16/// @dev the ERC-165 identifier for this interface is 0x4136937744/// @dev the ERC-165 identifier for this interface is 0x41369377
120 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.148 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
121 /// @dev EVM selector for this function is: 0x6ec0a9f1,149 /// @dev EVM selector for this function is: 0x6ec0a9f1,
122 /// or in textual repr: collectionSponsor()150 /// or in textual repr: collectionSponsor()
123 function collectionSponsor() external view returns (Tuple17 memory);151 function collectionSponsor() external view returns (Tuple15 memory);
124152
125 /// Set limits for the collection.153 /// Set limits for the collection.
126 /// @dev Throws error if limit not found.154 /// @dev Throws error if limit not found.
237 /// If address is canonical then substrate mirror is zero and vice versa.265 /// If address is canonical then substrate mirror is zero and vice versa.
238 /// @dev EVM selector for this function is: 0xdf727d3b,266 /// @dev EVM selector for this function is: 0xdf727d3b,
239 /// or in textual repr: collectionOwner()267 /// or in textual repr: collectionOwner()
240 function collectionOwner() external view returns (Tuple17 memory);268 function collectionOwner() external view returns (Tuple15 memory);
241269
242 /// Changes collection owner to another account270 /// Changes collection owner to another account
243 ///271 ///
249}277}
250278
251/// @dev anonymous struct279/// @dev anonymous struct
252struct Tuple17 {280struct Tuple15 {
253 address field_0;281 address field_0;
254 uint256 field_1;282 uint256 field_1;
255}283}
350 /// @param tokens array of pairs of token ID and token URI for minted tokens378 /// @param tokens array of pairs of token ID and token URI for minted tokens
351 /// @dev EVM selector for this function is: 0x36543006,379 /// @dev EVM selector for this function is: 0x36543006,
352 /// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[])380 /// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[])
353 function mintBulkWithTokenURI(address to, Tuple8[] memory tokens) external returns (bool);381 function mintBulkWithTokenURI(address to, Tuple6[] memory tokens) external returns (bool);
354}382}
355383
356/// @dev anonymous struct384/// @dev anonymous struct
357struct Tuple8 {385struct Tuple6 {
358 uint256 field_0;386 uint256 field_0;
359 string field_1;387 string field_1;
360}388}
384 function totalSupply() external view returns (uint256);412 function totalSupply() external view returns (uint256);
385}413}
386
387/// @title ERC-721 Non-Fungible Token Standard, optional metadata extension
388/// @dev See https://eips.ethereum.org/EIPS/eip-721
389/// @dev the ERC-165 identifier for this interface is 0x5b5e139f
390interface ERC721Metadata is Dummy, ERC165 {
391 /// @notice A descriptive name for a collection of NFTs in this contract
392 /// @dev EVM selector for this function is: 0x06fdde03,
393 /// or in textual repr: name()
394 function name() external view returns (string memory);
395
396 /// @notice An abbreviated name for NFTs in this contract
397 /// @dev EVM selector for this function is: 0x95d89b41,
398 /// or in textual repr: symbol()
399 function symbol() external view returns (string memory);
400
401 /// @notice A distinct Uniform Resource Identifier (URI) for a given asset.
402 ///
403 /// @dev If the token has a `url` property and it is not empty, it is returned.
404 /// Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`.
405 /// If the collection property `baseURI` is empty or absent, return "" (empty string)
406 /// otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix
407 /// otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings).
408 ///
409 /// @return token's const_metadata
410 /// @dev EVM selector for this function is: 0xc87b56dd,
411 /// or in textual repr: tokenURI(uint256)
412 function tokenURI(uint256 tokenId) external view returns (string memory);
413}
414414
415/// @dev inlined interface415/// @dev inlined interface
416interface ERC721Events {416interface ERC721Events {
507 Dummy,507 Dummy,
508 ERC165,508 ERC165,
509 ERC721,509 ERC721,
510 ERC721Metadata,
511 ERC721Enumerable,510 ERC721Enumerable,
512 ERC721UniqueExtensions,511 ERC721UniqueExtensions,
513 ERC721Mintable,512 ERC721Mintable,
514 ERC721Burnable,513 ERC721Burnable,
515 Collection,514 Collection,
516 TokenProperties515 TokenProperties,
516 ERC721Metadata
517{}517{}
518518
modifiedtests/src/eth/api/UniqueRefungible.soldiffbeforeafterboth
12 function supportsInterface(bytes4 interfaceID) external view returns (bool);12 function supportsInterface(bytes4 interfaceID) external view returns (bool);
13}13}
14
15/// @dev the ERC-165 identifier for this interface is 0x5b5e139f
16interface ERC721Metadata is Dummy, ERC165 {
17 /// @notice A descriptive name for a collection of RFTs in this contract
18 /// @dev EVM selector for this function is: 0x06fdde03,
19 /// or in textual repr: name()
20 function name() external view returns (string memory);
21
22 /// @notice An abbreviated name for RFTs in this contract
23 /// @dev EVM selector for this function is: 0x95d89b41,
24 /// or in textual repr: symbol()
25 function symbol() external view returns (string memory);
26
27 /// @notice A distinct Uniform Resource Identifier (URI) for a given asset.
28 ///
29 /// @dev If the token has a `url` property and it is not empty, it is returned.
30 /// Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`.
31 /// If the collection property `baseURI` is empty or absent, return "" (empty string)
32 /// otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix
33 /// otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings).
34 ///
35 /// @return token's const_metadata
36 /// @dev EVM selector for this function is: 0xc87b56dd,
37 /// or in textual repr: tokenURI(uint256)
38 function tokenURI(uint256 tokenId) external view returns (string memory);
39}
1440
15/// @title A contract that allows to set and delete token properties and change token property permissions.41/// @title A contract that allows to set and delete token properties and change token property permissions.
16/// @dev the ERC-165 identifier for this interface is 0x4136937742/// @dev the ERC-165 identifier for this interface is 0x41369377
120 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.146 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
121 /// @dev EVM selector for this function is: 0x6ec0a9f1,147 /// @dev EVM selector for this function is: 0x6ec0a9f1,
122 /// or in textual repr: collectionSponsor()148 /// or in textual repr: collectionSponsor()
123 function collectionSponsor() external view returns (Tuple17 memory);149 function collectionSponsor() external view returns (Tuple15 memory);
124150
125 /// Set limits for the collection.151 /// Set limits for the collection.
126 /// @dev Throws error if limit not found.152 /// @dev Throws error if limit not found.
237 /// If address is canonical then substrate mirror is zero and vice versa.263 /// If address is canonical then substrate mirror is zero and vice versa.
238 /// @dev EVM selector for this function is: 0xdf727d3b,264 /// @dev EVM selector for this function is: 0xdf727d3b,
239 /// or in textual repr: collectionOwner()265 /// or in textual repr: collectionOwner()
240 function collectionOwner() external view returns (Tuple17 memory);266 function collectionOwner() external view returns (Tuple15 memory);
241267
242 /// Changes collection owner to another account268 /// Changes collection owner to another account
243 ///269 ///
249}275}
250276
251/// @dev anonymous struct277/// @dev anonymous struct
252struct Tuple17 {278struct Tuple15 {
253 address field_0;279 address field_0;
254 uint256 field_1;280 uint256 field_1;
255}281}
352 /// @param tokens array of pairs of token ID and token URI for minted tokens378 /// @param tokens array of pairs of token ID and token URI for minted tokens
353 /// @dev EVM selector for this function is: 0x36543006,379 /// @dev EVM selector for this function is: 0x36543006,
354 /// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[])380 /// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[])
355 function mintBulkWithTokenURI(address to, Tuple8[] memory tokens) external returns (bool);381 function mintBulkWithTokenURI(address to, Tuple6[] memory tokens) external returns (bool);
356382
357 /// Returns EVM address for refungible token383 /// Returns EVM address for refungible token
358 ///384 ///
363}389}
364390
365/// @dev anonymous struct391/// @dev anonymous struct
366struct Tuple8 {392struct Tuple6 {
367 uint256 field_0;393 uint256 field_0;
368 string field_1;394 string field_1;
369}395}
393 function totalSupply() external view returns (uint256);419 function totalSupply() external view returns (uint256);
394}420}
395
396/// @dev the ERC-165 identifier for this interface is 0x5b5e139f
397interface ERC721Metadata is Dummy, ERC165 {
398 /// @notice A descriptive name for a collection of RFTs in this contract
399 /// @dev EVM selector for this function is: 0x06fdde03,
400 /// or in textual repr: name()
401 function name() external view returns (string memory);
402
403 /// @notice An abbreviated name for RFTs in this contract
404 /// @dev EVM selector for this function is: 0x95d89b41,
405 /// or in textual repr: symbol()
406 function symbol() external view returns (string memory);
407
408 /// @notice A distinct Uniform Resource Identifier (URI) for a given asset.
409 ///
410 /// @dev If the token has a `url` property and it is not empty, it is returned.
411 /// Else If the collection does not have a property with key `schemaName` or its value is not equal to `ERC721Metadata`, it return an error `tokenURI not set`.
412 /// If the collection property `baseURI` is empty or absent, return "" (empty string)
413 /// otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix
414 /// otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings).
415 ///
416 /// @return token's const_metadata
417 /// @dev EVM selector for this function is: 0xc87b56dd,
418 /// or in textual repr: tokenURI(uint256)
419 function tokenURI(uint256 tokenId) external view returns (string memory);
420}
421421
422/// @dev inlined interface422/// @dev inlined interface
423interface ERC721Events {423interface ERC721Events {
512 Dummy,512 Dummy,
513 ERC165,513 ERC165,
514 ERC721,514 ERC721,
515 ERC721Metadata,
516 ERC721Enumerable,515 ERC721Enumerable,
517 ERC721UniqueExtensions,516 ERC721UniqueExtensions,
518 ERC721Mintable,517 ERC721Mintable,
519 ERC721Burnable,518 ERC721Burnable,
520 Collection,519 Collection,
521 TokenProperties520 TokenProperties,
521 ERC721Metadata
522{}522{}
523523
modifiedtests/src/eth/collectionHelpersAbi.jsondiffbeforeafterboth
82 "stateMutability": "payable",82 "stateMutability": "payable",
83 "type": "function"83 "type": "function"
84 },84 },
85 {
86 "inputs": [
87 { "internalType": "string", "name": "name", "type": "string" },
88 { "internalType": "string", "name": "description", "type": "string" },
89 { "internalType": "string", "name": "tokenPrefix", "type": "string" }
90 ],
91 "name": "createRefungibleCollection",
92 "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
93 "stateMutability": "payable",
94 "type": "function"
95 },
96 {85 {
97 "inputs": [86 "inputs": [
98 {87 {
modifiedtests/src/eth/collectionProperties.test.tsdiffbeforeafterboth
1import {itEth, usingEthPlaygrounds, expect} from './util/playgrounds';1import {itEth, usingEthPlaygrounds, expect} from './util/playgrounds';
2import {IKeyringPair} from '@polkadot/types/types';2import {IKeyringPair} from '@polkadot/types/types';
3import {Pallets} from '../util/playgrounds';
34
4describe('EVM collection properties', () => {5describe('EVM collection properties', () => {
5 let donor: IKeyringPair;6 let donor: IKeyringPair;
80 expect(await contract.methods.supportsInterface('0x5b5e139f').call()).to.be.false;81 expect(await contract.methods.supportsInterface('0x5b5e139f').call()).to.be.false;
81 });82 });
8283
83 itEth('ERC721Metadata property can be set for RFT collection', async({helper}) => {84 itEth.ifWithPallets('ERC721Metadata property can be set for RFT collection', [Pallets.ReFungible], async({helper}) => {
84 const caller = await helper.eth.createAccountWithBalance(donor);85 const caller = await helper.eth.createAccountWithBalance(donor);
85 const collection = await helper.rft.mintCollection(donor, {name: 'col', description: 'descr', tokenPrefix: 'COL'});86 const collection = await helper.rft.mintCollection(donor, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
8687
modifiedtests/src/eth/nonFungible.test.tsdiffbeforeafterboth
79 });79 });
80 });80 });
8181
82 async function setup(helper: EthUniqueHelper, tokenPrefix: string, propertyKey?: string, propertyValue?: string): Promise<{contract: Contract, nextTokenId: string}> {82 async function setup(helper: EthUniqueHelper, baseUri: string, propertyKey?: string, propertyValue?: string): Promise<{contract: Contract, nextTokenId: string}> {
83 const owner = await helper.eth.createAccountWithBalance(donor);83 const owner = await helper.eth.createAccountWithBalance(donor);
84 const receiver = helper.eth.createAccount();84 const receiver = helper.eth.createAccount();
8585
86 const {collectionAddress} = await helper.eth.createERC721MetadataCompatibleNFTCollection(owner, 'Mint collection', 'a', 'b', tokenPrefix);86 const {collectionAddress} = await helper.eth.createERC721MetadataCompatibleNFTCollection(owner, 'Mint collection', 'a', 'b', baseUri);
87 const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);87 const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', owner);
88 88
89 const nextTokenId = await contract.methods.nextTokenId().call();89 const nextTokenId = await contract.methods.nextTokenId().call();
modifiedtests/src/eth/nonFungibleAbi.jsondiffbeforeafterboth
154 { "internalType": "address", "name": "field_0", "type": "address" },154 { "internalType": "address", "name": "field_0", "type": "address" },
155 { "internalType": "uint256", "name": "field_1", "type": "uint256" }155 { "internalType": "uint256", "name": "field_1", "type": "uint256" }
156 ],156 ],
157 "internalType": "struct Tuple17",157 "internalType": "struct Tuple15",
158 "name": "",158 "name": "",
159 "type": "tuple"159 "type": "tuple"
160 }160 }
178 { "internalType": "address", "name": "field_0", "type": "address" },178 { "internalType": "address", "name": "field_0", "type": "address" },
179 { "internalType": "uint256", "name": "field_1", "type": "uint256" }179 { "internalType": "uint256", "name": "field_1", "type": "uint256" }
180 ],180 ],
181 "internalType": "struct Tuple17",181 "internalType": "struct Tuple15",
182 "name": "",182 "name": "",
183 "type": "tuple"183 "type": "tuple"
184 }184 }
287 { "internalType": "uint256", "name": "field_0", "type": "uint256" },287 { "internalType": "uint256", "name": "field_0", "type": "uint256" },
288 { "internalType": "string", "name": "field_1", "type": "string" }288 { "internalType": "string", "name": "field_1", "type": "string" }
289 ],289 ],
290 "internalType": "struct Tuple8[]",290 "internalType": "struct Tuple6[]",
291 "name": "tokens",291 "name": "tokens",
292 "type": "tuple[]"292 "type": "tuple[]"
293 }293 }
modifiedtests/src/eth/reFungibleAbi.jsondiffbeforeafterboth
154 { "internalType": "address", "name": "field_0", "type": "address" },154 { "internalType": "address", "name": "field_0", "type": "address" },
155 { "internalType": "uint256", "name": "field_1", "type": "uint256" }155 { "internalType": "uint256", "name": "field_1", "type": "uint256" }
156 ],156 ],
157 "internalType": "struct Tuple17",157 "internalType": "struct Tuple15",
158 "name": "",158 "name": "",
159 "type": "tuple"159 "type": "tuple"
160 }160 }
178 { "internalType": "address", "name": "field_0", "type": "address" },178 { "internalType": "address", "name": "field_0", "type": "address" },
179 { "internalType": "uint256", "name": "field_1", "type": "uint256" }179 { "internalType": "uint256", "name": "field_1", "type": "uint256" }
180 ],180 ],
181 "internalType": "struct Tuple17",181 "internalType": "struct Tuple15",
182 "name": "",182 "name": "",
183 "type": "tuple"183 "type": "tuple"
184 }184 }
287 { "internalType": "uint256", "name": "field_0", "type": "uint256" },287 { "internalType": "uint256", "name": "field_0", "type": "uint256" },
288 { "internalType": "string", "name": "field_1", "type": "string" }288 { "internalType": "string", "name": "field_1", "type": "string" }
289 ],289 ],
290 "internalType": "struct Tuple8[]",290 "internalType": "struct Tuple6[]",
291 "name": "tokens",291 "name": "tokens",
292 "type": "tuple[]"292 "type": "tuple[]"
293 }293 }
modifiedtests/src/eth/reFungibleToken.test.tsdiffbeforeafterboth
76 });76 });
77 });77 });
7878
79 async function setup(helper: EthUniqueHelper, tokenPrefix: string, propertyKey?: string, propertyValue?: string): Promise<{contract: Contract, nextTokenId: string}> {79 async function setup(helper: EthUniqueHelper, baseUri: string, propertyKey?: string, propertyValue?: string): Promise<{contract: Contract, nextTokenId: string}> {
80 const owner = await helper.eth.createAccountWithBalance(donor);80 const owner = await helper.eth.createAccountWithBalance(donor);
81 const receiver = helper.eth.createAccount();81 const receiver = helper.eth.createAccount();
8282
83 const {collectionAddress} = await helper.eth.createERC721MetadataCompatibleRFTCollection(owner, 'Mint collection', 'a', 'b', tokenPrefix);83 const {collectionAddress} = await helper.eth.createERC721MetadataCompatibleRFTCollection(owner, 'Mint collection', 'a', 'b', baseUri);
84 const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', owner);84 const contract = helper.ethNativeContract.collection(collectionAddress, 'rft', owner);
85 85
86 const nextTokenId = await contract.methods.nextTokenId().call();86 const nextTokenId = await contract.methods.nextTokenId().call();