difftreelog
build upgrade to new evm-coder syntax
in: master
29 files changed
Cargo.lockdiffbeforeafterboth1771 "zeroize",1771 "zeroize",1772]1772]17731774[[package]]1775name = "darling"1776version = "0.13.4"1777source = "registry+https://github.com/rust-lang/crates.io-index"1778checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c"1779dependencies = [1780 "darling_core",1781 "darling_macro",1782]17831784[[package]]1785name = "darling_core"1786version = "0.13.4"1787source = "registry+https://github.com/rust-lang/crates.io-index"1788checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610"1789dependencies = [1790 "fnv",1791 "ident_case",1792 "proc-macro2",1793 "quote",1794 "strsim",1795 "syn",1796]17971798[[package]]1799name = "darling_macro"1800version = "0.13.4"1801source = "registry+https://github.com/rust-lang/crates.io-index"1802checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835"1803dependencies = [1804 "darling_core",1805 "quote",1806 "syn",1807]180817731809[[package]]1774[[package]]1810name = "data-encoding"1775name = "data-encoding"221721822218[[package]]2183[[package]]2219name = "evm-coder-macros"2184name = "evm-coder-macros"2220version = "0.1.0"2185version = "0.2.0"2221dependencies = [2186dependencies = [2222 "Inflector",2187 "Inflector",2223 "darling",2224 "hex",2188 "hex",2225 "proc-macro2",2189 "proc-macro2",2226 "quote",2190 "quote",2227 "sha3 0.9.1",2191 "sha3 0.10.2",2228 "syn",2192 "syn",2229]2193]223021943428 "winapi",3392 "winapi",3429]3393]34303431[[package]]3432name = "ident_case"3433version = "1.0.1"3434source = "registry+https://github.com/rust-lang/crates.io-index"3435checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"343633943437[[package]]3395[[package]]3438name = "idna"3396name = "idna"pallets/common/src/erc.rsdiffbeforeafterboth60}60}616162/// @title A contract that allows you to work with collections.62/// @title A contract that allows you to work with collections.63#[solidity_interface(name = "Collection")]63#[solidity_interface(name = Collection)]64impl<T: Config> CollectionHandle<T>64impl<T: Config> CollectionHandle<T>65where65where66 T::AccountId: From<[u8; 32]>,66 T::AccountId: From<[u8; 32]>,228 }228 }229229230 /// Add collection admin by substrate address.230 /// Add collection admin by substrate address.231 /// @param new_admin Substrate administrator address.231 /// @param newAdmin Substrate administrator address.232 fn add_collection_admin_substrate(232 fn add_collection_admin_substrate(233 &mut self,233 &mut self,234 caller: caller,234 caller: caller,254 }254 }255255256 /// Add collection admin.256 /// Add collection admin.257 /// @param new_admin Address of the added administrator.257 /// @param newAdmin Address of the added administrator.258 fn add_collection_admin(&mut self, caller: caller, new_admin: address) -> Result<void> {258 fn add_collection_admin(&mut self, caller: caller, new_admin: address) -> Result<void> {259 let caller = T::CrossAccountId::from_eth(caller);259 let caller = T::CrossAccountId::from_eth(caller);260 let new_admin = T::CrossAccountId::from_eth(new_admin);260 let new_admin = T::CrossAccountId::from_eth(new_admin);264264265 /// Remove collection admin.265 /// Remove collection admin.266 ///266 ///267 /// @param new_admin Address of the removed administrator.267 /// @param admin Address of the removed administrator.268 fn remove_collection_admin(&mut self, caller: caller, admin: address) -> Result<void> {268 fn remove_collection_admin(&mut self, caller: caller, admin: address) -> Result<void> {269 let caller = T::CrossAccountId::from_eth(caller);269 let caller = T::CrossAccountId::from_eth(caller);270 let admin = T::CrossAccountId::from_eth(admin);270 let admin = T::CrossAccountId::from_eth(admin);pallets/evm-contract-helpers/src/eth.rsdiffbeforeafterboth42 }42 }43}43}444445#[solidity_interface(name = "ContractHelpers")]45#[solidity_interface(name = ContractHelpers)]46impl<T: Config> ContractHelpers<T>46impl<T: Config> ContractHelpers<T>47where47where48 T::AccountId: AsRef<[u8; 32]>,48 T::AccountId: AsRef<[u8; 32]>,49{49{50 /// Get contract ovner50 /// Get contract ovner51 ///51 ///52 /// @param Contract_address contract for which the owner is being determined.52 /// @param contractAddress contract for which the owner is being determined.53 /// @return Contract owner.53 /// @return Contract owner.54 fn contract_owner(&self, contract_address: address) -> Result<address> {54 fn contract_owner(&self, contract_address: address) -> Result<address> {55 Ok(<Owner<T>>::get(contract_address))55 Ok(<Owner<T>>::get(contract_address))56 }56 }575758 /// Set sponsor.58 /// Set sponsor.59 ///59 ///60 /// @param contract_address Contract for which a sponsor is being established.60 /// @param contractAddress Contract for which a sponsor is being established.61 /// @param sponsor User address who set as pending sponsor.61 /// @param sponsor User address who set as pending sponsor.62 fn set_sponsor(62 fn set_sponsor(63 &mut self,63 &mut self,808081 /// Set contract as self sponsored.81 /// Set contract as self sponsored.82 ///82 ///83 /// @param contract_address Contract for which a self sponsoring is being enabled.83 /// @param contractAddress Contract for which a self sponsoring is being enabled.84 fn self_sponsored_enable(&mut self, caller: caller, contract_address: address) -> Result<void> {84 fn self_sponsored_enable(&mut self, caller: caller, contract_address: address) -> Result<void> {85 self.recorder().consume_sload()?;85 self.recorder().consume_sload()?;86 self.recorder().consume_sstore()?;86 self.recorder().consume_sstore()?;939394 /// Remove sponsor.94 /// Remove sponsor.95 ///95 ///96 /// @param contract_address Contract for which a sponsorship is being removed.96 /// @param contractAddress Contract for which a sponsorship is being removed.97 fn remove_sponsor(&mut self, caller: caller, contract_address: address) -> Result<void> {97 fn remove_sponsor(&mut self, caller: caller, contract_address: address) -> Result<void> {98 self.recorder().consume_sload()?;98 self.recorder().consume_sload()?;99 self.recorder().consume_sstore()?;99 self.recorder().consume_sstore()?;106106107 /// Confirm sponsorship.107 /// Confirm sponsorship.108 ///108 ///109 /// @dev Caller must be same that set via [`set_sponsor`].109 /// @dev Caller must be same that set via [`setSponsor`].110 ///110 ///111 /// @param contract_address Сontract for which need to confirm sponsorship.111 /// @param contractAddress Сontract for which need to confirm sponsorship.112 fn confirm_sponsorship(&mut self, caller: caller, contract_address: address) -> Result<void> {112 fn confirm_sponsorship(&mut self, caller: caller, contract_address: address) -> Result<void> {113 self.recorder().consume_sload()?;113 self.recorder().consume_sload()?;114 self.recorder().consume_sstore()?;114 self.recorder().consume_sstore()?;121121122 /// Get current sponsor.122 /// Get current sponsor.123 ///123 ///124 /// @param contract_address The contract for which a sponsor is requested.124 /// @param contractAddress The contract for which a sponsor is requested.125 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.125 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.126 fn get_sponsor(&self, contract_address: address) -> Result<(address, uint256)> {126 fn get_sponsor(&self, contract_address: address) -> Result<(address, uint256)> {127 let sponsor =127 let sponsor =138138139 /// Check tat contract has confirmed sponsor.139 /// Check tat contract has confirmed sponsor.140 ///140 ///141 /// @param contract_address The contract for which the presence of a confirmed sponsor is checked.141 /// @param contractAddress The contract for which the presence of a confirmed sponsor is checked.142 /// @return **true** if contract has confirmed sponsor.142 /// @return **true** if contract has confirmed sponsor.143 fn has_sponsor(&self, contract_address: address) -> Result<bool> {143 fn has_sponsor(&self, contract_address: address) -> Result<bool> {144 Ok(Pallet::<T>::get_sponsor(contract_address).is_some())144 Ok(Pallet::<T>::get_sponsor(contract_address).is_some())145 }145 }146146147 /// Check tat contract has pending sponsor.147 /// Check tat contract has pending sponsor.148 ///148 ///149 /// @param contract_address The contract for which the presence of a pending sponsor is checked.149 /// @param contractAddress The contract for which the presence of a pending sponsor is checked.150 /// @return **true** if contract has pending sponsor.150 /// @return **true** if contract has pending sponsor.151 fn has_pending_sponsor(&self, contract_address: address) -> Result<bool> {151 fn has_pending_sponsor(&self, contract_address: address) -> Result<bool> {152 Ok(match Sponsoring::<T>::get(contract_address) {152 Ok(match Sponsoring::<T>::get(contract_address) {229 caller: caller,229 caller: caller,230 contract_address: address,230 contract_address: address,231 user: address,231 user: address,232 allowed: bool,232 is_allowed: bool,233 ) -> Result<void> {233 ) -> Result<void> {234 self.recorder().consume_sload()?;234 self.recorder().consume_sload()?;235 self.recorder().consume_sstore()?;235 self.recorder().consume_sstore()?;236236237 <Pallet<T>>::ensure_owner(contract_address, caller).map_err(dispatch_to_evm::<T>)?;237 <Pallet<T>>::ensure_owner(contract_address, caller).map_err(dispatch_to_evm::<T>)?;238 <Pallet<T>>::toggle_allowed(contract_address, user, allowed);238 <Pallet<T>>::toggle_allowed(contract_address, user, is_allowed);239239240 Ok(())240 Ok(())241 }241 }pallets/evm-contract-helpers/src/stubs/ContractHelpers.rawdiffbeforeafterbothbinary blob — no preview
pallets/evm-contract-helpers/src/stubs/ContractHelpers.soldiffbeforeafterboth334pragma solidity >=0.8.0 <0.9.0;4pragma solidity >=0.8.0 <0.9.0;556// Anonymous struct6/// @dev anonymous struct7struct Tuple0 {7struct Tuple0 {8 address field_0;8 address field_0;9 uint256 field_1;9 uint256 field_1;10}10}111112// Common stubs holder12/// @dev common stubs holder13contract Dummy {13contract Dummy {14 uint8 dummy;14 uint8 dummy;15 string stub_error = "this contract is implemented in native";15 string stub_error = "this contract is implemented in native";27 }27 }28}28}292930// Selector: 6073d91730/// @dev the ERC-165 identifier for this interface is 0x6073d91731contract ContractHelpers is Dummy, ERC165 {31contract ContractHelpers is Dummy, ERC165 {32 // Get contract ovner32 /// Get contract ovner33 //33 ///34 // @param Contract_address contract for which the owner is being determined.34 /// @param contractAddress contract for which the owner is being determined.35 // @return Contract owner.35 /// @return Contract owner.36 //36 ///37 // Selector: contractOwner(address) 5152b14c37 /// Selector: contractOwner(address) 5152b14c38 function contractOwner(address contractAddress)38 function contractOwner(address contractAddress)39 public39 public40 view40 view46 return 0x0000000000000000000000000000000000000000;46 return 0x0000000000000000000000000000000000000000;47 }47 }484849 // Set sponsor.49 /// Set sponsor.50 //50 ///51 // @param contract_address Contract for which a sponsor is being established.51 /// @param contractAddress Contract for which a sponsor is being established.52 // @param sponsor User address who set as pending sponsor.52 /// @param sponsor User address who set as pending sponsor.53 //53 ///54 // Selector: setSponsor(address,address) f01fba9354 /// Selector: setSponsor(address,address) f01fba9355 function setSponsor(address contractAddress, address sponsor) public {55 function setSponsor(address contractAddress, address sponsor) public {56 require(false, stub_error);56 require(false, stub_error);57 contractAddress;57 contractAddress;58 sponsor;58 sponsor;59 dummy = 0;59 dummy = 0;60 }60 }616162 // Set contract as self sponsored.62 /// Set contract as self sponsored.63 //63 ///64 // @param contract_address Contract for which a self sponsoring is being enabled.64 /// @param contractAddress Contract for which a self sponsoring is being enabled.65 //65 ///66 // Selector: selfSponsoredEnable(address) 89f7d9ae66 /// Selector: selfSponsoredEnable(address) 89f7d9ae67 function selfSponsoredEnable(address contractAddress) public {67 function selfSponsoredEnable(address contractAddress) public {68 require(false, stub_error);68 require(false, stub_error);69 contractAddress;69 contractAddress;70 dummy = 0;70 dummy = 0;71 }71 }727273 // Remove sponsor.73 /// Remove sponsor.74 //74 ///75 // @param contract_address Contract for which a sponsorship is being removed.75 /// @param contractAddress Contract for which a sponsorship is being removed.76 //76 ///77 // Selector: removeSponsor(address) ef78425077 /// Selector: removeSponsor(address) ef78425078 function removeSponsor(address contractAddress) public {78 function removeSponsor(address contractAddress) public {79 require(false, stub_error);79 require(false, stub_error);80 contractAddress;80 contractAddress;81 dummy = 0;81 dummy = 0;82 }82 }838384 // Confirm sponsorship.84 /// Confirm sponsorship.85 //85 ///86 // @dev Caller must be same that set via [`set_sponsor`].86 /// @dev Caller must be same that set via [`setSponsor`].87 //87 ///88 // @param contract_address Сontract for which need to confirm sponsorship.88 /// @param contractAddress Сontract for which need to confirm sponsorship.89 //89 ///90 // Selector: confirmSponsorship(address) abc0000190 /// Selector: confirmSponsorship(address) abc0000191 function confirmSponsorship(address contractAddress) public {91 function confirmSponsorship(address contractAddress) public {92 require(false, stub_error);92 require(false, stub_error);93 contractAddress;93 contractAddress;94 dummy = 0;94 dummy = 0;95 }95 }969697 // Get current sponsor.97 /// Get current sponsor.98 //98 ///99 // @param contract_address The contract for which a sponsor is requested.99 /// @param contractAddress The contract for which a sponsor is requested.100 // @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.100 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.101 //101 ///102 // Selector: getSponsor(address) 743fc745102 /// Selector: getSponsor(address) 743fc745103 function getSponsor(address contractAddress)103 function getSponsor(address contractAddress)104 public104 public105 view105 view111 return Tuple0(0x0000000000000000000000000000000000000000, 0);111 return Tuple0(0x0000000000000000000000000000000000000000, 0);112 }112 }113113114 // Check tat contract has confirmed sponsor.114 /// Check tat contract has confirmed sponsor.115 //115 ///116 // @param contract_address The contract for which the presence of a confirmed sponsor is checked.116 /// @param contractAddress The contract for which the presence of a confirmed sponsor is checked.117 // @return **true** if contract has confirmed sponsor.117 /// @return **true** if contract has confirmed sponsor.118 //118 ///119 // Selector: hasSponsor(address) 97418603119 /// Selector: hasSponsor(address) 97418603120 function hasSponsor(address contractAddress) public view returns (bool) {120 function hasSponsor(address contractAddress) public view returns (bool) {121 require(false, stub_error);121 require(false, stub_error);122 contractAddress;122 contractAddress;123 dummy;123 dummy;124 return false;124 return false;125 }125 }126126127 // Check tat contract has pending sponsor.127 /// Check tat contract has pending sponsor.128 //128 ///129 // @param contract_address The contract for which the presence of a pending sponsor is checked.129 /// @param contractAddress The contract for which the presence of a pending sponsor is checked.130 // @return **true** if contract has pending sponsor.130 /// @return **true** if contract has pending sponsor.131 //131 ///132 // Selector: hasPendingSponsor(address) 39b9b242132 /// Selector: hasPendingSponsor(address) 39b9b242133 function hasPendingSponsor(address contractAddress)133 function hasPendingSponsor(address contractAddress)134 public134 public135 view135 view141 return false;141 return false;142 }142 }143143144 // Selector: sponsoringEnabled(address) 6027dc61144 /// Selector: sponsoringEnabled(address) 6027dc61145 function sponsoringEnabled(address contractAddress)145 function sponsoringEnabled(address contractAddress)146 public146 public147 view147 view153 return false;153 return false;154 }154 }155155156 // Selector: setSponsoringMode(address,uint8) fde8a560156 /// Selector: setSponsoringMode(address,uint8) fde8a560157 function setSponsoringMode(address contractAddress, uint8 mode) public {157 function setSponsoringMode(address contractAddress, uint8 mode) public {158 require(false, stub_error);158 require(false, stub_error);159 contractAddress;159 contractAddress;160 mode;160 mode;161 dummy = 0;161 dummy = 0;162 }162 }163163164 // Selector: sponsoringMode(address) b70c7267164 /// Selector: sponsoringMode(address) b70c7267165 function sponsoringMode(address contractAddress)165 function sponsoringMode(address contractAddress)166 public166 public167 view167 view173 return 0;173 return 0;174 }174 }175175176 // Selector: setSponsoringRateLimit(address,uint32) 77b6c908176 /// Selector: setSponsoringRateLimit(address,uint32) 77b6c908177 function setSponsoringRateLimit(address contractAddress, uint32 rateLimit)177 function setSponsoringRateLimit(address contractAddress, uint32 rateLimit)178 public178 public179 {179 {183 dummy = 0;183 dummy = 0;184 }184 }185185186 // Selector: getSponsoringRateLimit(address) 610cfabd186 /// Selector: getSponsoringRateLimit(address) 610cfabd187 function getSponsoringRateLimit(address contractAddress)187 function getSponsoringRateLimit(address contractAddress)188 public188 public189 view189 view195 return 0;195 return 0;196 }196 }197197198 // Selector: allowed(address,address) 5c658165198 /// Selector: allowed(address,address) 5c658165199 function allowed(address contractAddress, address user)199 function allowed(address contractAddress, address user)200 public200 public201 view201 view208 return false;208 return false;209 }209 }210210211 // Selector: allowlistEnabled(address) c772ef6c211 /// Selector: allowlistEnabled(address) c772ef6c212 function allowlistEnabled(address contractAddress)212 function allowlistEnabled(address contractAddress)213 public213 public214 view214 view220 return false;220 return false;221 }221 }222222223 // Selector: toggleAllowlist(address,bool) 36de20f5223 /// Selector: toggleAllowlist(address,bool) 36de20f5224 function toggleAllowlist(address contractAddress, bool enabled) public {224 function toggleAllowlist(address contractAddress, bool enabled) public {225 require(false, stub_error);225 require(false, stub_error);226 contractAddress;226 contractAddress;227 enabled;227 enabled;228 dummy = 0;228 dummy = 0;229 }229 }230230231 // Selector: toggleAllowed(address,address,bool) 4706cc1c231 /// Selector: toggleAllowed(address,address,bool) 4706cc1c232 function toggleAllowed(232 function toggleAllowed(233 address contractAddress,233 address contractAddress,234 address user,234 address user,235 bool allowed235 bool isAllowed236 ) public {236 ) public {237 require(false, stub_error);237 require(false, stub_error);238 contractAddress;238 contractAddress;239 user;239 user;240 allowed;240 isAllowed;241 dummy = 0;241 dummy = 0;242 }242 }243}243}pallets/fungible/src/erc.rsdiffbeforeafterboth50 },50 },51}51}525253#[solidity_interface(name = "ERC20", events(ERC20Events))]53#[solidity_interface(name = ERC20, events(ERC20Events))]54impl<T: Config> FungibleHandle<T> {54impl<T: Config> FungibleHandle<T> {55 fn name(&self) -> Result<string> {55 fn name(&self) -> Result<string> {56 Ok(decode_utf16(self.name.iter().copied())56 Ok(decode_utf16(self.name.iter().copied())129 }129 }130}130}131131132#[solidity_interface(name = "ERC20UniqueExtensions")]132#[solidity_interface(name = ERC20UniqueExtensions)]133impl<T: Config> FungibleHandle<T> {133impl<T: Config> FungibleHandle<T> {134 #[weight(<SelfWeightOf<T>>::burn_from())]134 #[weight(<SelfWeightOf<T>>::burn_from())]135 fn burn_from(&mut self, caller: caller, from: address, amount: uint256) -> Result<bool> {135 fn burn_from(&mut self, caller: caller, from: address, amount: uint256) -> Result<bool> {147}147}148148149#[solidity_interface(149#[solidity_interface(150 name = "UniqueFungible",150 name = UniqueFungible,151 is(151 is(152 ERC20,152 ERC20,153 ERC20UniqueExtensions,153 ERC20UniqueExtensions,154 via("CollectionHandle<T>", common_mut, Collection)154 Collection(common_mut, CollectionHandle<T>),155 )155 )156)]156)]157impl<T: Config> FungibleHandle<T> where T::AccountId: From<[u8; 32]> {}157impl<T: Config> FungibleHandle<T> where T::AccountId: From<[u8; 32]> {}pallets/fungible/src/stubs/UniqueFungible.rawdiffbeforeafterbothbinary blob — no preview
pallets/fungible/src/stubs/UniqueFungible.soldiffbeforeafterboth334pragma solidity >=0.8.0 <0.9.0;4pragma solidity >=0.8.0 <0.9.0;556// Common stubs holder6/// @dev common stubs holder7contract Dummy {7contract Dummy {8 uint8 dummy;8 uint8 dummy;9 string stub_error = "this contract is implemented in native";9 string stub_error = "this contract is implemented in native";21 }21 }22}22}232324// Inline24/// @title A contract that allows you to work with collections.25/// @dev the ERC-165 identifier for this interface is 0xffe4da2326contract Collection is Dummy, ERC165 {27 /// Set collection property.28 ///29 /// @param key Property key.30 /// @param value Propery value.31 /// @dev EVM selector for this function is: 0x2f073f66,32 /// or in textual repr: setCollectionProperty(string,bytes)33 function setCollectionProperty(string memory key, bytes memory value)34 public35 {36 require(false, stub_error);37 key;38 value;39 dummy = 0;40 }4142 /// Delete collection property.43 ///44 /// @param key Property key.45 /// @dev EVM selector for this function is: 0x7b7debce,46 /// or in textual repr: deleteCollectionProperty(string)47 function deleteCollectionProperty(string memory key) public {48 require(false, stub_error);49 key;50 dummy = 0;51 }5253 /// Get collection property.54 ///55 /// @dev Throws error if key not found.56 ///57 /// @param key Property key.58 /// @return bytes The property corresponding to the key.59 /// @dev EVM selector for this function is: 0xcf24fd6d,60 /// or in textual repr: collectionProperty(string)61 function collectionProperty(string memory key)62 public63 view64 returns (bytes memory)65 {66 require(false, stub_error);67 key;68 dummy;69 return hex"";70 }7172 /// Set the sponsor of the collection.73 ///74 /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.75 ///76 /// @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.77 /// @dev EVM selector for this function is: 0x7623402e,78 /// or in textual repr: setCollectionSponsor(address)79 function setCollectionSponsor(address sponsor) public {80 require(false, stub_error);81 sponsor;82 dummy = 0;83 }8485 /// Collection sponsorship confirmation.86 ///87 /// @dev After setting the sponsor for the collection, it must be confirmed with this function.88 /// @dev EVM selector for this function is: 0x3c50e97a,89 /// or in textual repr: confirmCollectionSponsorship()90 function confirmCollectionSponsorship() public {91 require(false, stub_error);92 dummy = 0;93 }9495 /// Set limits for the collection.96 /// @dev Throws error if limit not found.97 /// @param limit Name of the limit. Valid names:98 /// "accountTokenOwnershipLimit",99 /// "sponsoredDataSize",100 /// "sponsoredDataRateLimit",101 /// "tokenLimit",102 /// "sponsorTransferTimeout",103 /// "sponsorApproveTimeout"104 /// @param value Value of the limit.105 /// @dev EVM selector for this function is: 0x6a3841db,106 /// or in textual repr: setCollectionLimit(string,uint32)107 function setCollectionLimit(string memory limit, uint32 value) public {108 require(false, stub_error);109 limit;110 value;111 dummy = 0;112 }113114 /// Set limits for the collection.115 /// @dev Throws error if limit not found.116 /// @param limit Name of the limit. Valid names:117 /// "ownerCanTransfer",118 /// "ownerCanDestroy",119 /// "transfersEnabled"120 /// @param value Value of the limit.121 /// @dev EVM selector for this function is: 0x993b7fba,122 /// or in textual repr: setCollectionLimit(string,bool)123 function setCollectionLimit(string memory limit, bool value) public {124 require(false, stub_error);125 limit;126 value;127 dummy = 0;128 }129130 /// Get contract address.131 /// @dev EVM selector for this function is: 0xf6b4dfb4,132 /// or in textual repr: contractAddress()133 function contractAddress() public view returns (address) {134 require(false, stub_error);135 dummy;136 return 0x0000000000000000000000000000000000000000;137 }138139 /// Add collection admin by substrate address.140 /// @param newAdmin Substrate administrator address.141 /// @dev EVM selector for this function is: 0x5730062b,142 /// or in textual repr: addCollectionAdminSubstrate(uint256)143 function addCollectionAdminSubstrate(uint256 newAdmin) public {144 require(false, stub_error);145 newAdmin;146 dummy = 0;147 }148149 /// Remove collection admin by substrate address.150 /// @param admin Substrate administrator address.151 /// @dev EVM selector for this function is: 0x4048fcf9,152 /// or in textual repr: removeCollectionAdminSubstrate(uint256)153 function removeCollectionAdminSubstrate(uint256 admin) public {154 require(false, stub_error);155 admin;156 dummy = 0;157 }158159 /// Add collection admin.160 /// @param newAdmin Address of the added administrator.161 /// @dev EVM selector for this function is: 0x92e462c7,162 /// or in textual repr: addCollectionAdmin(address)163 function addCollectionAdmin(address newAdmin) public {164 require(false, stub_error);165 newAdmin;166 dummy = 0;167 }168169 /// Remove collection admin.170 ///171 /// @param admin Address of the removed administrator.172 /// @dev EVM selector for this function is: 0xfafd7b42,173 /// or in textual repr: removeCollectionAdmin(address)174 function removeCollectionAdmin(address admin) public {175 require(false, stub_error);176 admin;177 dummy = 0;178 }179180 /// Toggle accessibility of collection nesting.181 ///182 /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'183 /// @dev EVM selector for this function is: 0x112d4586,184 /// or in textual repr: setCollectionNesting(bool)185 function setCollectionNesting(bool enable) public {186 require(false, stub_error);187 enable;188 dummy = 0;189 }190191 /// Toggle accessibility of collection nesting.192 ///193 /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'194 /// @param collections Addresses of collections that will be available for nesting.195 /// @dev EVM selector for this function is: 0x64872396,196 /// or in textual repr: setCollectionNesting(bool,address[])197 function setCollectionNesting(bool enable, address[] memory collections)198 public199 {200 require(false, stub_error);201 enable;202 collections;203 dummy = 0;204 }205206 /// Set the collection access method.207 /// @param mode Access mode208 /// 0 for Normal209 /// 1 for AllowList210 /// @dev EVM selector for this function is: 0x41835d4c,211 /// or in textual repr: setCollectionAccess(uint8)212 function setCollectionAccess(uint8 mode) public {213 require(false, stub_error);214 mode;215 dummy = 0;216 }217218 /// Add the user to the allowed list.219 ///220 /// @param user Address of a trusted user.221 /// @dev EVM selector for this function is: 0x67844fe6,222 /// or in textual repr: addToCollectionAllowList(address)223 function addToCollectionAllowList(address user) public {224 require(false, stub_error);225 user;226 dummy = 0;227 }228229 /// Remove the user from the allowed list.230 ///231 /// @param user Address of a removed user.232 /// @dev EVM selector for this function is: 0x85c51acb,233 /// or in textual repr: removeFromCollectionAllowList(address)234 function removeFromCollectionAllowList(address user) public {235 require(false, stub_error);236 user;237 dummy = 0;238 }239240 /// Switch permission for minting.241 ///242 /// @param mode Enable if "true".243 /// @dev EVM selector for this function is: 0x00018e84,244 /// or in textual repr: setCollectionMintMode(bool)245 function setCollectionMintMode(bool mode) public {246 require(false, stub_error);247 mode;248 dummy = 0;249 }250251 /// Check that account is the owner or admin of the collection252 ///253 /// @param user account to verify254 /// @return "true" if account is the owner or admin255 /// @dev EVM selector for this function is: 0x9811b0c7,256 /// or in textual repr: isOwnerOrAdmin(address)257 function isOwnerOrAdmin(address user) public view returns (bool) {258 require(false, stub_error);259 user;260 dummy;261 return false;262 }263264 /// Check that substrate account is the owner or admin of the collection265 ///266 /// @param user account to verify267 /// @return "true" if account is the owner or admin268 /// @dev EVM selector for this function is: 0x68910e00,269 /// or in textual repr: isOwnerOrAdminSubstrate(uint256)270 function isOwnerOrAdminSubstrate(uint256 user) public view returns (bool) {271 require(false, stub_error);272 user;273 dummy;274 return false;275 }276277 /// Returns collection type278 ///279 /// @return `Fungible` or `NFT` or `ReFungible`280 /// @dev EVM selector for this function is: 0xd34b55b8,281 /// or in textual repr: uniqueCollectionType()282 function uniqueCollectionType() public returns (string memory) {283 require(false, stub_error);284 dummy = 0;285 return "";286 }287288 /// Changes collection owner to another account289 ///290 /// @dev Owner can be changed only by current owner291 /// @param newOwner new owner account292 /// @dev EVM selector for this function is: 0x13af4035,293 /// or in textual repr: setOwner(address)294 function setOwner(address newOwner) public {295 require(false, stub_error);296 newOwner;297 dummy = 0;298 }299300 /// Changes collection owner to another substrate account301 ///302 /// @dev Owner can be changed only by current owner303 /// @param newOwner new owner substrate account304 /// @dev EVM selector for this function is: 0xb212138f,305 /// or in textual repr: setOwnerSubstrate(uint256)306 function setOwnerSubstrate(uint256 newOwner) public {307 require(false, stub_error);308 newOwner;309 dummy = 0;310 }311}312313/// @dev the ERC-165 identifier for this interface is 0x79cc6790314contract ERC20UniqueExtensions is Dummy, ERC165 {315 /// @dev EVM selector for this function is: 0x79cc6790,316 /// or in textual repr: burnFrom(address,uint256)317 function burnFrom(address from, uint256 amount) public returns (bool) {318 require(false, stub_error);319 from;320 amount;321 dummy = 0;322 return false;323 }324}325326/// @dev inlined interface25contract ERC20Events {327contract ERC20Events {26 event Transfer(address indexed from, address indexed to, uint256 value);328 event Transfer(address indexed from, address indexed to, uint256 value);27 event Approval(329 event Approval(31 );333 );32}334}3333534// Selector: 79cc6790336/// @dev the ERC-165 identifier for this interface is 0x942e8b2235contract ERC20UniqueExtensions is Dummy, ERC165 {36 // Selector: burnFrom(address,uint256) 79cc679037 function burnFrom(address from, uint256 amount) public returns (bool) {38 require(false, stub_error);39 from;40 amount;41 dummy = 0;42 return false;43 }44}4546// Selector: 942e8b2247contract ERC20 is Dummy, ERC165, ERC20Events {337contract ERC20 is Dummy, ERC165, ERC20Events {48 // Selector: name() 06fdde03338 /// @dev EVM selector for this function is: 0x06fdde03,339 /// or in textual repr: name()49 function name() public view returns (string memory) {340 function name() public view returns (string memory) {50 require(false, stub_error);341 require(false, stub_error);51 dummy;342 dummy;52 return "";343 return "";53 }344 }5434555 // Selector: symbol() 95d89b41346 /// @dev EVM selector for this function is: 0x95d89b41,347 /// or in textual repr: symbol()56 function symbol() public view returns (string memory) {348 function symbol() public view returns (string memory) {57 require(false, stub_error);349 require(false, stub_error);58 dummy;350 dummy;59 return "";351 return "";60 }352 }6135362 // Selector: totalSupply() 18160ddd354 /// @dev EVM selector for this function is: 0x18160ddd,355 /// or in textual repr: totalSupply()63 function totalSupply() public view returns (uint256) {356 function totalSupply() public view returns (uint256) {64 require(false, stub_error);357 require(false, stub_error);65 dummy;358 dummy;66 return 0;359 return 0;67 }360 }6836169 // Selector: decimals() 313ce567362 /// @dev EVM selector for this function is: 0x313ce567,363 /// or in textual repr: decimals()70 function decimals() public view returns (uint8) {364 function decimals() public view returns (uint8) {71 require(false, stub_error);365 require(false, stub_error);72 dummy;366 dummy;73 return 0;367 return 0;74 }368 }75369370 /// @dev EVM selector for this function is: 0x70a08231,76 // Selector: balanceOf(address) 70a08231371 /// or in textual repr: balanceOf(address)77 function balanceOf(address owner) public view returns (uint256) {372 function balanceOf(address owner) public view returns (uint256) {78 require(false, stub_error);373 require(false, stub_error);79 owner;374 owner;80 dummy;375 dummy;81 return 0;376 return 0;82 }377 }83378379 /// @dev EVM selector for this function is: 0xa9059cbb,84 // Selector: transfer(address,uint256) a9059cbb380 /// or in textual repr: transfer(address,uint256)85 function transfer(address to, uint256 amount) public returns (bool) {381 function transfer(address to, uint256 amount) public returns (bool) {86 require(false, stub_error);382 require(false, stub_error);87 to;383 to;90 return false;386 return false;91 }387 }92388389 /// @dev EVM selector for this function is: 0x23b872dd,93 // Selector: transferFrom(address,address,uint256) 23b872dd390 /// or in textual repr: transferFrom(address,address,uint256)94 function transferFrom(391 function transferFrom(95 address from,392 address from,96 address to,393 address to,104 return false;401 return false;105 }402 }106403404 /// @dev EVM selector for this function is: 0x095ea7b3,107 // Selector: approve(address,uint256) 095ea7b3405 /// or in textual repr: approve(address,uint256)108 function approve(address spender, uint256 amount) public returns (bool) {406 function approve(address spender, uint256 amount) public returns (bool) {109 require(false, stub_error);407 require(false, stub_error);110 spender;408 spender;113 return false;411 return false;114 }412 }115413414 /// @dev EVM selector for this function is: 0xdd62ed3e,116 // Selector: allowance(address,address) dd62ed3e415 /// or in textual repr: allowance(address,address)117 function allowance(address owner, address spender)416 function allowance(address owner, address spender)118 public417 public119 view418 view127 }426 }128}427}129130// Selector: ffe4da23131contract 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) 2f073f66138 function setCollectionProperty(string memory key, bytes memory value)139 public140 {141 require(false, stub_error);142 key;143 value;144 dummy = 0;145 }146147 // Delete collection property.148 //149 // @param key Property key.150 //151 // Selector: deleteCollectionProperty(string) 7b7debce152 function deleteCollectionProperty(string memory key) public {153 require(false, stub_error);154 key;155 dummy = 0;156 }157158 // 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) cf24fd6d166 function collectionProperty(string memory key)167 public168 view169 returns (bytes memory)170 {171 require(false, stub_error);172 key;173 dummy;174 return hex"";175 }176177 // 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) 7623402e184 function setCollectionSponsor(address sponsor) public {185 require(false, stub_error);186 sponsor;187 dummy = 0;188 }189190 // Collection sponsorship confirmation.191 //192 // @dev After setting the sponsor for the collection, it must be confirmed with this function.193 //194 // Selector: confirmCollectionSponsorship() 3c50e97a195 function confirmCollectionSponsorship() public {196 require(false, stub_error);197 dummy = 0;198 }199200 // 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) 6a3841db212 function setCollectionLimit(string memory limit, uint32 value) public {213 require(false, stub_error);214 limit;215 value;216 dummy = 0;217 }218219 // 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) 993b7fba228 function setCollectionLimit(string memory limit, bool value) public {229 require(false, stub_error);230 limit;231 value;232 dummy = 0;233 }234235 // Get contract address.236 //237 // Selector: contractAddress() f6b4dfb4238 function contractAddress() public view returns (address) {239 require(false, stub_error);240 dummy;241 return 0x0000000000000000000000000000000000000000;242 }243244 // Add collection admin by substrate address.245 // @param new_admin Substrate administrator address.246 //247 // Selector: addCollectionAdminSubstrate(uint256) 5730062b248 function addCollectionAdminSubstrate(uint256 newAdmin) public {249 require(false, stub_error);250 newAdmin;251 dummy = 0;252 }253254 // Remove collection admin by substrate address.255 // @param admin Substrate administrator address.256 //257 // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9258 function removeCollectionAdminSubstrate(uint256 admin) public {259 require(false, stub_error);260 admin;261 dummy = 0;262 }263264 // Add collection admin.265 // @param new_admin Address of the added administrator.266 //267 // Selector: addCollectionAdmin(address) 92e462c7268 function addCollectionAdmin(address newAdmin) public {269 require(false, stub_error);270 newAdmin;271 dummy = 0;272 }273274 // Remove collection admin.275 //276 // @param new_admin Address of the removed administrator.277 //278 // Selector: removeCollectionAdmin(address) fafd7b42279 function removeCollectionAdmin(address admin) public {280 require(false, stub_error);281 admin;282 dummy = 0;283 }284285 // Toggle accessibility of collection nesting.286 //287 // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'288 //289 // Selector: setCollectionNesting(bool) 112d4586290 function setCollectionNesting(bool enable) public {291 require(false, stub_error);292 enable;293 dummy = 0;294 }295296 // 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[]) 64872396302 function setCollectionNesting(bool enable, address[] memory collections)303 public304 {305 require(false, stub_error);306 enable;307 collections;308 dummy = 0;309 }310311 // Set the collection access method.312 // @param mode Access mode313 // 0 for Normal314 // 1 for AllowList315 //316 // Selector: setCollectionAccess(uint8) 41835d4c317 function setCollectionAccess(uint8 mode) public {318 require(false, stub_error);319 mode;320 dummy = 0;321 }322323 // Add the user to the allowed list.324 //325 // @param user Address of a trusted user.326 //327 // Selector: addToCollectionAllowList(address) 67844fe6328 function addToCollectionAllowList(address user) public {329 require(false, stub_error);330 user;331 dummy = 0;332 }333334 // Remove the user from the allowed list.335 //336 // @param user Address of a removed user.337 //338 // Selector: removeFromCollectionAllowList(address) 85c51acb339 function removeFromCollectionAllowList(address user) public {340 require(false, stub_error);341 user;342 dummy = 0;343 }344345 // Switch permission for minting.346 //347 // @param mode Enable if "true".348 //349 // Selector: setCollectionMintMode(bool) 00018e84350 function setCollectionMintMode(bool mode) public {351 require(false, stub_error);352 mode;353 dummy = 0;354 }355356 // Check that account is the owner or admin of the collection357 //358 // @param user account to verify359 // @return "true" if account is the owner or admin360 //361 // Selector: isOwnerOrAdmin(address) 9811b0c7362 function isOwnerOrAdmin(address user) public view returns (bool) {363 require(false, stub_error);364 user;365 dummy;366 return false;367 }368369 // Check that substrate account is the owner or admin of the collection370 //371 // @param user account to verify372 // @return "true" if account is the owner or admin373 //374 // Selector: isOwnerOrAdminSubstrate(uint256) 68910e00375 function isOwnerOrAdminSubstrate(uint256 user) public view returns (bool) {376 require(false, stub_error);377 user;378 dummy;379 return false;380 }381382 // Returns collection type383 //384 // @return `Fungible` or `NFT` or `ReFungible`385 //386 // Selector: uniqueCollectionType() d34b55b8387 function uniqueCollectionType() public returns (string memory) {388 require(false, stub_error);389 dummy = 0;390 return "";391 }392393 // Changes collection owner to another account394 //395 // @dev Owner can be changed only by current owner396 // @param newOwner new owner account397 //398 // Selector: setOwner(address) 13af4035399 function setOwner(address newOwner) public {400 require(false, stub_error);401 newOwner;402 dummy = 0;403 }404405 // Changes collection owner to another substrate account406 //407 // @dev Owner can be changed only by current owner408 // @param newOwner new owner substrate account409 //410 // Selector: setOwnerSubstrate(uint256) b212138f411 function setOwnerSubstrate(uint256 newOwner) public {412 require(false, stub_error);413 newOwner;414 dummy = 0;415 }416}417428418contract UniqueFungible is429contract UniqueFungible is419 Dummy,430 Dummy,pallets/nonfungible/src/erc.rsdiffbeforeafterboth50};50};515152/// @title A contract that allows to set and delete token properties and change token property permissions.52/// @title A contract that allows to set and delete token properties and change token property permissions.53#[solidity_interface(name = "TokenProperties")]53#[solidity_interface(name = TokenProperties)]54impl<T: Config> NonfungibleHandle<T> {54impl<T: Config> NonfungibleHandle<T> {55 /// @notice Set permissions for token property.55 /// @notice Set permissions for token property.56 /// @dev Throws error if `msg.sender` is not admin or owner of the collection.56 /// @dev Throws error if `msg.sender` is not admin or owner of the collection.57 /// @param key Property key.57 /// @param key Property key.58 /// @param is_mutable Permission to mutate property.58 /// @param isMutable Permission to mutate property.59 /// @param collection_admin Permission to mutate property by collection admin if property is mutable.59 /// @param collectionAdmin Permission to mutate property by collection admin if property is mutable.60 /// @param token_owner Permission to mutate property by token owner if property is mutable.60 /// @param tokenOwner Permission to mutate property by token owner if property is mutable.61 fn set_token_property_permission(61 fn set_token_property_permission(62 &mut self,62 &mut self,63 caller: caller,63 caller: caller,201201202/// @title ERC-721 Non-Fungible Token Standard, optional metadata extension202/// @title ERC-721 Non-Fungible Token Standard, optional metadata extension203/// @dev See https://eips.ethereum.org/EIPS/eip-721203/// @dev See https://eips.ethereum.org/EIPS/eip-721204#[solidity_interface(name = "ERC721Metadata")]204#[solidity_interface(name = ERC721Metadata, expect_selector = 0x5b5e139f)]205impl<T: Config> NonfungibleHandle<T> {205impl<T: Config> NonfungibleHandle<T> {206 /// @notice A descriptive name for a collection of NFTs in this contract206 /// @notice A descriptive name for a collection of NFTs in this contract207 fn name(&self) -> Result<string> {207 fn name(&self) -> Result<string> {262262263/// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension263/// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension264/// @dev See https://eips.ethereum.org/EIPS/eip-721264/// @dev See https://eips.ethereum.org/EIPS/eip-721265#[solidity_interface(name = "ERC721Enumerable")]265#[solidity_interface(name = ERC721Enumerable, expect_selector = 0x780e9d63)]266impl<T: Config> NonfungibleHandle<T> {266impl<T: Config> NonfungibleHandle<T> {267 /// @notice Enumerate valid NFTs267 /// @notice Enumerate valid NFTs268 /// @param index A counter less than `totalSupply()`268 /// @param index A counter less than `totalSupply()`289289290/// @title ERC-721 Non-Fungible Token Standard290/// @title ERC-721 Non-Fungible Token Standard291/// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md291/// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md292#[solidity_interface(name = "ERC721", events(ERC721Events))]292#[solidity_interface(name = ERC721, events(ERC721Events), expect_selector = 0x80ac58cd)]293impl<T: Config> NonfungibleHandle<T> {293impl<T: Config> NonfungibleHandle<T> {294 /// @notice Count all NFTs assigned to an owner294 /// @notice Count all NFTs assigned to an owner295 /// @dev NFTs assigned to the zero address are considered invalid, and this295 /// @dev NFTs assigned to the zero address are considered invalid, and this316 .as_eth())316 .as_eth())317 }317 }318 /// @dev Not implemented318 /// @dev Not implemented319 #[solidity(rename_selector = "safeTransferFrom")]319 fn safe_transfer_from_with_data(320 fn safe_transfer_from_with_data(320 &mut self,321 &mut self,321 _from: address,322 _from: address,322 _to: address,323 _to: address,323 _token_id: uint256,324 _token_id: uint256,324 _data: bytes,325 _data: bytes,325 _value: value,326 ) -> Result<void> {326 ) -> Result<void> {327 // TODO: Not implemetable327 // TODO: Not implemetable328 Err("not implemented".into())328 Err("not implemented".into())333 _from: address,333 _from: address,334 _to: address,334 _to: address,335 _token_id: uint256,335 _token_id: uint256,336 _value: value,337 ) -> Result<void> {336 ) -> Result<void> {338 // TODO: Not implemetable337 // TODO: Not implemetable339 Err("not implemented".into())338 Err("not implemented".into())348 /// @param from The current owner of the NFT347 /// @param from The current owner of the NFT349 /// @param to The new owner348 /// @param to The new owner350 /// @param tokenId The NFT to transfer349 /// @param tokenId The NFT to transfer351 /// @param _value Not used for an NFT352 #[weight(<SelfWeightOf<T>>::transfer_from())]350 #[weight(<SelfWeightOf<T>>::transfer_from())]353 fn transfer_from(351 fn transfer_from(354 &mut self,352 &mut self,355 caller: caller,353 caller: caller,356 from: address,354 from: address,357 to: address,355 to: address,358 token_id: uint256,356 token_id: uint256,359 _value: value,360 ) -> Result<void> {357 ) -> Result<void> {361 let caller = T::CrossAccountId::from_eth(caller);358 let caller = T::CrossAccountId::from_eth(caller);362 let from = T::CrossAccountId::from_eth(from);359 let from = T::CrossAccountId::from_eth(from);382 &mut self,383 caller: caller,384 approved: address,385 token_id: uint256,386 _value: value,387 ) -> Result<void> {388 let caller = T::CrossAccountId::from_eth(caller);379 let caller = T::CrossAccountId::from_eth(caller);389 let approved = T::CrossAccountId::from_eth(approved);380 let approved = T::CrossAccountId::from_eth(approved);419}410}420411421/// @title ERC721 Token that can be irreversibly burned (destroyed).412/// @title ERC721 Token that can be irreversibly burned (destroyed).422#[solidity_interface(name = "ERC721Burnable")]413#[solidity_interface(name = ERC721Burnable)]423impl<T: Config> NonfungibleHandle<T> {414impl<T: Config> NonfungibleHandle<T> {424 /// @notice Burns a specific ERC721 token.415 /// @notice Burns a specific ERC721 token.425 /// @dev Throws unless `msg.sender` is the current NFT owner, or an authorized416 /// @dev Throws unless `msg.sender` is the current NFT owner, or an authorized436}427}437428438/// @title ERC721 minting logic.429/// @title ERC721 minting logic.439#[solidity_interface(name = "ERC721Mintable", events(ERC721MintableEvents))]430#[solidity_interface(name = ERC721Mintable, events(ERC721MintableEvents))]440impl<T: Config> NonfungibleHandle<T> {431impl<T: Config> NonfungibleHandle<T> {441 fn minting_finished(&self) -> Result<bool> {432 fn minting_finished(&self) -> Result<bool> {442 Ok(false)433 Ok(false)597}588}598589599/// @title Unique extensions for ERC721.590/// @title Unique extensions for ERC721.600#[solidity_interface(name = "ERC721UniqueExtensions")]591#[solidity_interface(name = ERC721UniqueExtensions)]601impl<T: Config> NonfungibleHandle<T> {592impl<T: Config> NonfungibleHandle<T> {602 /// @notice Transfer ownership of an NFT593 /// @notice Transfer ownership of an NFT603 /// @dev Throws unless `msg.sender` is the current owner. Throws if `to`594 /// @dev Throws unless `msg.sender` is the current owner. Throws if `to`604 /// is the zero address. Throws if `tokenId` is not a valid NFT.595 /// is the zero address. Throws if `tokenId` is not a valid NFT.605 /// @param to The new owner596 /// @param to The new owner606 /// @param tokenId The NFT to transfer597 /// @param tokenId The NFT to transfer607 /// @param _value Not used for an NFT608 #[weight(<SelfWeightOf<T>>::transfer())]598 #[weight(<SelfWeightOf<T>>::transfer())]609 fn transfer(599 fn transfer(&mut self, caller: caller, to: address, token_id: uint256) -> Result<void> {610 &mut self,611 caller: caller,612 to: address,613 token_id: uint256,614 _value: value,615 ) -> Result<void> {616 let caller = T::CrossAccountId::from_eth(caller);600 let caller = T::CrossAccountId::from_eth(caller);617 let to = T::CrossAccountId::from_eth(to);601 let to = T::CrossAccountId::from_eth(to);630 /// if `to` is the zero address. Throws if `tokenId` is not a valid NFT.614 /// if `to` is the zero address. Throws if `tokenId` is not a valid NFT.631 /// @param from The current owner of the NFT615 /// @param from The current owner of the NFT632 /// @param tokenId The NFT to transfer616 /// @param tokenId The NFT to transfer633 /// @param _value Not used for an NFT634 #[weight(<SelfWeightOf<T>>::burn_from())]617 #[weight(<SelfWeightOf<T>>::burn_from())]635 fn burn_from(618 fn burn_from(&mut self, caller: caller, from: address, token_id: uint256) -> Result<void> {636 &mut self,637 caller: caller,638 from: address,639 token_id: uint256,640 _value: value,641 ) -> Result<void> {642 let caller = T::CrossAccountId::from_eth(caller);619 let caller = T::CrossAccountId::from_eth(caller);643 let from = T::CrossAccountId::from_eth(from);620 let from = T::CrossAccountId::from_eth(from);751}728}752729753#[solidity_interface(730#[solidity_interface(754 name = "UniqueNFT",731 name = UniqueNFT,755 is(732 is(756 ERC721,733 ERC721,757 ERC721Metadata,734 ERC721Metadata,758 ERC721Enumerable,735 ERC721Enumerable,759 ERC721UniqueExtensions,736 ERC721UniqueExtensions,760 ERC721Mintable,737 ERC721Mintable,761 ERC721Burnable,738 ERC721Burnable,762 via("CollectionHandle<T>", common_mut, Collection),739 Collection(common_mut, CollectionHandle<T>),763 TokenProperties,740 TokenProperties,764 )741 )765)]742)]pallets/nonfungible/src/stubs/UniqueNFT.rawdiffbeforeafterbothbinary blob — no preview
pallets/nonfungible/src/stubs/UniqueNFT.soldiffbeforeafterboth334pragma solidity >=0.8.0 <0.9.0;4pragma solidity >=0.8.0 <0.9.0;56// Anonymous struct7struct Tuple0 {8 uint256 field_0;9 string field_1;10}11512// Common stubs holder6/// @dev common stubs holder13contract Dummy {7contract Dummy {14 uint8 dummy;8 uint8 dummy;15 string stub_error = "this contract is implemented in native";9 string stub_error = "this contract is implemented in native";27 }21 }28}22}292330// Inline24/// @title A contract that allows to set and delete token properties and change token property permissions.25/// @dev the ERC-165 identifier for this interface is 0x4136937726contract TokenProperties is Dummy, ERC165 {27 /// @notice Set permissions for token property.28 /// @dev Throws error if `msg.sender` is not admin or owner of the collection.29 /// @param key Property key.30 /// @param isMutable Permission to mutate property.31 /// @param collectionAdmin Permission to mutate property by collection admin if property is mutable.32 /// @param tokenOwner Permission to mutate property by token owner if property is mutable.33 /// @dev EVM selector for this function is: 0x222d97fa,34 /// or in textual repr: setTokenPropertyPermission(string,bool,bool,bool)35 function setTokenPropertyPermission(36 string memory key,37 bool isMutable,38 bool collectionAdmin,39 bool tokenOwner40 ) public {41 require(false, stub_error);42 key;43 isMutable;44 collectionAdmin;45 tokenOwner;46 dummy = 0;47 }4849 /// @notice Set token property value.50 /// @dev Throws error if `msg.sender` has no permission to edit the property.51 /// @param tokenId ID of the token.52 /// @param key Property key.53 /// @param value Property value.54 /// @dev EVM selector for this function is: 0x1752d67b,55 /// or in textual repr: setProperty(uint256,string,bytes)56 function setProperty(57 uint256 tokenId,58 string memory key,59 bytes memory value60 ) public {61 require(false, stub_error);62 tokenId;63 key;64 value;65 dummy = 0;66 }6768 /// @notice Delete token property value.69 /// @dev Throws error if `msg.sender` has no permission to edit the property.70 /// @param tokenId ID of the token.71 /// @param key Property key.72 /// @dev EVM selector for this function is: 0x066111d1,73 /// or in textual repr: deleteProperty(uint256,string)74 function deleteProperty(uint256 tokenId, string memory key) public {75 require(false, stub_error);76 tokenId;77 key;78 dummy = 0;79 }8081 /// @notice Get token property value.82 /// @dev Throws error if key not found83 /// @param tokenId ID of the token.84 /// @param key Property key.85 /// @return Property value bytes86 /// @dev EVM selector for this function is: 0x7228c327,87 /// or in textual repr: property(uint256,string)88 function property(uint256 tokenId, string memory key)89 public90 view91 returns (bytes memory)92 {93 require(false, stub_error);94 tokenId;95 key;96 dummy;97 return hex"";98 }99}100101/// @title A contract that allows you to work with collections.102/// @dev the ERC-165 identifier for this interface is 0xffe4da23103contract Collection is Dummy, ERC165 {104 /// Set collection property.105 ///106 /// @param key Property key.107 /// @param value Propery value.108 /// @dev EVM selector for this function is: 0x2f073f66,109 /// or in textual repr: setCollectionProperty(string,bytes)110 function setCollectionProperty(string memory key, bytes memory value)111 public112 {113 require(false, stub_error);114 key;115 value;116 dummy = 0;117 }118119 /// Delete collection property.120 ///121 /// @param key Property key.122 /// @dev EVM selector for this function is: 0x7b7debce,123 /// or in textual repr: deleteCollectionProperty(string)124 function deleteCollectionProperty(string memory key) public {125 require(false, stub_error);126 key;127 dummy = 0;128 }129130 /// Get collection property.131 ///132 /// @dev Throws error if key not found.133 ///134 /// @param key Property key.135 /// @return bytes The property corresponding to the key.136 /// @dev EVM selector for this function is: 0xcf24fd6d,137 /// or in textual repr: collectionProperty(string)138 function collectionProperty(string memory key)139 public140 view141 returns (bytes memory)142 {143 require(false, stub_error);144 key;145 dummy;146 return hex"";147 }148149 /// Set the sponsor of the collection.150 ///151 /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.152 ///153 /// @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.154 /// @dev EVM selector for this function is: 0x7623402e,155 /// or in textual repr: setCollectionSponsor(address)156 function setCollectionSponsor(address sponsor) public {157 require(false, stub_error);158 sponsor;159 dummy = 0;160 }161162 /// Collection sponsorship confirmation.163 ///164 /// @dev After setting the sponsor for the collection, it must be confirmed with this function.165 /// @dev EVM selector for this function is: 0x3c50e97a,166 /// or in textual repr: confirmCollectionSponsorship()167 function confirmCollectionSponsorship() public {168 require(false, stub_error);169 dummy = 0;170 }171172 /// Set limits for the collection.173 /// @dev Throws error if limit not found.174 /// @param limit Name of the limit. Valid names:175 /// "accountTokenOwnershipLimit",176 /// "sponsoredDataSize",177 /// "sponsoredDataRateLimit",178 /// "tokenLimit",179 /// "sponsorTransferTimeout",180 /// "sponsorApproveTimeout"181 /// @param value Value of the limit.182 /// @dev EVM selector for this function is: 0x6a3841db,183 /// or in textual repr: setCollectionLimit(string,uint32)184 function setCollectionLimit(string memory limit, uint32 value) public {185 require(false, stub_error);186 limit;187 value;188 dummy = 0;189 }190191 /// Set limits for the collection.192 /// @dev Throws error if limit not found.193 /// @param limit Name of the limit. Valid names:194 /// "ownerCanTransfer",195 /// "ownerCanDestroy",196 /// "transfersEnabled"197 /// @param value Value of the limit.198 /// @dev EVM selector for this function is: 0x993b7fba,199 /// or in textual repr: setCollectionLimit(string,bool)200 function setCollectionLimit(string memory limit, bool value) public {201 require(false, stub_error);202 limit;203 value;204 dummy = 0;205 }206207 /// Get contract address.208 /// @dev EVM selector for this function is: 0xf6b4dfb4,209 /// or in textual repr: contractAddress()210 function contractAddress() public view returns (address) {211 require(false, stub_error);212 dummy;213 return 0x0000000000000000000000000000000000000000;214 }215216 /// Add collection admin by substrate address.217 /// @param newAdmin Substrate administrator address.218 /// @dev EVM selector for this function is: 0x5730062b,219 /// or in textual repr: addCollectionAdminSubstrate(uint256)220 function addCollectionAdminSubstrate(uint256 newAdmin) public {221 require(false, stub_error);222 newAdmin;223 dummy = 0;224 }225226 /// Remove collection admin by substrate address.227 /// @param admin Substrate administrator address.228 /// @dev EVM selector for this function is: 0x4048fcf9,229 /// or in textual repr: removeCollectionAdminSubstrate(uint256)230 function removeCollectionAdminSubstrate(uint256 admin) public {231 require(false, stub_error);232 admin;233 dummy = 0;234 }235236 /// Add collection admin.237 /// @param newAdmin Address of the added administrator.238 /// @dev EVM selector for this function is: 0x92e462c7,239 /// or in textual repr: addCollectionAdmin(address)240 function addCollectionAdmin(address newAdmin) public {241 require(false, stub_error);242 newAdmin;243 dummy = 0;244 }245246 /// Remove collection admin.247 ///248 /// @param admin Address of the removed administrator.249 /// @dev EVM selector for this function is: 0xfafd7b42,250 /// or in textual repr: removeCollectionAdmin(address)251 function removeCollectionAdmin(address admin) public {252 require(false, stub_error);253 admin;254 dummy = 0;255 }256257 /// Toggle accessibility of collection nesting.258 ///259 /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'260 /// @dev EVM selector for this function is: 0x112d4586,261 /// or in textual repr: setCollectionNesting(bool)262 function setCollectionNesting(bool enable) public {263 require(false, stub_error);264 enable;265 dummy = 0;266 }267268 /// Toggle accessibility of collection nesting.269 ///270 /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'271 /// @param collections Addresses of collections that will be available for nesting.272 /// @dev EVM selector for this function is: 0x64872396,273 /// or in textual repr: setCollectionNesting(bool,address[])274 function setCollectionNesting(bool enable, address[] memory collections)275 public276 {277 require(false, stub_error);278 enable;279 collections;280 dummy = 0;281 }282283 /// Set the collection access method.284 /// @param mode Access mode285 /// 0 for Normal286 /// 1 for AllowList287 /// @dev EVM selector for this function is: 0x41835d4c,288 /// or in textual repr: setCollectionAccess(uint8)289 function setCollectionAccess(uint8 mode) public {290 require(false, stub_error);291 mode;292 dummy = 0;293 }294295 /// Add the user to the allowed list.296 ///297 /// @param user Address of a trusted user.298 /// @dev EVM selector for this function is: 0x67844fe6,299 /// or in textual repr: addToCollectionAllowList(address)300 function addToCollectionAllowList(address user) public {301 require(false, stub_error);302 user;303 dummy = 0;304 }305306 /// Remove the user from the allowed list.307 ///308 /// @param user Address of a removed user.309 /// @dev EVM selector for this function is: 0x85c51acb,310 /// or in textual repr: removeFromCollectionAllowList(address)311 function removeFromCollectionAllowList(address user) public {312 require(false, stub_error);313 user;314 dummy = 0;315 }316317 /// Switch permission for minting.318 ///319 /// @param mode Enable if "true".320 /// @dev EVM selector for this function is: 0x00018e84,321 /// or in textual repr: setCollectionMintMode(bool)322 function setCollectionMintMode(bool mode) public {323 require(false, stub_error);324 mode;325 dummy = 0;326 }327328 /// Check that account is the owner or admin of the collection329 ///330 /// @param user account to verify331 /// @return "true" if account is the owner or admin332 /// @dev EVM selector for this function is: 0x9811b0c7,333 /// or in textual repr: isOwnerOrAdmin(address)334 function isOwnerOrAdmin(address user) public view returns (bool) {335 require(false, stub_error);336 user;337 dummy;338 return false;339 }340341 /// Check that substrate account is the owner or admin of the collection342 ///343 /// @param user account to verify344 /// @return "true" if account is the owner or admin345 /// @dev EVM selector for this function is: 0x68910e00,346 /// or in textual repr: isOwnerOrAdminSubstrate(uint256)347 function isOwnerOrAdminSubstrate(uint256 user) public view returns (bool) {348 require(false, stub_error);349 user;350 dummy;351 return false;352 }353354 /// Returns collection type355 ///356 /// @return `Fungible` or `NFT` or `ReFungible`357 /// @dev EVM selector for this function is: 0xd34b55b8,358 /// or in textual repr: uniqueCollectionType()359 function uniqueCollectionType() public returns (string memory) {360 require(false, stub_error);361 dummy = 0;362 return "";363 }364365 /// Changes collection owner to another account366 ///367 /// @dev Owner can be changed only by current owner368 /// @param newOwner new owner account369 /// @dev EVM selector for this function is: 0x13af4035,370 /// or in textual repr: setOwner(address)371 function setOwner(address newOwner) public {372 require(false, stub_error);373 newOwner;374 dummy = 0;375 }376377 /// Changes collection owner to another substrate account378 ///379 /// @dev Owner can be changed only by current owner380 /// @param newOwner new owner substrate account381 /// @dev EVM selector for this function is: 0xb212138f,382 /// or in textual repr: setOwnerSubstrate(uint256)383 function setOwnerSubstrate(uint256 newOwner) public {384 require(false, stub_error);385 newOwner;386 dummy = 0;387 }388}389390/// @title ERC721 Token that can be irreversibly burned (destroyed).391/// @dev the ERC-165 identifier for this interface is 0x42966c68392contract ERC721Burnable is Dummy, ERC165 {393 /// @notice Burns a specific ERC721 token.394 /// @dev Throws unless `msg.sender` is the current NFT owner, or an authorized395 /// operator of the current owner.396 /// @param tokenId The NFT to approve397 /// @dev EVM selector for this function is: 0x42966c68,398 /// or in textual repr: burn(uint256)399 function burn(uint256 tokenId) public {400 require(false, stub_error);401 tokenId;402 dummy = 0;403 }404}405406/// @dev inlined interface407contract ERC721MintableEvents {408 event MintingFinished();409}410411/// @title ERC721 minting logic.412/// @dev the ERC-165 identifier for this interface is 0x68ccfe89413contract ERC721Mintable is Dummy, ERC165, ERC721MintableEvents {414 /// @dev EVM selector for this function is: 0x05d2035b,415 /// or in textual repr: mintingFinished()416 function mintingFinished() public view returns (bool) {417 require(false, stub_error);418 dummy;419 return false;420 }421422 /// @notice Function to mint token.423 /// @dev `tokenId` should be obtained with `nextTokenId` method,424 /// unlike standard, you can't specify it manually425 /// @param to The new owner426 /// @param tokenId ID of the minted NFT427 /// @dev EVM selector for this function is: 0x40c10f19,428 /// or in textual repr: mint(address,uint256)429 function mint(address to, uint256 tokenId) public returns (bool) {430 require(false, stub_error);431 to;432 tokenId;433 dummy = 0;434 return false;435 }436437 /// @notice Function to mint token with the given tokenUri.438 /// @dev `tokenId` should be obtained with `nextTokenId` method,439 /// unlike standard, you can't specify it manually440 /// @param to The new owner441 /// @param tokenId ID of the minted NFT442 /// @param tokenUri Token URI that would be stored in the NFT properties443 /// @dev EVM selector for this function is: 0x50bb4e7f,444 /// or in textual repr: mintWithTokenURI(address,uint256,string)445 function mintWithTokenURI(446 address to,447 uint256 tokenId,448 string memory tokenUri449 ) public returns (bool) {450 require(false, stub_error);451 to;452 tokenId;453 tokenUri;454 dummy = 0;455 return false;456 }457458 /// @dev Not implemented459 /// @dev EVM selector for this function is: 0x7d64bcb4,460 /// or in textual repr: finishMinting()461 function finishMinting() public returns (bool) {462 require(false, stub_error);463 dummy = 0;464 return false;465 }466}467468/// @title Unique extensions for ERC721.469/// @dev the ERC-165 identifier for this interface is 0xd74d154f470contract ERC721UniqueExtensions is Dummy, ERC165 {471 /// @notice Transfer ownership of an NFT472 /// @dev Throws unless `msg.sender` is the current owner. Throws if `to`473 /// is the zero address. Throws if `tokenId` is not a valid NFT.474 /// @param to The new owner475 /// @param tokenId The NFT to transfer476 /// @dev EVM selector for this function is: 0xa9059cbb,477 /// or in textual repr: transfer(address,uint256)478 function transfer(address to, uint256 tokenId) public {479 require(false, stub_error);480 to;481 tokenId;482 dummy = 0;483 }484485 /// @notice Burns a specific ERC721 token.486 /// @dev Throws unless `msg.sender` is the current owner or an authorized487 /// operator for this NFT. Throws if `from` is not the current owner. Throws488 /// if `to` is the zero address. Throws if `tokenId` is not a valid NFT.489 /// @param from The current owner of the NFT490 /// @param tokenId The NFT to transfer491 /// @dev EVM selector for this function is: 0x79cc6790,492 /// or in textual repr: burnFrom(address,uint256)493 function burnFrom(address from, uint256 tokenId) public {494 require(false, stub_error);495 from;496 tokenId;497 dummy = 0;498 }499500 /// @notice Returns next free NFT ID.501 /// @dev EVM selector for this function is: 0x75794a3c,502 /// or in textual repr: nextTokenId()503 function nextTokenId() public view returns (uint256) {504 require(false, stub_error);505 dummy;506 return 0;507 }508509 /// @notice Function to mint multiple tokens.510 /// @dev `tokenIds` should be an array of consecutive numbers and first number511 /// should be obtained with `nextTokenId` method512 /// @param to The new owner513 /// @param tokenIds IDs of the minted NFTs514 /// @dev EVM selector for this function is: 0x44a9945e,515 /// or in textual repr: mintBulk(address,uint256[])516 function mintBulk(address to, uint256[] memory tokenIds)517 public518 returns (bool)519 {520 require(false, stub_error);521 to;522 tokenIds;523 dummy = 0;524 return false;525 }526527 /// @notice Function to mint multiple tokens with the given tokenUris.528 /// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive529 /// numbers and first number should be obtained with `nextTokenId` method530 /// @param to The new owner531 /// @param tokens array of pairs of token ID and token URI for minted tokens532 /// @dev EVM selector for this function is: 0x36543006,533 /// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[])534 function mintBulkWithTokenURI(address to, Tuple8[] memory tokens)535 public536 returns (bool)537 {538 require(false, stub_error);539 to;540 tokens;541 dummy = 0;542 return false;543 }544}545546/// @dev anonymous struct547struct Tuple8 {548 uint256 field_0;549 string field_1;550}551552/// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension553/// @dev See https://eips.ethereum.org/EIPS/eip-721554/// @dev the ERC-165 identifier for this interface is 0x780e9d63555contract ERC721Enumerable is Dummy, ERC165 {556 /// @notice Enumerate valid NFTs557 /// @param index A counter less than `totalSupply()`558 /// @return The token identifier for the `index`th NFT,559 /// (sort order not specified)560 /// @dev EVM selector for this function is: 0x4f6ccce7,561 /// or in textual repr: tokenByIndex(uint256)562 function tokenByIndex(uint256 index) public view returns (uint256) {563 require(false, stub_error);564 index;565 dummy;566 return 0;567 }568569 /// @dev Not implemented570 /// @dev EVM selector for this function is: 0x2f745c59,571 /// or in textual repr: tokenOfOwnerByIndex(address,uint256)572 function tokenOfOwnerByIndex(address owner, uint256 index)573 public574 view575 returns (uint256)576 {577 require(false, stub_error);578 owner;579 index;580 dummy;581 return 0;582 }583584 /// @notice Count NFTs tracked by this contract585 /// @return A count of valid NFTs tracked by this contract, where each one of586 /// them has an assigned and queryable owner not equal to the zero address587 /// @dev EVM selector for this function is: 0x18160ddd,588 /// or in textual repr: totalSupply()589 function totalSupply() public view returns (uint256) {590 require(false, stub_error);591 dummy;592 return 0;593 }594}595596/// @title ERC-721 Non-Fungible Token Standard, optional metadata extension597/// @dev See https://eips.ethereum.org/EIPS/eip-721598/// @dev the ERC-165 identifier for this interface is 0x5b5e139f599contract ERC721Metadata is Dummy, ERC165 {600 /// @notice A descriptive name for a collection of NFTs in this contract601 /// @dev EVM selector for this function is: 0x06fdde03,602 /// or in textual repr: name()603 function name() public view returns (string memory) {604 require(false, stub_error);605 dummy;606 return "";607 }608609 /// @notice An abbreviated name for NFTs in this contract610 /// @dev EVM selector for this function is: 0x95d89b41,611 /// or in textual repr: symbol()612 function symbol() public view returns (string memory) {613 require(false, stub_error);614 dummy;615 return "";616 }617618 /// @notice A distinct Uniform Resource Identifier (URI) for a given asset.619 ///620 /// @dev If the token has a `url` property and it is not empty, it is returned.621 /// 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`.622 /// If the collection property `baseURI` is empty or absent, return "" (empty string)623 /// otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix624 /// otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings).625 ///626 /// @return token's const_metadata627 /// @dev EVM selector for this function is: 0xc87b56dd,628 /// or in textual repr: tokenURI(uint256)629 function tokenURI(uint256 tokenId) public view returns (string memory) {630 require(false, stub_error);631 tokenId;632 dummy;633 return "";634 }635}636637/// @dev inlined interface31contract ERC721Events {638contract ERC721Events {32 event Transfer(639 event Transfer(33 address indexed from,640 address indexed from,46 );653 );47}654}4865549// Inline656/// @title ERC-721 Non-Fungible Token Standard50contract ERC721MintableEvents {657/// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md51 event MintingFinished();658/// @dev the ERC-165 identifier for this interface is 0x80ac58cd52}5354// Selector: 4136937755contract TokenProperties is Dummy, ERC165 {56 // @notice Set permissions for token property.57 // @dev Throws error if `msg.sender` is not admin or owner of the collection.58 // @param key Property key.59 // @param is_mutable Permission to mutate property.60 // @param collection_admin Permission to mutate property by collection admin if property is mutable.61 // @param token_owner Permission to mutate property by token owner if property is mutable.62 //63 // Selector: setTokenPropertyPermission(string,bool,bool,bool) 222d97fa64 function setTokenPropertyPermission(65 string memory key,66 bool isMutable,67 bool collectionAdmin,68 bool tokenOwner69 ) public {70 require(false, stub_error);71 key;72 isMutable;73 collectionAdmin;74 tokenOwner;75 dummy = 0;76 }7778 // @notice Set token property value.79 // @dev Throws error if `msg.sender` has no permission to edit the property.80 // @param tokenId ID of the token.81 // @param key Property key.82 // @param value Property value.83 //84 // Selector: setProperty(uint256,string,bytes) 1752d67b85 function setProperty(86 uint256 tokenId,87 string memory key,88 bytes memory value89 ) public {90 require(false, stub_error);91 tokenId;92 key;93 value;94 dummy = 0;95 }9697 // @notice Delete token property value.98 // @dev Throws error if `msg.sender` has no permission to edit the property.99 // @param tokenId ID of the token.100 // @param key Property key.101 //102 // Selector: deleteProperty(uint256,string) 066111d1103 function deleteProperty(uint256 tokenId, string memory key) public {104 require(false, stub_error);105 tokenId;106 key;107 dummy = 0;108 }109110 // @notice Get token property value.111 // @dev Throws error if key not found112 // @param tokenId ID of the token.113 // @param key Property key.114 // @return Property value bytes115 //116 // Selector: property(uint256,string) 7228c327117 function property(uint256 tokenId, string memory key)118 public119 view120 returns (bytes memory)121 {122 require(false, stub_error);123 tokenId;124 key;125 dummy;126 return hex"";127 }128}129130// Selector: 42966c68131contract ERC721Burnable is Dummy, ERC165 {132 // @notice Burns a specific ERC721 token.133 // @dev Throws unless `msg.sender` is the current NFT owner, or an authorized134 // operator of the current owner.135 // @param tokenId The NFT to approve136 //137 // Selector: burn(uint256) 42966c68138 function burn(uint256 tokenId) public {139 require(false, stub_error);140 tokenId;141 dummy = 0;142 }143}144145// Selector: 58800161146contract ERC721 is Dummy, ERC165, ERC721Events {659contract ERC721 is Dummy, ERC165, ERC721Events {147 // @notice Count all NFTs assigned to an owner660 /// @notice Count all NFTs assigned to an owner148 // @dev NFTs assigned to the zero address are considered invalid, and this661 /// @dev NFTs assigned to the zero address are considered invalid, and this149 // function throws for queries about the zero address.662 /// function throws for queries about the zero address.150 // @param owner An address for whom to query the balance663 /// @param owner An address for whom to query the balance151 // @return The number of NFTs owned by `owner`, possibly zero664 /// @return The number of NFTs owned by `owner`, possibly zero152 //665 /// @dev EVM selector for this function is: 0x70a08231,153 // Selector: balanceOf(address) 70a08231666 /// or in textual repr: balanceOf(address)154 function balanceOf(address owner) public view returns (uint256) {667 function balanceOf(address owner) public view returns (uint256) {155 require(false, stub_error);668 require(false, stub_error);156 owner;669 owner;157 dummy;670 dummy;158 return 0;671 return 0;159 }672 }160673161 // @notice Find the owner of an NFT674 /// @notice Find the owner of an NFT162 // @dev NFTs assigned to zero address are considered invalid, and queries675 /// @dev NFTs assigned to zero address are considered invalid, and queries163 // about them do throw.676 /// about them do throw.164 // @param tokenId The identifier for an NFT677 /// @param tokenId The identifier for an NFT165 // @return The address of the owner of the NFT678 /// @return The address of the owner of the NFT166 //679 /// @dev EVM selector for this function is: 0x6352211e,167 // Selector: ownerOf(uint256) 6352211e680 /// or in textual repr: ownerOf(uint256)168 function ownerOf(uint256 tokenId) public view returns (address) {681 function ownerOf(uint256 tokenId) public view returns (address) {169 require(false, stub_error);682 require(false, stub_error);170 tokenId;683 tokenId;171 dummy;684 dummy;172 return 0x0000000000000000000000000000000000000000;685 return 0x0000000000000000000000000000000000000000;173 }686 }174687175 // @dev Not implemented688 /// @dev Not implemented176 //689 /// @dev EVM selector for this function is: 0xb88d4fde,177 // Selector: safeTransferFromWithData(address,address,uint256,bytes) 60a11672690 /// or in textual repr: safeTransferFrom(address,address,uint256,bytes)178 function safeTransferFromWithData(691 function safeTransferFrom(179 address from,692 address from,180 address to,693 address to,181 uint256 tokenId,694 uint256 tokenId,189 dummy = 0;702 dummy = 0;190 }703 }191704192 // @dev Not implemented705 /// @dev Not implemented193 //706 /// @dev EVM selector for this function is: 0x42842e0e,194 // Selector: safeTransferFrom(address,address,uint256) 42842e0e707 /// or in textual repr: safeTransferFrom(address,address,uint256)195 function safeTransferFrom(708 function safeTransferFrom(196 address from,709 address from,197 address to,710 address to,204 dummy = 0;717 dummy = 0;205 }718 }206719207 // @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE720 /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE208 // TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE721 /// TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE209 // THEY MAY BE PERMANENTLY LOST722 /// THEY MAY BE PERMANENTLY LOST210 // @dev Throws unless `msg.sender` is the current owner or an authorized723 /// @dev Throws unless `msg.sender` is the current owner or an authorized211 // operator for this NFT. Throws if `from` is not the current owner. Throws724 /// operator for this NFT. Throws if `from` is not the current owner. Throws212 // if `to` is the zero address. Throws if `tokenId` is not a valid NFT.725 /// if `to` is the zero address. Throws if `tokenId` is not a valid NFT.213 // @param from The current owner of the NFT726 /// @param from The current owner of the NFT214 // @param to The new owner727 /// @param to The new owner215 // @param tokenId The NFT to transfer728 /// @param tokenId The NFT to transfer216 // @param _value Not used for an NFT729 /// @dev EVM selector for this function is: 0x23b872dd,217 //218 // Selector: transferFrom(address,address,uint256) 23b872dd730 /// or in textual repr: transferFrom(address,address,uint256)219 function transferFrom(731 function transferFrom(220 address from,732 address from,221 address to,733 address to,228 dummy = 0;740 dummy = 0;229 }741 }230742231 // @notice Set or reaffirm the approved address for an NFT743 /// @notice Set or reaffirm the approved address for an NFT232 // @dev The zero address indicates there is no approved address.744 /// @dev The zero address indicates there is no approved address.233 // @dev Throws unless `msg.sender` is the current NFT owner, or an authorized745 /// @dev Throws unless `msg.sender` is the current NFT owner, or an authorized234 // operator of the current owner.746 /// operator of the current owner.235 // @param approved The new approved NFT controller747 /// @param approved The new approved NFT controller236 // @param tokenId The NFT to approve748 /// @param tokenId The NFT to approve237 //749 /// @dev EVM selector for this function is: 0x095ea7b3,238 // Selector: approve(address,uint256) 095ea7b3750 /// or in textual repr: approve(address,uint256)239 function approve(address approved, uint256 tokenId) public {751 function approve(address approved, uint256 tokenId) public {240 require(false, stub_error);752 require(false, stub_error);241 approved;753 approved;242 tokenId;754 tokenId;243 dummy = 0;755 dummy = 0;244 }756 }245757246 // @dev Not implemented758 /// @dev Not implemented247 //759 /// @dev EVM selector for this function is: 0xa22cb465,248 // Selector: setApprovalForAll(address,bool) a22cb465760 /// or in textual repr: setApprovalForAll(address,bool)249 function setApprovalForAll(address operator, bool approved) public {761 function setApprovalForAll(address operator, bool approved) public {250 require(false, stub_error);762 require(false, stub_error);251 operator;763 operator;252 approved;764 approved;253 dummy = 0;765 dummy = 0;254 }766 }255767256 // @dev Not implemented768 /// @dev Not implemented257 //769 /// @dev EVM selector for this function is: 0x081812fc,258 // Selector: getApproved(uint256) 081812fc770 /// or in textual repr: getApproved(uint256)259 function getApproved(uint256 tokenId) public view returns (address) {771 function getApproved(uint256 tokenId) public view returns (address) {260 require(false, stub_error);772 require(false, stub_error);261 tokenId;773 tokenId;262 dummy;774 dummy;263 return 0x0000000000000000000000000000000000000000;775 return 0x0000000000000000000000000000000000000000;264 }776 }265777266 // @dev Not implemented778 /// @dev Not implemented267 //779 /// @dev EVM selector for this function is: 0xe985e9c5,268 // Selector: isApprovedForAll(address,address) e985e9c5780 /// or in textual repr: isApprovedForAll(address,address)269 function isApprovedForAll(address owner, address operator)781 function isApprovedForAll(address owner, address operator)270 public782 public271 view783 view279 }791 }280}792}281282// Selector: 5b5e139f283contract ERC721Metadata is Dummy, ERC165 {284 // @notice A descriptive name for a collection of NFTs in this contract285 //286 // Selector: name() 06fdde03287 function name() public view returns (string memory) {288 require(false, stub_error);289 dummy;290 return "";291 }292293 // @notice An abbreviated name for NFTs in this contract294 //295 // Selector: symbol() 95d89b41296 function symbol() public view returns (string memory) {297 require(false, stub_error);298 dummy;299 return "";300 }301302 // @notice A distinct Uniform Resource Identifier (URI) for a given asset.303 //304 // @dev If the token has a `url` property and it is not empty, it is returned.305 // 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`.306 // If the collection property `baseURI` is empty or absent, return "" (empty string)307 // otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix308 // otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings).309 //310 // @return token's const_metadata311 //312 // Selector: tokenURI(uint256) c87b56dd313 function tokenURI(uint256 tokenId) public view returns (string memory) {314 require(false, stub_error);315 tokenId;316 dummy;317 return "";318 }319}320321// Selector: 68ccfe89322contract ERC721Mintable is Dummy, ERC165, ERC721MintableEvents {323 // Selector: mintingFinished() 05d2035b324 function mintingFinished() public view returns (bool) {325 require(false, stub_error);326 dummy;327 return false;328 }329330 // @notice Function to mint token.331 // @dev `tokenId` should be obtained with `nextTokenId` method,332 // unlike standard, you can't specify it manually333 // @param to The new owner334 // @param tokenId ID of the minted NFT335 //336 // Selector: mint(address,uint256) 40c10f19337 function mint(address to, uint256 tokenId) public returns (bool) {338 require(false, stub_error);339 to;340 tokenId;341 dummy = 0;342 return false;343 }344345 // @notice Function to mint token with the given tokenUri.346 // @dev `tokenId` should be obtained with `nextTokenId` method,347 // unlike standard, you can't specify it manually348 // @param to The new owner349 // @param tokenId ID of the minted NFT350 // @param tokenUri Token URI that would be stored in the NFT properties351 //352 // Selector: mintWithTokenURI(address,uint256,string) 50bb4e7f353 function mintWithTokenURI(354 address to,355 uint256 tokenId,356 string memory tokenUri357 ) public returns (bool) {358 require(false, stub_error);359 to;360 tokenId;361 tokenUri;362 dummy = 0;363 return false;364 }365366 // @dev Not implemented367 //368 // Selector: finishMinting() 7d64bcb4369 function finishMinting() public returns (bool) {370 require(false, stub_error);371 dummy = 0;372 return false;373 }374}375376// Selector: 780e9d63377contract ERC721Enumerable is Dummy, ERC165 {378 // @notice Enumerate valid NFTs379 // @param index A counter less than `totalSupply()`380 // @return The token identifier for the `index`th NFT,381 // (sort order not specified)382 //383 // Selector: tokenByIndex(uint256) 4f6ccce7384 function tokenByIndex(uint256 index) public view returns (uint256) {385 require(false, stub_error);386 index;387 dummy;388 return 0;389 }390391 // @dev Not implemented392 //393 // Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59394 function tokenOfOwnerByIndex(address owner, uint256 index)395 public396 view397 returns (uint256)398 {399 require(false, stub_error);400 owner;401 index;402 dummy;403 return 0;404 }405406 // @notice Count NFTs tracked by this contract407 // @return A count of valid NFTs tracked by this contract, where each one of408 // them has an assigned and queryable owner not equal to the zero address409 //410 // Selector: totalSupply() 18160ddd411 function totalSupply() public view returns (uint256) {412 require(false, stub_error);413 dummy;414 return 0;415 }416}417418// Selector: d74d154f419contract ERC721UniqueExtensions is Dummy, ERC165 {420 // @notice Transfer ownership of an NFT421 // @dev Throws unless `msg.sender` is the current owner. Throws if `to`422 // is the zero address. Throws if `tokenId` is not a valid NFT.423 // @param to The new owner424 // @param tokenId The NFT to transfer425 // @param _value Not used for an NFT426 //427 // Selector: transfer(address,uint256) a9059cbb428 function transfer(address to, uint256 tokenId) public {429 require(false, stub_error);430 to;431 tokenId;432 dummy = 0;433 }434435 // @notice Burns a specific ERC721 token.436 // @dev Throws unless `msg.sender` is the current owner or an authorized437 // operator for this NFT. Throws if `from` is not the current owner. Throws438 // if `to` is the zero address. Throws if `tokenId` is not a valid NFT.439 // @param from The current owner of the NFT440 // @param tokenId The NFT to transfer441 // @param _value Not used for an NFT442 //443 // Selector: burnFrom(address,uint256) 79cc6790444 function burnFrom(address from, uint256 tokenId) public {445 require(false, stub_error);446 from;447 tokenId;448 dummy = 0;449 }450451 // @notice Returns next free NFT ID.452 //453 // Selector: nextTokenId() 75794a3c454 function nextTokenId() public view returns (uint256) {455 require(false, stub_error);456 dummy;457 return 0;458 }459460 // @notice Function to mint multiple tokens.461 // @dev `tokenIds` should be an array of consecutive numbers and first number462 // should be obtained with `nextTokenId` method463 // @param to The new owner464 // @param tokenIds IDs of the minted NFTs465 //466 // Selector: mintBulk(address,uint256[]) 44a9945e467 function mintBulk(address to, uint256[] memory tokenIds)468 public469 returns (bool)470 {471 require(false, stub_error);472 to;473 tokenIds;474 dummy = 0;475 return false;476 }477478 // @notice Function to mint multiple tokens with the given tokenUris.479 // @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive480 // numbers and first number should be obtained with `nextTokenId` method481 // @param to The new owner482 // @param tokens array of pairs of token ID and token URI for minted tokens483 //484 // Selector: mintBulkWithTokenURI(address,(uint256,string)[]) 36543006485 function mintBulkWithTokenURI(address to, Tuple0[] memory tokens)486 public487 returns (bool)488 {489 require(false, stub_error);490 to;491 tokens;492 dummy = 0;493 return false;494 }495}496497// Selector: ffe4da23498contract 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) 2f073f66505 function setCollectionProperty(string memory key, bytes memory value)506 public507 {508 require(false, stub_error);509 key;510 value;511 dummy = 0;512 }513514 // Delete collection property.515 //516 // @param key Property key.517 //518 // Selector: deleteCollectionProperty(string) 7b7debce519 function deleteCollectionProperty(string memory key) public {520 require(false, stub_error);521 key;522 dummy = 0;523 }524525 // 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) cf24fd6d533 function collectionProperty(string memory key)534 public535 view536 returns (bytes memory)537 {538 require(false, stub_error);539 key;540 dummy;541 return hex"";542 }543544 // 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) 7623402e551 function setCollectionSponsor(address sponsor) public {552 require(false, stub_error);553 sponsor;554 dummy = 0;555 }556557 // Collection sponsorship confirmation.558 //559 // @dev After setting the sponsor for the collection, it must be confirmed with this function.560 //561 // Selector: confirmCollectionSponsorship() 3c50e97a562 function confirmCollectionSponsorship() public {563 require(false, stub_error);564 dummy = 0;565 }566567 // 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) 6a3841db579 function setCollectionLimit(string memory limit, uint32 value) public {580 require(false, stub_error);581 limit;582 value;583 dummy = 0;584 }585586 // 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) 993b7fba595 function setCollectionLimit(string memory limit, bool value) public {596 require(false, stub_error);597 limit;598 value;599 dummy = 0;600 }601602 // Get contract address.603 //604 // Selector: contractAddress() f6b4dfb4605 function contractAddress() public view returns (address) {606 require(false, stub_error);607 dummy;608 return 0x0000000000000000000000000000000000000000;609 }610611 // Add collection admin by substrate address.612 // @param new_admin Substrate administrator address.613 //614 // Selector: addCollectionAdminSubstrate(uint256) 5730062b615 function addCollectionAdminSubstrate(uint256 newAdmin) public {616 require(false, stub_error);617 newAdmin;618 dummy = 0;619 }620621 // Remove collection admin by substrate address.622 // @param admin Substrate administrator address.623 //624 // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9625 function removeCollectionAdminSubstrate(uint256 admin) public {626 require(false, stub_error);627 admin;628 dummy = 0;629 }630631 // Add collection admin.632 // @param new_admin Address of the added administrator.633 //634 // Selector: addCollectionAdmin(address) 92e462c7635 function addCollectionAdmin(address newAdmin) public {636 require(false, stub_error);637 newAdmin;638 dummy = 0;639 }640641 // Remove collection admin.642 //643 // @param new_admin Address of the removed administrator.644 //645 // Selector: removeCollectionAdmin(address) fafd7b42646 function removeCollectionAdmin(address admin) public {647 require(false, stub_error);648 admin;649 dummy = 0;650 }651652 // Toggle accessibility of collection nesting.653 //654 // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'655 //656 // Selector: setCollectionNesting(bool) 112d4586657 function setCollectionNesting(bool enable) public {658 require(false, stub_error);659 enable;660 dummy = 0;661 }662663 // 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[]) 64872396669 function setCollectionNesting(bool enable, address[] memory collections)670 public671 {672 require(false, stub_error);673 enable;674 collections;675 dummy = 0;676 }677678 // Set the collection access method.679 // @param mode Access mode680 // 0 for Normal681 // 1 for AllowList682 //683 // Selector: setCollectionAccess(uint8) 41835d4c684 function setCollectionAccess(uint8 mode) public {685 require(false, stub_error);686 mode;687 dummy = 0;688 }689690 // Add the user to the allowed list.691 //692 // @param user Address of a trusted user.693 //694 // Selector: addToCollectionAllowList(address) 67844fe6695 function addToCollectionAllowList(address user) public {696 require(false, stub_error);697 user;698 dummy = 0;699 }700701 // Remove the user from the allowed list.702 //703 // @param user Address of a removed user.704 //705 // Selector: removeFromCollectionAllowList(address) 85c51acb706 function removeFromCollectionAllowList(address user) public {707 require(false, stub_error);708 user;709 dummy = 0;710 }711712 // Switch permission for minting.713 //714 // @param mode Enable if "true".715 //716 // Selector: setCollectionMintMode(bool) 00018e84717 function setCollectionMintMode(bool mode) public {718 require(false, stub_error);719 mode;720 dummy = 0;721 }722723 // Check that account is the owner or admin of the collection724 //725 // @param user account to verify726 // @return "true" if account is the owner or admin727 //728 // Selector: isOwnerOrAdmin(address) 9811b0c7729 function isOwnerOrAdmin(address user) public view returns (bool) {730 require(false, stub_error);731 user;732 dummy;733 return false;734 }735736 // Check that substrate account is the owner or admin of the collection737 //738 // @param user account to verify739 // @return "true" if account is the owner or admin740 //741 // Selector: isOwnerOrAdminSubstrate(uint256) 68910e00742 function isOwnerOrAdminSubstrate(uint256 user) public view returns (bool) {743 require(false, stub_error);744 user;745 dummy;746 return false;747 }748749 // Returns collection type750 //751 // @return `Fungible` or `NFT` or `ReFungible`752 //753 // Selector: uniqueCollectionType() d34b55b8754 function uniqueCollectionType() public returns (string memory) {755 require(false, stub_error);756 dummy = 0;757 return "";758 }759760 // Changes collection owner to another account761 //762 // @dev Owner can be changed only by current owner763 // @param newOwner new owner account764 //765 // Selector: setOwner(address) 13af4035766 function setOwner(address newOwner) public {767 require(false, stub_error);768 newOwner;769 dummy = 0;770 }771772 // Changes collection owner to another substrate account773 //774 // @dev Owner can be changed only by current owner775 // @param newOwner new owner substrate account776 //777 // Selector: setOwnerSubstrate(uint256) b212138f778 function setOwnerSubstrate(uint256 newOwner) public {779 require(false, stub_error);780 newOwner;781 dummy = 0;782 }783}784793785contract UniqueNFT is794contract UniqueNFT is786 Dummy,795 Dummy,pallets/refungible/src/erc.rsdiffbeforeafterboth53pub const ADDRESS_FOR_PARTIALLY_OWNED_TOKENS: H160 = H160::repeat_byte(0xff);53pub const ADDRESS_FOR_PARTIALLY_OWNED_TOKENS: H160 = H160::repeat_byte(0xff);545455/// @title A contract that allows to set and delete token properties and change token property permissions.55/// @title A contract that allows to set and delete token properties and change token property permissions.56#[solidity_interface(name = "TokenProperties")]56#[solidity_interface(name = TokenProperties)]57impl<T: Config> RefungibleHandle<T> {57impl<T: Config> RefungibleHandle<T> {58 /// @notice Set permissions for token property.58 /// @notice Set permissions for token property.59 /// @dev Throws error if `msg.sender` is not admin or owner of the collection.59 /// @dev Throws error if `msg.sender` is not admin or owner of the collection.60 /// @param key Property key.60 /// @param key Property key.61 /// @param is_mutable Permission to mutate property.61 /// @param isMutable Permission to mutate property.62 /// @param collection_admin Permission to mutate property by collection admin if property is mutable.62 /// @param collectionAdmin Permission to mutate property by collection admin if property is mutable.63 /// @param token_owner Permission to mutate property by token owner if property is mutable.63 /// @param tokenOwner Permission to mutate property by token owner if property is mutable.64 fn set_token_property_permission(64 fn set_token_property_permission(65 &mut self,65 &mut self,66 caller: caller,66 caller: caller,197 MintingFinished {},197 MintingFinished {},198}198}199199200#[solidity_interface(name = "ERC721Metadata")]200#[solidity_interface(name = ERC721Metadata)]201impl<T: Config> RefungibleHandle<T> {201impl<T: Config> RefungibleHandle<T> {202 /// @notice A descriptive name for a collection of RFTs in this contract202 /// @notice A descriptive name for a collection of RFTs in this contract203 fn name(&self) -> Result<string> {203 fn name(&self) -> Result<string> {258258259/// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension259/// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension260/// @dev See https://eips.ethereum.org/EIPS/eip-721260/// @dev See https://eips.ethereum.org/EIPS/eip-721261#[solidity_interface(name = "ERC721Enumerable")]261#[solidity_interface(name = ERC721Enumerable)]262impl<T: Config> RefungibleHandle<T> {262impl<T: Config> RefungibleHandle<T> {263 /// @notice Enumerate valid RFTs263 /// @notice Enumerate valid RFTs264 /// @param index A counter less than `totalSupply()`264 /// @param index A counter less than `totalSupply()`285285286/// @title ERC-721 Non-Fungible Token Standard286/// @title ERC-721 Non-Fungible Token Standard287/// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md287/// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md288#[solidity_interface(name = "ERC721", events(ERC721Events))]288#[solidity_interface(name = ERC721, events(ERC721Events))]289impl<T: Config> RefungibleHandle<T> {289impl<T: Config> RefungibleHandle<T> {290 /// @notice Count all RFTs assigned to an owner290 /// @notice Count all RFTs assigned to an owner291 /// @dev RFTs assigned to the zero address are considered invalid, and this291 /// @dev RFTs assigned to the zero address are considered invalid, and this322 _to: address,322 _to: address,323 _token_id: uint256,323 _token_id: uint256,324 _data: bytes,324 _data: bytes,325 _value: value,326 ) -> Result<void> {325 ) -> Result<void> {327 // TODO: Not implemetable326 // TODO: Not implemetable328 Err("not implemented".into())327 Err("not implemented".into())334 _from: address,333 _from: address,335 _to: address,334 _to: address,336 _token_id: uint256,335 _token_id: uint256,337 _value: value,338 ) -> Result<void> {336 ) -> Result<void> {339 // TODO: Not implemetable337 // TODO: Not implemetable340 Err("not implemented".into())338 Err("not implemented".into())350 /// @param from The current owner of the NFT348 /// @param from The current owner of the NFT351 /// @param to The new owner349 /// @param to The new owner352 /// @param tokenId The NFT to transfer350 /// @param tokenId The NFT to transfer353 /// @param _value Not used for an NFT354 #[weight(<SelfWeightOf<T>>::transfer_from_creating_removing())]351 #[weight(<SelfWeightOf<T>>::transfer_from_creating_removing())]355 fn transfer_from(352 fn transfer_from(356 &mut self,353 &mut self,357 caller: caller,354 caller: caller,358 from: address,355 from: address,359 to: address,356 to: address,360 token_id: uint256,357 token_id: uint256,361 _value: value,362 ) -> Result<void> {358 ) -> Result<void> {363 let caller = T::CrossAccountId::from_eth(caller);359 let caller = T::CrossAccountId::from_eth(caller);364 let from = T::CrossAccountId::from_eth(from);360 let from = T::CrossAccountId::from_eth(from);382 &mut self,383 _caller: caller,384 _approved: address,385 _token_id: uint256,386 _value: value,387 ) -> Result<void> {388 Err("not implemented".into())378 Err("not implemented".into())389 }379 }438}428}439429440/// @title ERC721 Token that can be irreversibly burned (destroyed).430/// @title ERC721 Token that can be irreversibly burned (destroyed).441#[solidity_interface(name = "ERC721Burnable")]431#[solidity_interface(name = ERC721Burnable)]442impl<T: Config> RefungibleHandle<T> {432impl<T: Config> RefungibleHandle<T> {443 /// @notice Burns a specific ERC721 token.433 /// @notice Burns a specific ERC721 token.444 /// @dev Throws unless `msg.sender` is the current RFT owner, or an authorized434 /// @dev Throws unless `msg.sender` is the current RFT owner, or an authorized458}448}459449460/// @title ERC721 minting logic.450/// @title ERC721 minting logic.461#[solidity_interface(name = "ERC721Mintable", events(ERC721MintableEvents))]451#[solidity_interface(name = ERC721Mintable, events(ERC721MintableEvents))]462impl<T: Config> RefungibleHandle<T> {452impl<T: Config> RefungibleHandle<T> {463 fn minting_finished(&self) -> Result<bool> {453 fn minting_finished(&self) -> Result<bool> {464 Ok(false)454 Ok(false)616}606}617607618/// @title Unique extensions for ERC721.608/// @title Unique extensions for ERC721.619#[solidity_interface(name = "ERC721UniqueExtensions")]609#[solidity_interface(name = ERC721UniqueExtensions)]620impl<T: Config> RefungibleHandle<T> {610impl<T: Config> RefungibleHandle<T> {621 /// @notice Transfer ownership of an RFT611 /// @notice Transfer ownership of an RFT622 /// @dev Throws unless `msg.sender` is the current owner. Throws if `to`612 /// @dev Throws unless `msg.sender` is the current owner. Throws if `to`623 /// is the zero address. Throws if `tokenId` is not a valid RFT.613 /// is the zero address. Throws if `tokenId` is not a valid RFT.624 /// Throws if RFT pieces have multiple owners.614 /// Throws if RFT pieces have multiple owners.625 /// @param to The new owner615 /// @param to The new owner626 /// @param tokenId The RFT to transfer616 /// @param tokenId The RFT to transfer627 /// @param _value Not used for an RFT628 #[weight(<SelfWeightOf<T>>::transfer_creating_removing())]617 #[weight(<SelfWeightOf<T>>::transfer_creating_removing())]629 fn transfer(618 fn transfer(&mut self, caller: caller, to: address, token_id: uint256) -> Result<void> {630 &mut self,631 caller: caller,632 to: address,633 token_id: uint256,634 _value: value,635 ) -> Result<void> {636 let caller = T::CrossAccountId::from_eth(caller);619 let caller = T::CrossAccountId::from_eth(caller);637 let to = T::CrossAccountId::from_eth(to);620 let to = T::CrossAccountId::from_eth(to);655 /// Throws if RFT pieces have multiple owners.638 /// Throws if RFT pieces have multiple owners.656 /// @param from The current owner of the RFT639 /// @param from The current owner of the RFT657 /// @param tokenId The RFT to transfer640 /// @param tokenId The RFT to transfer658 /// @param _value Not used for an RFT659 #[weight(<SelfWeightOf<T>>::burn_from())]641 #[weight(<SelfWeightOf<T>>::burn_from())]660 fn burn_from(642 fn burn_from(&mut self, caller: caller, from: address, token_id: uint256) -> Result<void> {661 &mut self,662 caller: caller,663 from: address,664 token_id: uint256,665 _value: value,666 ) -> Result<void> {667 let caller = T::CrossAccountId::from_eth(caller);643 let caller = T::CrossAccountId::from_eth(caller);668 let from = T::CrossAccountId::from_eth(from);644 let from = T::CrossAccountId::from_eth(from);801}777}802778803#[solidity_interface(779#[solidity_interface(804 name = "UniqueRefungible",780 name = UniqueRefungible,805 is(781 is(806 ERC721,782 ERC721,807 ERC721Metadata,783 ERC721Metadata,808 ERC721Enumerable,784 ERC721Enumerable,809 ERC721UniqueExtensions,785 ERC721UniqueExtensions,810 ERC721Mintable,786 ERC721Mintable,811 ERC721Burnable,787 ERC721Burnable,812 via("CollectionHandle<T>", common_mut, Collection),788 Collection(common_mut, CollectionHandle<T>),813 TokenProperties,789 TokenProperties,814 )790 )815)]791)]pallets/refungible/src/erc_token.rsdiffbeforeafterboth494950pub struct RefungibleTokenHandle<T: Config>(pub RefungibleHandle<T>, pub TokenId);50pub struct RefungibleTokenHandle<T: Config>(pub RefungibleHandle<T>, pub TokenId);515152#[solidity_interface(name = "ERC1633")]52#[solidity_interface(name = ERC1633)]53impl<T: Config> RefungibleTokenHandle<T> {53impl<T: Config> RefungibleTokenHandle<T> {54 fn parent_token(&self) -> Result<address> {54 fn parent_token(&self) -> Result<address> {55 self.consume_store_reads(2)?;55 self.consume_store_reads(2)?;87 }87 }88}88}898990#[solidity_interface(name = "ERC1633UniqueExtensions")]90#[solidity_interface(name = ERC1633UniqueExtensions)]91impl<T: Config> RefungibleTokenHandle<T> {91impl<T: Config> RefungibleTokenHandle<T> {92 #[solidity(rename_selector = "setParentNFT")]92 #[solidity(rename_selector = "setParentNFT")]93 #[weight(<CommonWeights<T>>::token_owner() + <SelfWeightOf<T>>::set_parent_nft_unchecked())]93 #[weight(<CommonWeights<T>>::token_owner() + <SelfWeightOf<T>>::set_parent_nft_unchecked())]137///137///138/// @dev Implementation of the basic standard token.138/// @dev Implementation of the basic standard token.139/// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md139/// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md140#[solidity_interface(name = "ERC20", events(ERC20Events))]140#[solidity_interface(name = ERC20, events(ERC20Events))]141impl<T: Config> RefungibleTokenHandle<T> {141impl<T: Config> RefungibleTokenHandle<T> {142 /// @return the name of the token.142 /// @return the name of the token.143 fn name(&self) -> Result<string> {143 fn name(&self) -> Result<string> {246 }246 }247}247}248248249#[solidity_interface(name = "ERC20UniqueExtensions")]249#[solidity_interface(name = ERC20UniqueExtensions)]250impl<T: Config> RefungibleTokenHandle<T> {250impl<T: Config> RefungibleTokenHandle<T> {251 /// @dev Function that burns an amount of the token of a given account,251 /// @dev Function that burns an amount of the token of a given account,252 /// deducting from the sender's allowance for said account.252 /// deducting from the sender's allowance for said account.306}306}307307308#[solidity_interface(308#[solidity_interface(309 name = "UniqueRefungibleToken",309 name = UniqueRefungibleToken,310 is(ERC20, ERC20UniqueExtensions, ERC1633, ERC1633UniqueExtensions)310 is(ERC20, ERC20UniqueExtensions, ERC1633, ERC1633UniqueExtensions)311)]311)]312impl<T: Config> RefungibleTokenHandle<T> where T::AccountId: From<[u8; 32]> {}312impl<T: Config> RefungibleTokenHandle<T> where T::AccountId: From<[u8; 32]> {}pallets/refungible/src/stubs/UniqueRefungible.rawdiffbeforeafterbothbinary blob — no preview
pallets/refungible/src/stubs/UniqueRefungible.soldiffbeforeafterboth334pragma solidity >=0.8.0 <0.9.0;4pragma solidity >=0.8.0 <0.9.0;56// Anonymous struct7struct Tuple0 {8 uint256 field_0;9 string field_1;10}11512// Common stubs holder6/// @dev common stubs holder13contract Dummy {7contract Dummy {14 uint8 dummy;8 uint8 dummy;15 string stub_error = "this contract is implemented in native";9 string stub_error = "this contract is implemented in native";27 }21 }28}22}292330// Inline24/// @title A contract that allows to set and delete token properties and change token property permissions.25/// @dev the ERC-165 identifier for this interface is 0x4136937726contract TokenProperties is Dummy, ERC165 {27 /// @notice Set permissions for token property.28 /// @dev Throws error if `msg.sender` is not admin or owner of the collection.29 /// @param key Property key.30 /// @param isMutable Permission to mutate property.31 /// @param collectionAdmin Permission to mutate property by collection admin if property is mutable.32 /// @param tokenOwner Permission to mutate property by token owner if property is mutable.33 /// @dev EVM selector for this function is: 0x222d97fa,34 /// or in textual repr: setTokenPropertyPermission(string,bool,bool,bool)35 function setTokenPropertyPermission(36 string memory key,37 bool isMutable,38 bool collectionAdmin,39 bool tokenOwner40 ) public {41 require(false, stub_error);42 key;43 isMutable;44 collectionAdmin;45 tokenOwner;46 dummy = 0;47 }4849 /// @notice Set token property value.50 /// @dev Throws error if `msg.sender` has no permission to edit the property.51 /// @param tokenId ID of the token.52 /// @param key Property key.53 /// @param value Property value.54 /// @dev EVM selector for this function is: 0x1752d67b,55 /// or in textual repr: setProperty(uint256,string,bytes)56 function setProperty(57 uint256 tokenId,58 string memory key,59 bytes memory value60 ) public {61 require(false, stub_error);62 tokenId;63 key;64 value;65 dummy = 0;66 }6768 /// @notice Delete token property value.69 /// @dev Throws error if `msg.sender` has no permission to edit the property.70 /// @param tokenId ID of the token.71 /// @param key Property key.72 /// @dev EVM selector for this function is: 0x066111d1,73 /// or in textual repr: deleteProperty(uint256,string)74 function deleteProperty(uint256 tokenId, string memory key) public {75 require(false, stub_error);76 tokenId;77 key;78 dummy = 0;79 }8081 /// @notice Get token property value.82 /// @dev Throws error if key not found83 /// @param tokenId ID of the token.84 /// @param key Property key.85 /// @return Property value bytes86 /// @dev EVM selector for this function is: 0x7228c327,87 /// or in textual repr: property(uint256,string)88 function property(uint256 tokenId, string memory key)89 public90 view91 returns (bytes memory)92 {93 require(false, stub_error);94 tokenId;95 key;96 dummy;97 return hex"";98 }99}100101/// @title A contract that allows you to work with collections.102/// @dev the ERC-165 identifier for this interface is 0xffe4da23103contract Collection is Dummy, ERC165 {104 /// Set collection property.105 ///106 /// @param key Property key.107 /// @param value Propery value.108 /// @dev EVM selector for this function is: 0x2f073f66,109 /// or in textual repr: setCollectionProperty(string,bytes)110 function setCollectionProperty(string memory key, bytes memory value)111 public112 {113 require(false, stub_error);114 key;115 value;116 dummy = 0;117 }118119 /// Delete collection property.120 ///121 /// @param key Property key.122 /// @dev EVM selector for this function is: 0x7b7debce,123 /// or in textual repr: deleteCollectionProperty(string)124 function deleteCollectionProperty(string memory key) public {125 require(false, stub_error);126 key;127 dummy = 0;128 }129130 /// Get collection property.131 ///132 /// @dev Throws error if key not found.133 ///134 /// @param key Property key.135 /// @return bytes The property corresponding to the key.136 /// @dev EVM selector for this function is: 0xcf24fd6d,137 /// or in textual repr: collectionProperty(string)138 function collectionProperty(string memory key)139 public140 view141 returns (bytes memory)142 {143 require(false, stub_error);144 key;145 dummy;146 return hex"";147 }148149 /// Set the sponsor of the collection.150 ///151 /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.152 ///153 /// @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.154 /// @dev EVM selector for this function is: 0x7623402e,155 /// or in textual repr: setCollectionSponsor(address)156 function setCollectionSponsor(address sponsor) public {157 require(false, stub_error);158 sponsor;159 dummy = 0;160 }161162 /// Collection sponsorship confirmation.163 ///164 /// @dev After setting the sponsor for the collection, it must be confirmed with this function.165 /// @dev EVM selector for this function is: 0x3c50e97a,166 /// or in textual repr: confirmCollectionSponsorship()167 function confirmCollectionSponsorship() public {168 require(false, stub_error);169 dummy = 0;170 }171172 /// Set limits for the collection.173 /// @dev Throws error if limit not found.174 /// @param limit Name of the limit. Valid names:175 /// "accountTokenOwnershipLimit",176 /// "sponsoredDataSize",177 /// "sponsoredDataRateLimit",178 /// "tokenLimit",179 /// "sponsorTransferTimeout",180 /// "sponsorApproveTimeout"181 /// @param value Value of the limit.182 /// @dev EVM selector for this function is: 0x6a3841db,183 /// or in textual repr: setCollectionLimit(string,uint32)184 function setCollectionLimit(string memory limit, uint32 value) public {185 require(false, stub_error);186 limit;187 value;188 dummy = 0;189 }190191 /// Set limits for the collection.192 /// @dev Throws error if limit not found.193 /// @param limit Name of the limit. Valid names:194 /// "ownerCanTransfer",195 /// "ownerCanDestroy",196 /// "transfersEnabled"197 /// @param value Value of the limit.198 /// @dev EVM selector for this function is: 0x993b7fba,199 /// or in textual repr: setCollectionLimit(string,bool)200 function setCollectionLimit(string memory limit, bool value) public {201 require(false, stub_error);202 limit;203 value;204 dummy = 0;205 }206207 /// Get contract address.208 /// @dev EVM selector for this function is: 0xf6b4dfb4,209 /// or in textual repr: contractAddress()210 function contractAddress() public view returns (address) {211 require(false, stub_error);212 dummy;213 return 0x0000000000000000000000000000000000000000;214 }215216 /// Add collection admin by substrate address.217 /// @param newAdmin Substrate administrator address.218 /// @dev EVM selector for this function is: 0x5730062b,219 /// or in textual repr: addCollectionAdminSubstrate(uint256)220 function addCollectionAdminSubstrate(uint256 newAdmin) public {221 require(false, stub_error);222 newAdmin;223 dummy = 0;224 }225226 /// Remove collection admin by substrate address.227 /// @param admin Substrate administrator address.228 /// @dev EVM selector for this function is: 0x4048fcf9,229 /// or in textual repr: removeCollectionAdminSubstrate(uint256)230 function removeCollectionAdminSubstrate(uint256 admin) public {231 require(false, stub_error);232 admin;233 dummy = 0;234 }235236 /// Add collection admin.237 /// @param newAdmin Address of the added administrator.238 /// @dev EVM selector for this function is: 0x92e462c7,239 /// or in textual repr: addCollectionAdmin(address)240 function addCollectionAdmin(address newAdmin) public {241 require(false, stub_error);242 newAdmin;243 dummy = 0;244 }245246 /// Remove collection admin.247 ///248 /// @param admin Address of the removed administrator.249 /// @dev EVM selector for this function is: 0xfafd7b42,250 /// or in textual repr: removeCollectionAdmin(address)251 function removeCollectionAdmin(address admin) public {252 require(false, stub_error);253 admin;254 dummy = 0;255 }256257 /// Toggle accessibility of collection nesting.258 ///259 /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'260 /// @dev EVM selector for this function is: 0x112d4586,261 /// or in textual repr: setCollectionNesting(bool)262 function setCollectionNesting(bool enable) public {263 require(false, stub_error);264 enable;265 dummy = 0;266 }267268 /// Toggle accessibility of collection nesting.269 ///270 /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'271 /// @param collections Addresses of collections that will be available for nesting.272 /// @dev EVM selector for this function is: 0x64872396,273 /// or in textual repr: setCollectionNesting(bool,address[])274 function setCollectionNesting(bool enable, address[] memory collections)275 public276 {277 require(false, stub_error);278 enable;279 collections;280 dummy = 0;281 }282283 /// Set the collection access method.284 /// @param mode Access mode285 /// 0 for Normal286 /// 1 for AllowList287 /// @dev EVM selector for this function is: 0x41835d4c,288 /// or in textual repr: setCollectionAccess(uint8)289 function setCollectionAccess(uint8 mode) public {290 require(false, stub_error);291 mode;292 dummy = 0;293 }294295 /// Add the user to the allowed list.296 ///297 /// @param user Address of a trusted user.298 /// @dev EVM selector for this function is: 0x67844fe6,299 /// or in textual repr: addToCollectionAllowList(address)300 function addToCollectionAllowList(address user) public {301 require(false, stub_error);302 user;303 dummy = 0;304 }305306 /// Remove the user from the allowed list.307 ///308 /// @param user Address of a removed user.309 /// @dev EVM selector for this function is: 0x85c51acb,310 /// or in textual repr: removeFromCollectionAllowList(address)311 function removeFromCollectionAllowList(address user) public {312 require(false, stub_error);313 user;314 dummy = 0;315 }316317 /// Switch permission for minting.318 ///319 /// @param mode Enable if "true".320 /// @dev EVM selector for this function is: 0x00018e84,321 /// or in textual repr: setCollectionMintMode(bool)322 function setCollectionMintMode(bool mode) public {323 require(false, stub_error);324 mode;325 dummy = 0;326 }327328 /// Check that account is the owner or admin of the collection329 ///330 /// @param user account to verify331 /// @return "true" if account is the owner or admin332 /// @dev EVM selector for this function is: 0x9811b0c7,333 /// or in textual repr: isOwnerOrAdmin(address)334 function isOwnerOrAdmin(address user) public view returns (bool) {335 require(false, stub_error);336 user;337 dummy;338 return false;339 }340341 /// Check that substrate account is the owner or admin of the collection342 ///343 /// @param user account to verify344 /// @return "true" if account is the owner or admin345 /// @dev EVM selector for this function is: 0x68910e00,346 /// or in textual repr: isOwnerOrAdminSubstrate(uint256)347 function isOwnerOrAdminSubstrate(uint256 user) public view returns (bool) {348 require(false, stub_error);349 user;350 dummy;351 return false;352 }353354 /// Returns collection type355 ///356 /// @return `Fungible` or `NFT` or `ReFungible`357 /// @dev EVM selector for this function is: 0xd34b55b8,358 /// or in textual repr: uniqueCollectionType()359 function uniqueCollectionType() public returns (string memory) {360 require(false, stub_error);361 dummy = 0;362 return "";363 }364365 /// Changes collection owner to another account366 ///367 /// @dev Owner can be changed only by current owner368 /// @param newOwner new owner account369 /// @dev EVM selector for this function is: 0x13af4035,370 /// or in textual repr: setOwner(address)371 function setOwner(address newOwner) public {372 require(false, stub_error);373 newOwner;374 dummy = 0;375 }376377 /// Changes collection owner to another substrate account378 ///379 /// @dev Owner can be changed only by current owner380 /// @param newOwner new owner substrate account381 /// @dev EVM selector for this function is: 0xb212138f,382 /// or in textual repr: setOwnerSubstrate(uint256)383 function setOwnerSubstrate(uint256 newOwner) public {384 require(false, stub_error);385 newOwner;386 dummy = 0;387 }388}389390/// @title ERC721 Token that can be irreversibly burned (destroyed).391/// @dev the ERC-165 identifier for this interface is 0x42966c68392contract ERC721Burnable is Dummy, ERC165 {393 /// @notice Burns a specific ERC721 token.394 /// @dev Throws unless `msg.sender` is the current RFT owner, or an authorized395 /// operator of the current owner.396 /// @param tokenId The RFT to approve397 /// @dev EVM selector for this function is: 0x42966c68,398 /// or in textual repr: burn(uint256)399 function burn(uint256 tokenId) public {400 require(false, stub_error);401 tokenId;402 dummy = 0;403 }404}405406/// @dev inlined interface407contract ERC721MintableEvents {408 event MintingFinished();409}410411/// @title ERC721 minting logic.412/// @dev the ERC-165 identifier for this interface is 0x68ccfe89413contract ERC721Mintable is Dummy, ERC165, ERC721MintableEvents {414 /// @dev EVM selector for this function is: 0x05d2035b,415 /// or in textual repr: mintingFinished()416 function mintingFinished() public view returns (bool) {417 require(false, stub_error);418 dummy;419 return false;420 }421422 /// @notice Function to mint token.423 /// @dev `tokenId` should be obtained with `nextTokenId` method,424 /// unlike standard, you can't specify it manually425 /// @param to The new owner426 /// @param tokenId ID of the minted RFT427 /// @dev EVM selector for this function is: 0x40c10f19,428 /// or in textual repr: mint(address,uint256)429 function mint(address to, uint256 tokenId) public returns (bool) {430 require(false, stub_error);431 to;432 tokenId;433 dummy = 0;434 return false;435 }436437 /// @notice Function to mint token with the given tokenUri.438 /// @dev `tokenId` should be obtained with `nextTokenId` method,439 /// unlike standard, you can't specify it manually440 /// @param to The new owner441 /// @param tokenId ID of the minted RFT442 /// @param tokenUri Token URI that would be stored in the RFT properties443 /// @dev EVM selector for this function is: 0x50bb4e7f,444 /// or in textual repr: mintWithTokenURI(address,uint256,string)445 function mintWithTokenURI(446 address to,447 uint256 tokenId,448 string memory tokenUri449 ) public returns (bool) {450 require(false, stub_error);451 to;452 tokenId;453 tokenUri;454 dummy = 0;455 return false;456 }457458 /// @dev Not implemented459 /// @dev EVM selector for this function is: 0x7d64bcb4,460 /// or in textual repr: finishMinting()461 function finishMinting() public returns (bool) {462 require(false, stub_error);463 dummy = 0;464 return false;465 }466}467468/// @title Unique extensions for ERC721.469/// @dev the ERC-165 identifier for this interface is 0x7c3bef89470contract ERC721UniqueExtensions is Dummy, ERC165 {471 /// @notice Transfer ownership of an RFT472 /// @dev Throws unless `msg.sender` is the current owner. Throws if `to`473 /// is the zero address. Throws if `tokenId` is not a valid RFT.474 /// Throws if RFT pieces have multiple owners.475 /// @param to The new owner476 /// @param tokenId The RFT to transfer477 /// @dev EVM selector for this function is: 0xa9059cbb,478 /// or in textual repr: transfer(address,uint256)479 function transfer(address to, uint256 tokenId) public {480 require(false, stub_error);481 to;482 tokenId;483 dummy = 0;484 }485486 /// @notice Burns a specific ERC721 token.487 /// @dev Throws unless `msg.sender` is the current owner or an authorized488 /// operator for this RFT. Throws if `from` is not the current owner. Throws489 /// if `to` is the zero address. Throws if `tokenId` is not a valid RFT.490 /// Throws if RFT pieces have multiple owners.491 /// @param from The current owner of the RFT492 /// @param tokenId The RFT to transfer493 /// @dev EVM selector for this function is: 0x79cc6790,494 /// or in textual repr: burnFrom(address,uint256)495 function burnFrom(address from, uint256 tokenId) public {496 require(false, stub_error);497 from;498 tokenId;499 dummy = 0;500 }501502 /// @notice Returns next free RFT ID.503 /// @dev EVM selector for this function is: 0x75794a3c,504 /// or in textual repr: nextTokenId()505 function nextTokenId() public view returns (uint256) {506 require(false, stub_error);507 dummy;508 return 0;509 }510511 /// @notice Function to mint multiple tokens.512 /// @dev `tokenIds` should be an array of consecutive numbers and first number513 /// should be obtained with `nextTokenId` method514 /// @param to The new owner515 /// @param tokenIds IDs of the minted RFTs516 /// @dev EVM selector for this function is: 0x44a9945e,517 /// or in textual repr: mintBulk(address,uint256[])518 function mintBulk(address to, uint256[] memory tokenIds)519 public520 returns (bool)521 {522 require(false, stub_error);523 to;524 tokenIds;525 dummy = 0;526 return false;527 }528529 /// @notice Function to mint multiple tokens with the given tokenUris.530 /// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive531 /// numbers and first number should be obtained with `nextTokenId` method532 /// @param to The new owner533 /// @param tokens array of pairs of token ID and token URI for minted tokens534 /// @dev EVM selector for this function is: 0x36543006,535 /// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[])536 function mintBulkWithTokenURI(address to, Tuple8[] memory tokens)537 public538 returns (bool)539 {540 require(false, stub_error);541 to;542 tokens;543 dummy = 0;544 return false;545 }546547 /// Returns EVM address for refungible token548 ///549 /// @param token ID of the token550 /// @dev EVM selector for this function is: 0xab76fac6,551 /// or in textual repr: tokenContractAddress(uint256)552 function tokenContractAddress(uint256 token) public view returns (address) {553 require(false, stub_error);554 token;555 dummy;556 return 0x0000000000000000000000000000000000000000;557 }558}559560/// @dev anonymous struct561struct Tuple8 {562 uint256 field_0;563 string field_1;564}565566/// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension567/// @dev See https://eips.ethereum.org/EIPS/eip-721568/// @dev the ERC-165 identifier for this interface is 0x780e9d63569contract ERC721Enumerable is Dummy, ERC165 {570 /// @notice Enumerate valid RFTs571 /// @param index A counter less than `totalSupply()`572 /// @return The token identifier for the `index`th NFT,573 /// (sort order not specified)574 /// @dev EVM selector for this function is: 0x4f6ccce7,575 /// or in textual repr: tokenByIndex(uint256)576 function tokenByIndex(uint256 index) public view returns (uint256) {577 require(false, stub_error);578 index;579 dummy;580 return 0;581 }582583 /// Not implemented584 /// @dev EVM selector for this function is: 0x2f745c59,585 /// or in textual repr: tokenOfOwnerByIndex(address,uint256)586 function tokenOfOwnerByIndex(address owner, uint256 index)587 public588 view589 returns (uint256)590 {591 require(false, stub_error);592 owner;593 index;594 dummy;595 return 0;596 }597598 /// @notice Count RFTs tracked by this contract599 /// @return A count of valid RFTs tracked by this contract, where each one of600 /// them has an assigned and queryable owner not equal to the zero address601 /// @dev EVM selector for this function is: 0x18160ddd,602 /// or in textual repr: totalSupply()603 function totalSupply() public view returns (uint256) {604 require(false, stub_error);605 dummy;606 return 0;607 }608}609610/// @dev the ERC-165 identifier for this interface is 0x5b5e139f611contract ERC721Metadata is Dummy, ERC165 {612 /// @notice A descriptive name for a collection of RFTs in this contract613 /// @dev EVM selector for this function is: 0x06fdde03,614 /// or in textual repr: name()615 function name() public view returns (string memory) {616 require(false, stub_error);617 dummy;618 return "";619 }620621 /// @notice An abbreviated name for RFTs in this contract622 /// @dev EVM selector for this function is: 0x95d89b41,623 /// or in textual repr: symbol()624 function symbol() public view returns (string memory) {625 require(false, stub_error);626 dummy;627 return "";628 }629630 /// @notice A distinct Uniform Resource Identifier (URI) for a given asset.631 ///632 /// @dev If the token has a `url` property and it is not empty, it is returned.633 /// 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`.634 /// If the collection property `baseURI` is empty or absent, return "" (empty string)635 /// otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix636 /// otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings).637 ///638 /// @return token's const_metadata639 /// @dev EVM selector for this function is: 0xc87b56dd,640 /// or in textual repr: tokenURI(uint256)641 function tokenURI(uint256 tokenId) public view returns (string memory) {642 require(false, stub_error);643 tokenId;644 dummy;645 return "";646 }647}648649/// @dev inlined interface31contract ERC721Events {650contract ERC721Events {32 event Transfer(651 event Transfer(33 address indexed from,652 address indexed from,46 );665 );47}666}4866749// Inline668/// @title ERC-721 Non-Fungible Token Standard50contract ERC721MintableEvents {669/// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md51 event MintingFinished();670/// @dev the ERC-165 identifier for this interface is 0x5880016152}5354// Selector: 4136937755contract TokenProperties is Dummy, ERC165 {56 // @notice Set permissions for token property.57 // @dev Throws error if `msg.sender` is not admin or owner of the collection.58 // @param key Property key.59 // @param is_mutable Permission to mutate property.60 // @param collection_admin Permission to mutate property by collection admin if property is mutable.61 // @param token_owner Permission to mutate property by token owner if property is mutable.62 //63 // Selector: setTokenPropertyPermission(string,bool,bool,bool) 222d97fa64 function setTokenPropertyPermission(65 string memory key,66 bool isMutable,67 bool collectionAdmin,68 bool tokenOwner69 ) public {70 require(false, stub_error);71 key;72 isMutable;73 collectionAdmin;74 tokenOwner;75 dummy = 0;76 }7778 // @notice Set token property value.79 // @dev Throws error if `msg.sender` has no permission to edit the property.80 // @param tokenId ID of the token.81 // @param key Property key.82 // @param value Property value.83 //84 // Selector: setProperty(uint256,string,bytes) 1752d67b85 function setProperty(86 uint256 tokenId,87 string memory key,88 bytes memory value89 ) public {90 require(false, stub_error);91 tokenId;92 key;93 value;94 dummy = 0;95 }9697 // @notice Delete token property value.98 // @dev Throws error if `msg.sender` has no permission to edit the property.99 // @param tokenId ID of the token.100 // @param key Property key.101 //102 // Selector: deleteProperty(uint256,string) 066111d1103 function deleteProperty(uint256 tokenId, string memory key) public {104 require(false, stub_error);105 tokenId;106 key;107 dummy = 0;108 }109110 // @notice Get token property value.111 // @dev Throws error if key not found112 // @param tokenId ID of the token.113 // @param key Property key.114 // @return Property value bytes115 //116 // Selector: property(uint256,string) 7228c327117 function property(uint256 tokenId, string memory key)118 public119 view120 returns (bytes memory)121 {122 require(false, stub_error);123 tokenId;124 key;125 dummy;126 return hex"";127 }128}129130// Selector: 42966c68131contract ERC721Burnable is Dummy, ERC165 {132 // @notice Burns a specific ERC721 token.133 // @dev Throws unless `msg.sender` is the current RFT owner, or an authorized134 // operator of the current owner.135 // @param tokenId The RFT to approve136 //137 // Selector: burn(uint256) 42966c68138 function burn(uint256 tokenId) public {139 require(false, stub_error);140 tokenId;141 dummy = 0;142 }143}144145// Selector: 58800161146contract ERC721 is Dummy, ERC165, ERC721Events {671contract ERC721 is Dummy, ERC165, ERC721Events {147 // @notice Count all RFTs assigned to an owner672 /// @notice Count all RFTs assigned to an owner148 // @dev RFTs assigned to the zero address are considered invalid, and this673 /// @dev RFTs assigned to the zero address are considered invalid, and this149 // function throws for queries about the zero address.674 /// function throws for queries about the zero address.150 // @param owner An address for whom to query the balance675 /// @param owner An address for whom to query the balance151 // @return The number of RFTs owned by `owner`, possibly zero676 /// @return The number of RFTs owned by `owner`, possibly zero152 //677 /// @dev EVM selector for this function is: 0x70a08231,153 // Selector: balanceOf(address) 70a08231678 /// or in textual repr: balanceOf(address)154 function balanceOf(address owner) public view returns (uint256) {679 function balanceOf(address owner) public view returns (uint256) {155 require(false, stub_error);680 require(false, stub_error);156 owner;681 owner;157 dummy;682 dummy;158 return 0;683 return 0;159 }684 }160685161 // @notice Find the owner of an RFT686 /// @notice Find the owner of an RFT162 // @dev RFTs assigned to zero address are considered invalid, and queries687 /// @dev RFTs assigned to zero address are considered invalid, and queries163 // about them do throw.688 /// about them do throw.164 // Returns special 0xffffffffffffffffffffffffffffffffffffffff address for689 /// Returns special 0xffffffffffffffffffffffffffffffffffffffff address for165 // the tokens that are partially owned.690 /// the tokens that are partially owned.166 // @param tokenId The identifier for an RFT691 /// @param tokenId The identifier for an RFT167 // @return The address of the owner of the RFT692 /// @return The address of the owner of the RFT168 //693 /// @dev EVM selector for this function is: 0x6352211e,169 // Selector: ownerOf(uint256) 6352211e694 /// or in textual repr: ownerOf(uint256)170 function ownerOf(uint256 tokenId) public view returns (address) {695 function ownerOf(uint256 tokenId) public view returns (address) {171 require(false, stub_error);696 require(false, stub_error);172 tokenId;697 tokenId;173 dummy;698 dummy;174 return 0x0000000000000000000000000000000000000000;699 return 0x0000000000000000000000000000000000000000;175 }700 }176701177 // @dev Not implemented702 /// @dev Not implemented178 //703 /// @dev EVM selector for this function is: 0x60a11672,179 // Selector: safeTransferFromWithData(address,address,uint256,bytes) 60a11672704 /// or in textual repr: safeTransferFromWithData(address,address,uint256,bytes)180 function safeTransferFromWithData(705 function safeTransferFromWithData(181 address from,706 address from,182 address to,707 address to,191 dummy = 0;716 dummy = 0;192 }717 }193718194 // @dev Not implemented719 /// @dev Not implemented195 //720 /// @dev EVM selector for this function is: 0x42842e0e,196 // Selector: safeTransferFrom(address,address,uint256) 42842e0e721 /// or in textual repr: safeTransferFrom(address,address,uint256)197 function safeTransferFrom(722 function safeTransferFrom(198 address from,723 address from,199 address to,724 address to,206 dummy = 0;731 dummy = 0;207 }732 }208733209 // @notice Transfer ownership of an RFT -- THE CALLER IS RESPONSIBLE734 /// @notice Transfer ownership of an RFT -- THE CALLER IS RESPONSIBLE210 // TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE735 /// TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE211 // THEY MAY BE PERMANENTLY LOST736 /// THEY MAY BE PERMANENTLY LOST212 // @dev Throws unless `msg.sender` is the current owner or an authorized737 /// @dev Throws unless `msg.sender` is the current owner or an authorized213 // operator for this RFT. Throws if `from` is not the current owner. Throws738 /// operator for this RFT. Throws if `from` is not the current owner. Throws214 // if `to` is the zero address. Throws if `tokenId` is not a valid RFT.739 /// if `to` is the zero address. Throws if `tokenId` is not a valid RFT.215 // Throws if RFT pieces have multiple owners.740 /// Throws if RFT pieces have multiple owners.216 // @param from The current owner of the NFT741 /// @param from The current owner of the NFT217 // @param to The new owner742 /// @param to The new owner218 // @param tokenId The NFT to transfer743 /// @param tokenId The NFT to transfer219 // @param _value Not used for an NFT744 /// @dev EVM selector for this function is: 0x23b872dd,220 //221 // Selector: transferFrom(address,address,uint256) 23b872dd745 /// or in textual repr: transferFrom(address,address,uint256)222 function transferFrom(746 function transferFrom(223 address from,747 address from,224 address to,748 address to,231 dummy = 0;755 dummy = 0;232 }756 }233757234 // @dev Not implemented758 /// @dev Not implemented235 //759 /// @dev EVM selector for this function is: 0x095ea7b3,236 // Selector: approve(address,uint256) 095ea7b3760 /// or in textual repr: approve(address,uint256)237 function approve(address approved, uint256 tokenId) public {761 function approve(address approved, uint256 tokenId) public {238 require(false, stub_error);762 require(false, stub_error);239 approved;763 approved;240 tokenId;764 tokenId;241 dummy = 0;765 dummy = 0;242 }766 }243767244 // @dev Not implemented768 /// @dev Not implemented245 //769 /// @dev EVM selector for this function is: 0xa22cb465,246 // Selector: setApprovalForAll(address,bool) a22cb465770 /// or in textual repr: setApprovalForAll(address,bool)247 function setApprovalForAll(address operator, bool approved) public {771 function setApprovalForAll(address operator, bool approved) public {248 require(false, stub_error);772 require(false, stub_error);249 operator;773 operator;250 approved;774 approved;251 dummy = 0;775 dummy = 0;252 }776 }253777254 // @dev Not implemented778 /// @dev Not implemented255 //779 /// @dev EVM selector for this function is: 0x081812fc,256 // Selector: getApproved(uint256) 081812fc780 /// or in textual repr: getApproved(uint256)257 function getApproved(uint256 tokenId) public view returns (address) {781 function getApproved(uint256 tokenId) public view returns (address) {258 require(false, stub_error);782 require(false, stub_error);259 tokenId;783 tokenId;260 dummy;784 dummy;261 return 0x0000000000000000000000000000000000000000;785 return 0x0000000000000000000000000000000000000000;262 }786 }263787264 // @dev Not implemented788 /// @dev Not implemented265 //789 /// @dev EVM selector for this function is: 0xe985e9c5,266 // Selector: isApprovedForAll(address,address) e985e9c5790 /// or in textual repr: isApprovedForAll(address,address)267 function isApprovedForAll(address owner, address operator)791 function isApprovedForAll(address owner, address operator)268 public792 public269 view793 view277 }801 }278}802}279280// Selector: 5b5e139f281contract ERC721Metadata is Dummy, ERC165 {282 // @notice A descriptive name for a collection of RFTs in this contract283 //284 // Selector: name() 06fdde03285 function name() public view returns (string memory) {286 require(false, stub_error);287 dummy;288 return "";289 }290291 // @notice An abbreviated name for RFTs in this contract292 //293 // Selector: symbol() 95d89b41294 function symbol() public view returns (string memory) {295 require(false, stub_error);296 dummy;297 return "";298 }299300 // @notice A distinct Uniform Resource Identifier (URI) for a given asset.301 //302 // @dev If the token has a `url` property and it is not empty, it is returned.303 // 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`.304 // If the collection property `baseURI` is empty or absent, return "" (empty string)305 // otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix306 // otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings).307 //308 // @return token's const_metadata309 //310 // Selector: tokenURI(uint256) c87b56dd311 function tokenURI(uint256 tokenId) public view returns (string memory) {312 require(false, stub_error);313 tokenId;314 dummy;315 return "";316 }317}318319// Selector: 68ccfe89320contract ERC721Mintable is Dummy, ERC165, ERC721MintableEvents {321 // Selector: mintingFinished() 05d2035b322 function mintingFinished() public view returns (bool) {323 require(false, stub_error);324 dummy;325 return false;326 }327328 // @notice Function to mint token.329 // @dev `tokenId` should be obtained with `nextTokenId` method,330 // unlike standard, you can't specify it manually331 // @param to The new owner332 // @param tokenId ID of the minted RFT333 //334 // Selector: mint(address,uint256) 40c10f19335 function mint(address to, uint256 tokenId) public returns (bool) {336 require(false, stub_error);337 to;338 tokenId;339 dummy = 0;340 return false;341 }342343 // @notice Function to mint token with the given tokenUri.344 // @dev `tokenId` should be obtained with `nextTokenId` method,345 // unlike standard, you can't specify it manually346 // @param to The new owner347 // @param tokenId ID of the minted RFT348 // @param tokenUri Token URI that would be stored in the RFT properties349 //350 // Selector: mintWithTokenURI(address,uint256,string) 50bb4e7f351 function mintWithTokenURI(352 address to,353 uint256 tokenId,354 string memory tokenUri355 ) public returns (bool) {356 require(false, stub_error);357 to;358 tokenId;359 tokenUri;360 dummy = 0;361 return false;362 }363364 // @dev Not implemented365 //366 // Selector: finishMinting() 7d64bcb4367 function finishMinting() public returns (bool) {368 require(false, stub_error);369 dummy = 0;370 return false;371 }372}373374// Selector: 780e9d63375contract ERC721Enumerable is Dummy, ERC165 {376 // @notice Enumerate valid RFTs377 // @param index A counter less than `totalSupply()`378 // @return The token identifier for the `index`th NFT,379 // (sort order not specified)380 //381 // Selector: tokenByIndex(uint256) 4f6ccce7382 function tokenByIndex(uint256 index) public view returns (uint256) {383 require(false, stub_error);384 index;385 dummy;386 return 0;387 }388389 // Not implemented390 //391 // Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59392 function tokenOfOwnerByIndex(address owner, uint256 index)393 public394 view395 returns (uint256)396 {397 require(false, stub_error);398 owner;399 index;400 dummy;401 return 0;402 }403404 // @notice Count RFTs tracked by this contract405 // @return A count of valid RFTs tracked by this contract, where each one of406 // them has an assigned and queryable owner not equal to the zero address407 //408 // Selector: totalSupply() 18160ddd409 function totalSupply() public view returns (uint256) {410 require(false, stub_error);411 dummy;412 return 0;413 }414}415416// Selector: 7c3bef89417contract ERC721UniqueExtensions is Dummy, ERC165 {418 // @notice Transfer ownership of an RFT419 // @dev Throws unless `msg.sender` is the current owner. Throws if `to`420 // is the zero address. Throws if `tokenId` is not a valid RFT.421 // Throws if RFT pieces have multiple owners.422 // @param to The new owner423 // @param tokenId The RFT to transfer424 // @param _value Not used for an RFT425 //426 // Selector: transfer(address,uint256) a9059cbb427 function transfer(address to, uint256 tokenId) public {428 require(false, stub_error);429 to;430 tokenId;431 dummy = 0;432 }433434 // @notice Burns a specific ERC721 token.435 // @dev Throws unless `msg.sender` is the current owner or an authorized436 // operator for this RFT. Throws if `from` is not the current owner. Throws437 // if `to` is the zero address. Throws if `tokenId` is not a valid RFT.438 // Throws if RFT pieces have multiple owners.439 // @param from The current owner of the RFT440 // @param tokenId The RFT to transfer441 // @param _value Not used for an RFT442 //443 // Selector: burnFrom(address,uint256) 79cc6790444 function burnFrom(address from, uint256 tokenId) public {445 require(false, stub_error);446 from;447 tokenId;448 dummy = 0;449 }450451 // @notice Returns next free RFT ID.452 //453 // Selector: nextTokenId() 75794a3c454 function nextTokenId() public view returns (uint256) {455 require(false, stub_error);456 dummy;457 return 0;458 }459460 // @notice Function to mint multiple tokens.461 // @dev `tokenIds` should be an array of consecutive numbers and first number462 // should be obtained with `nextTokenId` method463 // @param to The new owner464 // @param tokenIds IDs of the minted RFTs465 //466 // Selector: mintBulk(address,uint256[]) 44a9945e467 function mintBulk(address to, uint256[] memory tokenIds)468 public469 returns (bool)470 {471 require(false, stub_error);472 to;473 tokenIds;474 dummy = 0;475 return false;476 }477478 // @notice Function to mint multiple tokens with the given tokenUris.479 // @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive480 // numbers and first number should be obtained with `nextTokenId` method481 // @param to The new owner482 // @param tokens array of pairs of token ID and token URI for minted tokens483 //484 // Selector: mintBulkWithTokenURI(address,(uint256,string)[]) 36543006485 function mintBulkWithTokenURI(address to, Tuple0[] memory tokens)486 public487 returns (bool)488 {489 require(false, stub_error);490 to;491 tokens;492 dummy = 0;493 return false;494 }495496 // Returns EVM address for refungible token497 //498 // @param token ID of the token499 //500 // Selector: tokenContractAddress(uint256) ab76fac6501 function tokenContractAddress(uint256 token) public view returns (address) {502 require(false, stub_error);503 token;504 dummy;505 return 0x0000000000000000000000000000000000000000;506 }507}508509// Selector: ffe4da23510contract 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) 2f073f66517 function setCollectionProperty(string memory key, bytes memory value)518 public519 {520 require(false, stub_error);521 key;522 value;523 dummy = 0;524 }525526 // Delete collection property.527 //528 // @param key Property key.529 //530 // Selector: deleteCollectionProperty(string) 7b7debce531 function deleteCollectionProperty(string memory key) public {532 require(false, stub_error);533 key;534 dummy = 0;535 }536537 // 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) cf24fd6d545 function collectionProperty(string memory key)546 public547 view548 returns (bytes memory)549 {550 require(false, stub_error);551 key;552 dummy;553 return hex"";554 }555556 // 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) 7623402e563 function setCollectionSponsor(address sponsor) public {564 require(false, stub_error);565 sponsor;566 dummy = 0;567 }568569 // Collection sponsorship confirmation.570 //571 // @dev After setting the sponsor for the collection, it must be confirmed with this function.572 //573 // Selector: confirmCollectionSponsorship() 3c50e97a574 function confirmCollectionSponsorship() public {575 require(false, stub_error);576 dummy = 0;577 }578579 // 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) 6a3841db591 function setCollectionLimit(string memory limit, uint32 value) public {592 require(false, stub_error);593 limit;594 value;595 dummy = 0;596 }597598 // 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) 993b7fba607 function setCollectionLimit(string memory limit, bool value) public {608 require(false, stub_error);609 limit;610 value;611 dummy = 0;612 }613614 // Get contract address.615 //616 // Selector: contractAddress() f6b4dfb4617 function contractAddress() public view returns (address) {618 require(false, stub_error);619 dummy;620 return 0x0000000000000000000000000000000000000000;621 }622623 // Add collection admin by substrate address.624 // @param new_admin Substrate administrator address.625 //626 // Selector: addCollectionAdminSubstrate(uint256) 5730062b627 function addCollectionAdminSubstrate(uint256 newAdmin) public {628 require(false, stub_error);629 newAdmin;630 dummy = 0;631 }632633 // Remove collection admin by substrate address.634 // @param admin Substrate administrator address.635 //636 // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9637 function removeCollectionAdminSubstrate(uint256 admin) public {638 require(false, stub_error);639 admin;640 dummy = 0;641 }642643 // Add collection admin.644 // @param new_admin Address of the added administrator.645 //646 // Selector: addCollectionAdmin(address) 92e462c7647 function addCollectionAdmin(address newAdmin) public {648 require(false, stub_error);649 newAdmin;650 dummy = 0;651 }652653 // Remove collection admin.654 //655 // @param new_admin Address of the removed administrator.656 //657 // Selector: removeCollectionAdmin(address) fafd7b42658 function removeCollectionAdmin(address admin) public {659 require(false, stub_error);660 admin;661 dummy = 0;662 }663664 // Toggle accessibility of collection nesting.665 //666 // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'667 //668 // Selector: setCollectionNesting(bool) 112d4586669 function setCollectionNesting(bool enable) public {670 require(false, stub_error);671 enable;672 dummy = 0;673 }674675 // 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[]) 64872396681 function setCollectionNesting(bool enable, address[] memory collections)682 public683 {684 require(false, stub_error);685 enable;686 collections;687 dummy = 0;688 }689690 // Set the collection access method.691 // @param mode Access mode692 // 0 for Normal693 // 1 for AllowList694 //695 // Selector: setCollectionAccess(uint8) 41835d4c696 function setCollectionAccess(uint8 mode) public {697 require(false, stub_error);698 mode;699 dummy = 0;700 }701702 // Add the user to the allowed list.703 //704 // @param user Address of a trusted user.705 //706 // Selector: addToCollectionAllowList(address) 67844fe6707 function addToCollectionAllowList(address user) public {708 require(false, stub_error);709 user;710 dummy = 0;711 }712713 // Remove the user from the allowed list.714 //715 // @param user Address of a removed user.716 //717 // Selector: removeFromCollectionAllowList(address) 85c51acb718 function removeFromCollectionAllowList(address user) public {719 require(false, stub_error);720 user;721 dummy = 0;722 }723724 // Switch permission for minting.725 //726 // @param mode Enable if "true".727 //728 // Selector: setCollectionMintMode(bool) 00018e84729 function setCollectionMintMode(bool mode) public {730 require(false, stub_error);731 mode;732 dummy = 0;733 }734735 // Check that account is the owner or admin of the collection736 //737 // @param user account to verify738 // @return "true" if account is the owner or admin739 //740 // Selector: isOwnerOrAdmin(address) 9811b0c7741 function isOwnerOrAdmin(address user) public view returns (bool) {742 require(false, stub_error);743 user;744 dummy;745 return false;746 }747748 // Check that substrate account is the owner or admin of the collection749 //750 // @param user account to verify751 // @return "true" if account is the owner or admin752 //753 // Selector: isOwnerOrAdminSubstrate(uint256) 68910e00754 function isOwnerOrAdminSubstrate(uint256 user) public view returns (bool) {755 require(false, stub_error);756 user;757 dummy;758 return false;759 }760761 // Returns collection type762 //763 // @return `Fungible` or `NFT` or `ReFungible`764 //765 // Selector: uniqueCollectionType() d34b55b8766 function uniqueCollectionType() public returns (string memory) {767 require(false, stub_error);768 dummy = 0;769 return "";770 }771772 // Changes collection owner to another account773 //774 // @dev Owner can be changed only by current owner775 // @param newOwner new owner account776 //777 // Selector: setOwner(address) 13af4035778 function setOwner(address newOwner) public {779 require(false, stub_error);780 newOwner;781 dummy = 0;782 }783784 // Changes collection owner to another substrate account785 //786 // @dev Owner can be changed only by current owner787 // @param newOwner new owner substrate account788 //789 // Selector: setOwnerSubstrate(uint256) b212138f790 function setOwnerSubstrate(uint256 newOwner) public {791 require(false, stub_error);792 newOwner;793 dummy = 0;794 }795}796803797contract UniqueRefungible is804contract UniqueRefungible is798 Dummy,805 Dummy,pallets/refungible/src/stubs/UniqueRefungibleToken.rawdiffbeforeafterbothbinary blob — no preview
pallets/refungible/src/stubs/UniqueRefungibleToken.soldiffbeforeafterboth334pragma solidity >=0.8.0 <0.9.0;4pragma solidity >=0.8.0 <0.9.0;556// Common stubs holder6/// @dev common stubs holder7contract Dummy {7contract Dummy {8 uint8 dummy;8 uint8 dummy;9 string stub_error = "this contract is implemented in native";9 string stub_error = "this contract is implemented in native";21 }21 }22}22}232324// Inline24/// @dev the ERC-165 identifier for this interface is 0x042f110625contract ERC1633UniqueExtensions is Dummy, ERC165 {26 /// @dev EVM selector for this function is: 0x042f1106,27 /// or in textual repr: setParentNFT(address,uint256)28 function setParentNFT(address collection, uint256 nftId)29 public30 returns (bool)31 {32 require(false, stub_error);33 collection;34 nftId;35 dummy = 0;36 return false;37 }38}3940/// @dev the ERC-165 identifier for this interface is 0x5755c3f241contract ERC1633 is Dummy, ERC165 {42 /// @dev EVM selector for this function is: 0x80a54001,43 /// or in textual repr: parentToken()44 function parentToken() public view returns (address) {45 require(false, stub_error);46 dummy;47 return 0x0000000000000000000000000000000000000000;48 }4950 /// @dev EVM selector for this function is: 0xd7f083f3,51 /// or in textual repr: parentTokenId()52 function parentTokenId() public view returns (uint256) {53 require(false, stub_error);54 dummy;55 return 0;56 }57}5859/// @dev the ERC-165 identifier for this interface is 0xab8deb3760contract ERC20UniqueExtensions is Dummy, ERC165 {61 /// @dev Function that burns an amount of the token of a given account,62 /// deducting from the sender's allowance for said account.63 /// @param from The account whose tokens will be burnt.64 /// @param amount The amount that will be burnt.65 /// @dev EVM selector for this function is: 0x79cc6790,66 /// or in textual repr: burnFrom(address,uint256)67 function burnFrom(address from, uint256 amount) public returns (bool) {68 require(false, stub_error);69 from;70 amount;71 dummy = 0;72 return false;73 }7475 /// @dev Function that changes total amount of the tokens.76 /// Throws if `msg.sender` doesn't owns all of the tokens.77 /// @param amount New total amount of the tokens.78 /// @dev EVM selector for this function is: 0xd2418ca7,79 /// or in textual repr: repartition(uint256)80 function repartition(uint256 amount) public returns (bool) {81 require(false, stub_error);82 amount;83 dummy = 0;84 return false;85 }86}8788/// @dev inlined interface25contract ERC20Events {89contract ERC20Events {26 event Transfer(address indexed from, address indexed to, uint256 value);90 event Transfer(address indexed from, address indexed to, uint256 value);27 event Approval(91 event Approval(31 );95 );32}96}339734// Selector: 042f110698/// @title Standard ERC20 token35contract ERC1633UniqueExtensions is Dummy, ERC165 {99///36 // Selector: setParentNFT(address,uint256) 042f1106100/// @dev Implementation of the basic standard token.37 function setParentNFT(address collection, uint256 nftId)101/// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md38 public102/// @dev the ERC-165 identifier for this interface is 0x942e8b2239 returns (bool)40 {41 require(false, stub_error);42 collection;43 nftId;44 dummy = 0;45 return false;46 }47}4849// Selector: 5755c3f250contract ERC1633 is Dummy, ERC165 {51 // Selector: parentToken() 80a5400152 function parentToken() public view returns (address) {53 require(false, stub_error);54 dummy;55 return 0x0000000000000000000000000000000000000000;56 }5758 // Selector: parentTokenId() d7f083f359 function parentTokenId() public view returns (uint256) {60 require(false, stub_error);61 dummy;62 return 0;63 }64}6566// Selector: 942e8b2267contract ERC20 is Dummy, ERC165, ERC20Events {103contract ERC20 is Dummy, ERC165, ERC20Events {68 // @return the name of the token.104 /// @return the name of the token.69 //105 /// @dev EVM selector for this function is: 0x06fdde03,70 // Selector: name() 06fdde03106 /// or in textual repr: name()71 function name() public view returns (string memory) {107 function name() public view returns (string memory) {72 require(false, stub_error);108 require(false, stub_error);73 dummy;109 dummy;74 return "";110 return "";75 }111 }7611277 // @return the symbol of the token.113 /// @return the symbol of the token.78 //114 /// @dev EVM selector for this function is: 0x95d89b41,79 // Selector: symbol() 95d89b41115 /// or in textual repr: symbol()80 function symbol() public view returns (string memory) {116 function symbol() public view returns (string memory) {81 require(false, stub_error);117 require(false, stub_error);82 dummy;118 dummy;83 return "";119 return "";84 }120 }8512186 // @dev Total number of tokens in existence122 /// @dev Total number of tokens in existence87 //123 /// @dev EVM selector for this function is: 0x18160ddd,88 // Selector: totalSupply() 18160ddd124 /// or in textual repr: totalSupply()89 function totalSupply() public view returns (uint256) {125 function totalSupply() public view returns (uint256) {90 require(false, stub_error);126 require(false, stub_error);91 dummy;127 dummy;92 return 0;128 return 0;93 }129 }9413095 // @dev Not supported131 /// @dev Not supported96 //132 /// @dev EVM selector for this function is: 0x313ce567,97 // Selector: decimals() 313ce567133 /// or in textual repr: decimals()98 function decimals() public view returns (uint8) {134 function decimals() public view returns (uint8) {99 require(false, stub_error);135 require(false, stub_error);100 dummy;136 dummy;101 return 0;137 return 0;102 }138 }103139104 // @dev Gets the balance of the specified address.140 /// @dev Gets the balance of the specified address.105 // @param owner The address to query the balance of.141 /// @param owner The address to query the balance of.106 // @return An uint256 representing the amount owned by the passed address.142 /// @return An uint256 representing the amount owned by the passed address.107 //143 /// @dev EVM selector for this function is: 0x70a08231,108 // Selector: balanceOf(address) 70a08231144 /// or in textual repr: balanceOf(address)109 function balanceOf(address owner) public view returns (uint256) {145 function balanceOf(address owner) public view returns (uint256) {110 require(false, stub_error);146 require(false, stub_error);111 owner;147 owner;112 dummy;148 dummy;113 return 0;149 return 0;114 }150 }115151116 // @dev Transfer token for a specified address152 /// @dev Transfer token for a specified address117 // @param to The address to transfer to.153 /// @param to The address to transfer to.118 // @param amount The amount to be transferred.154 /// @param amount The amount to be transferred.119 //155 /// @dev EVM selector for this function is: 0xa9059cbb,120 // Selector: transfer(address,uint256) a9059cbb156 /// or in textual repr: transfer(address,uint256)121 function transfer(address to, uint256 amount) public returns (bool) {157 function transfer(address to, uint256 amount) public returns (bool) {122 require(false, stub_error);158 require(false, stub_error);123 to;159 to;126 return false;162 return false;127 }163 }128164129 // @dev Transfer tokens from one address to another165 /// @dev Transfer tokens from one address to another130 // @param from address The address which you want to send tokens from166 /// @param from address The address which you want to send tokens from131 // @param to address The address which you want to transfer to167 /// @param to address The address which you want to transfer to132 // @param amount uint256 the amount of tokens to be transferred168 /// @param amount uint256 the amount of tokens to be transferred133 //169 /// @dev EVM selector for this function is: 0x23b872dd,134 // Selector: transferFrom(address,address,uint256) 23b872dd170 /// or in textual repr: transferFrom(address,address,uint256)135 function transferFrom(171 function transferFrom(136 address from,172 address from,137 address to,173 address to,145 return false;181 return false;146 }182 }147183148 // @dev Approve the passed address to spend the specified amount of tokens on behalf of `msg.sender`.184 /// @dev Approve the passed address to spend the specified amount of tokens on behalf of `msg.sender`.149 // Beware that changing an allowance with this method brings the risk that someone may use both the old185 /// Beware that changing an allowance with this method brings the risk that someone may use both the old150 // and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this186 /// and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this151 // race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:187 /// race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:152 // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729188 /// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729153 // @param spender The address which will spend the funds.189 /// @param spender The address which will spend the funds.154 // @param amount The amount of tokens to be spent.190 /// @param amount The amount of tokens to be spent.155 //191 /// @dev EVM selector for this function is: 0x095ea7b3,156 // Selector: approve(address,uint256) 095ea7b3192 /// or in textual repr: approve(address,uint256)157 function approve(address spender, uint256 amount) public returns (bool) {193 function approve(address spender, uint256 amount) public returns (bool) {158 require(false, stub_error);194 require(false, stub_error);159 spender;195 spender;162 return false;198 return false;163 }199 }164200165 // @dev Function to check the amount of tokens that an owner allowed to a spender.201 /// @dev Function to check the amount of tokens that an owner allowed to a spender.166 // @param owner address The address which owns the funds.202 /// @param owner address The address which owns the funds.167 // @param spender address The address which will spend the funds.203 /// @param spender address The address which will spend the funds.168 // @return A uint256 specifying the amount of tokens still available for the spender.204 /// @return A uint256 specifying the amount of tokens still available for the spender.169 //205 /// @dev EVM selector for this function is: 0xdd62ed3e,170 // Selector: allowance(address,address) dd62ed3e206 /// or in textual repr: allowance(address,address)171 function allowance(address owner, address spender)207 function allowance(address owner, address spender)172 public208 public173 view209 view181 }217 }182}218}183184// Selector: ab8deb37185contract ERC20UniqueExtensions is Dummy, ERC165 {186 // @dev Function that burns an amount of the token of a given account,187 // deducting from the sender's allowance for said account.188 // @param from The account whose tokens will be burnt.189 // @param amount The amount that will be burnt.190 //191 // Selector: burnFrom(address,uint256) 79cc6790192 function burnFrom(address from, uint256 amount) public returns (bool) {193 require(false, stub_error);194 from;195 amount;196 dummy = 0;197 return false;198 }199200 // @dev Function that changes total amount of the tokens.201 // Throws if `msg.sender` doesn't owns all of the tokens.202 // @param amount New total amount of the tokens.203 //204 // Selector: repartition(uint256) d2418ca7205 function repartition(uint256 amount) public returns (bool) {206 require(false, stub_error);207 amount;208 dummy = 0;209 return false;210 }211}212219213contract UniqueRefungibleToken is220contract UniqueRefungibleToken is214 Dummy,221 Dummy,pallets/unique/src/eth/mod.rsdiffbeforeafterboth203}203}204204205/// @title Contract, which allows users to operate with collections205/// @title Contract, which allows users to operate with collections206#[solidity_interface(name = "CollectionHelpers", events(CollectionHelpersEvents))]206#[solidity_interface(name = CollectionHelpers, events(CollectionHelpersEvents))]207impl<T> EvmCollectionHelpers<T>207impl<T> EvmCollectionHelpers<T>208where208where209 T: Config + pallet_nonfungible::Config + pallet_refungible::Config,209 T: Config + pallet_nonfungible::Config + pallet_refungible::Config,210{210{211 /// Create an NFT collection211 /// Create an NFT collection212 /// @param name Name of the collection212 /// @param name Name of the collection213 /// @param description Informative description of the collection213 /// @param description Informative description of the collection214 /// @param token_prefix Token prefix to represent the collection tokens in UI and user applications214 /// @param tokenPrefix Token prefix to represent the collection tokens in UI and user applications215 /// @return address Address of the newly created collection215 /// @return address Address of the newly created collection216 #[weight(<SelfWeightOf<T>>::create_collection())]216 #[weight(<SelfWeightOf<T>>::create_collection())]217 fn create_nonfungible_collection(217 fn create_nonfungible_collection(304 }304 }305305306 /// Check if a collection exists306 /// Check if a collection exists307 /// @param collection_address Address of the collection in question307 /// @param collectionAddress Address of the collection in question308 /// @return bool Does the collection exist?308 /// @return bool Does the collection exist?309 fn is_collection_exist(&self, _caller: caller, collection_address: address) -> Result<bool> {309 fn is_collection_exist(&self, _caller: caller, collection_address: address) -> Result<bool> {310 if let Some(id) = pallet_common::eth::map_eth_to_id(&collection_address) {310 if let Some(id) = pallet_common::eth::map_eth_to_id(&collection_address) {pallets/unique/src/eth/stubs/CollectionHelpers.rawdiffbeforeafterbothbinary blob — no preview
pallets/unique/src/eth/stubs/CollectionHelpers.soldiffbeforeafterboth334pragma solidity >=0.8.0 <0.9.0;4pragma solidity >=0.8.0 <0.9.0;556// Common stubs holder6/// @dev common stubs holder7contract Dummy {7contract Dummy {8 uint8 dummy;8 uint8 dummy;9 string stub_error = "this contract is implemented in native";9 string stub_error = "this contract is implemented in native";21 }21 }22}22}232324// Inline24/// @dev inlined interface25contract CollectionHelpersEvents {25contract CollectionHelpersEvents {26 event CollectionCreated(26 event CollectionCreated(27 address indexed owner,27 address indexed owner,28 address indexed collectionId28 address indexed collectionId29 );29 );30}30}313132// Selector: 675f307432/// @title Contract, which allows users to operate with collections33/// @dev the ERC-165 identifier for this interface is 0x675f307433contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents {34contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents {34 // Create an NFT collection35 /// Create an NFT collection35 // @param name Name of the collection36 /// @param name Name of the collection36 // @param description Informative description of the collection37 /// @param description Informative description of the collection37 // @param token_prefix Token prefix to represent the collection tokens in UI and user applications38 /// @param tokenPrefix Token prefix to represent the collection tokens in UI and user applications38 // @return address Address of the newly created collection39 /// @return address Address of the newly created collection39 //40 /// @dev EVM selector for this function is: 0xe34a6844,40 // Selector: createNonfungibleCollection(string,string,string) e34a684441 /// or in textual repr: createNonfungibleCollection(string,string,string)41 function createNonfungibleCollection(42 function createNonfungibleCollection(42 string memory name,43 string memory name,43 string memory description,44 string memory description,51 return 0x0000000000000000000000000000000000000000;52 return 0x0000000000000000000000000000000000000000;52 }53 }535455 /// @dev EVM selector for this function is: 0xa634a5f9,54 // Selector: createERC721MetadataCompatibleCollection(string,string,string,string) a634a5f956 /// or in textual repr: createERC721MetadataCompatibleCollection(string,string,string,string)55 function createERC721MetadataCompatibleCollection(57 function createERC721MetadataCompatibleCollection(56 string memory name,58 string memory name,57 string memory description,59 string memory description,67 return 0x0000000000000000000000000000000000000000;69 return 0x0000000000000000000000000000000000000000;68 }70 }697172 /// @dev EVM selector for this function is: 0x44a68ad5,70 // Selector: createRefungibleCollection(string,string,string) 44a68ad573 /// or in textual repr: createRefungibleCollection(string,string,string)71 function createRefungibleCollection(74 function createRefungibleCollection(72 string memory name,75 string memory name,73 string memory description,76 string memory description,81 return 0x0000000000000000000000000000000000000000;84 return 0x0000000000000000000000000000000000000000;82 }85 }838687 /// @dev EVM selector for this function is: 0xa5596388,84 // Selector: createERC721MetadataCompatibleRFTCollection(string,string,string,string) a559638888 /// or in textual repr: createERC721MetadataCompatibleRFTCollection(string,string,string,string)85 function createERC721MetadataCompatibleRFTCollection(89 function createERC721MetadataCompatibleRFTCollection(86 string memory name,90 string memory name,87 string memory description,91 string memory description,97 return 0x0000000000000000000000000000000000000000;101 return 0x0000000000000000000000000000000000000000;98 }102 }99103100 // Check if a collection exists104 /// Check if a collection exists101 // @param collection_address Address of the collection in question105 /// @param collectionAddress Address of the collection in question102 // @return bool Does the collection exist?106 /// @return bool Does the collection exist?103 //107 /// @dev EVM selector for this function is: 0xc3de1494,104 // Selector: isCollectionExist(address) c3de1494108 /// or in textual repr: isCollectionExist(address)105 function isCollectionExist(address collectionAddress)109 function isCollectionExist(address collectionAddress)106 public110 public107 view111 viewtests/src/eth/api/CollectionHelpers.soldiffbeforeafterboth334pragma solidity >=0.8.0 <0.9.0;4pragma solidity >=0.8.0 <0.9.0;556// Common stubs holder6/// @dev common stubs holder7interface Dummy {7interface Dummy {889}9}12 function supportsInterface(bytes4 interfaceID) external view returns (bool);12 function supportsInterface(bytes4 interfaceID) external view returns (bool);13}13}141415// Inline15/// @dev inlined interface16interface CollectionHelpersEvents {16interface CollectionHelpersEvents {17 event CollectionCreated(17 event CollectionCreated(18 address indexed owner,18 address indexed owner,19 address indexed collectionId19 address indexed collectionId20 );20 );21}21}222223// Selector: 675f307423/// @title Contract, which allows users to operate with collections24/// @dev the ERC-165 identifier for this interface is 0x675f307424interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents {25interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents {25 // Create an NFT collection26 /// Create an NFT collection26 // @param name Name of the collection27 /// @param name Name of the collection27 // @param description Informative description of the collection28 /// @param description Informative description of the collection28 // @param token_prefix Token prefix to represent the collection tokens in UI and user applications29 /// @param tokenPrefix Token prefix to represent the collection tokens in UI and user applications29 // @return address Address of the newly created collection30 /// @return address Address of the newly created collection30 //31 /// @dev EVM selector for this function is: 0xe34a6844,31 // Selector: createNonfungibleCollection(string,string,string) e34a684432 /// or in textual repr: createNonfungibleCollection(string,string,string)32 function createNonfungibleCollection(33 function createNonfungibleCollection(33 string memory name,34 string memory name,34 string memory description,35 string memory description,35 string memory tokenPrefix36 string memory tokenPrefix36 ) external returns (address);37 ) external returns (address);373839 /// @dev EVM selector for this function is: 0xa634a5f9,38 // Selector: createERC721MetadataCompatibleCollection(string,string,string,string) a634a5f940 /// or in textual repr: createERC721MetadataCompatibleCollection(string,string,string,string)39 function createERC721MetadataCompatibleCollection(41 function createERC721MetadataCompatibleCollection(40 string memory name,42 string memory name,41 string memory description,43 string memory description,42 string memory tokenPrefix,44 string memory tokenPrefix,43 string memory baseUri45 string memory baseUri44 ) external returns (address);46 ) external returns (address);454748 /// @dev EVM selector for this function is: 0x44a68ad5,46 // Selector: createRefungibleCollection(string,string,string) 44a68ad549 /// or in textual repr: createRefungibleCollection(string,string,string)47 function createRefungibleCollection(50 function createRefungibleCollection(48 string memory name,51 string memory name,49 string memory description,52 string memory description,50 string memory tokenPrefix53 string memory tokenPrefix51 ) external returns (address);54 ) external returns (address);525556 /// @dev EVM selector for this function is: 0xa5596388,53 // Selector: createERC721MetadataCompatibleRFTCollection(string,string,string,string) a559638857 /// or in textual repr: createERC721MetadataCompatibleRFTCollection(string,string,string,string)54 function createERC721MetadataCompatibleRFTCollection(58 function createERC721MetadataCompatibleRFTCollection(55 string memory name,59 string memory name,56 string memory description,60 string memory description,57 string memory tokenPrefix,61 string memory tokenPrefix,58 string memory baseUri62 string memory baseUri59 ) external returns (address);63 ) external returns (address);606461 // Check if a collection exists65 /// Check if a collection exists62 // @param collection_address Address of the collection in question66 /// @param collectionAddress Address of the collection in question63 // @return bool Does the collection exist?67 /// @return bool Does the collection exist?64 //68 /// @dev EVM selector for this function is: 0xc3de1494,65 // Selector: isCollectionExist(address) c3de149469 /// or in textual repr: isCollectionExist(address)66 function isCollectionExist(address collectionAddress)70 function isCollectionExist(address collectionAddress)67 external71 external68 view72 viewtests/src/eth/api/ContractHelpers.soldiffbeforeafterboth334pragma solidity >=0.8.0 <0.9.0;4pragma solidity >=0.8.0 <0.9.0;556// Anonymous struct6/// @dev anonymous struct7struct Tuple0 {7struct Tuple0 {8 address field_0;8 address field_0;9 uint256 field_1;9 uint256 field_1;10}10}111112// Common stubs holder12/// @dev common stubs holder13interface Dummy {13interface Dummy {141415}15}18 function supportsInterface(bytes4 interfaceID) external view returns (bool);18 function supportsInterface(bytes4 interfaceID) external view returns (bool);19}19}202021// Selector: 6073d91721/// @dev the ERC-165 identifier for this interface is 0x6073d91722interface ContractHelpers is Dummy, ERC165 {22interface ContractHelpers is Dummy, ERC165 {23 // Get contract ovner23 /// Get contract ovner24 //24 ///25 // @param Contract_address contract for which the owner is being determined.25 /// @param contractAddress contract for which the owner is being determined.26 // @return Contract owner.26 /// @return Contract owner.27 //27 ///28 // Selector: contractOwner(address) 5152b14c28 /// Selector: contractOwner(address) 5152b14c29 function contractOwner(address contractAddress)29 function contractOwner(address contractAddress)30 external30 external31 view31 view32 returns (address);32 returns (address);333334 // Set sponsor.34 /// Set sponsor.35 //35 ///36 // @param contract_address Contract for which a sponsor is being established.36 /// @param contractAddress Contract for which a sponsor is being established.37 // @param sponsor User address who set as pending sponsor.37 /// @param sponsor User address who set as pending sponsor.38 //38 ///39 // Selector: setSponsor(address,address) f01fba9339 /// Selector: setSponsor(address,address) f01fba9340 function setSponsor(address contractAddress, address sponsor) external;40 function setSponsor(address contractAddress, address sponsor) external;414142 // Set contract as self sponsored.42 /// Set contract as self sponsored.43 //43 ///44 // @param contract_address Contract for which a self sponsoring is being enabled.44 /// @param contractAddress Contract for which a self sponsoring is being enabled.45 //45 ///46 // Selector: selfSponsoredEnable(address) 89f7d9ae46 /// Selector: selfSponsoredEnable(address) 89f7d9ae47 function selfSponsoredEnable(address contractAddress) external;47 function selfSponsoredEnable(address contractAddress) external;484849 // Remove sponsor.49 /// Remove sponsor.50 //50 ///51 // @param contract_address Contract for which a sponsorship is being removed.51 /// @param contractAddress Contract for which a sponsorship is being removed.52 //52 ///53 // Selector: removeSponsor(address) ef78425053 /// Selector: removeSponsor(address) ef78425054 function removeSponsor(address contractAddress) external;54 function removeSponsor(address contractAddress) external;555556 // Confirm sponsorship.56 /// Confirm sponsorship.57 //57 ///58 // @dev Caller must be same that set via [`set_sponsor`].58 /// @dev Caller must be same that set via [`setSponsor`].59 //59 ///60 // @param contract_address Сontract for which need to confirm sponsorship.60 /// @param contractAddress Сontract for which need to confirm sponsorship.61 //61 ///62 // Selector: confirmSponsorship(address) abc0000162 /// Selector: confirmSponsorship(address) abc0000163 function confirmSponsorship(address contractAddress) external;63 function confirmSponsorship(address contractAddress) external;646465 // Get current sponsor.65 /// Get current sponsor.66 //66 ///67 // @param contract_address The contract for which a sponsor is requested.67 /// @param contractAddress The contract for which a sponsor is requested.68 // @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.68 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.69 //69 ///70 // Selector: getSponsor(address) 743fc74570 /// Selector: getSponsor(address) 743fc74571 function getSponsor(address contractAddress)71 function getSponsor(address contractAddress)72 external72 external73 view73 view74 returns (Tuple0 memory);74 returns (Tuple0 memory);757576 // Check tat contract has confirmed sponsor.76 /// Check tat contract has confirmed sponsor.77 //77 ///78 // @param contract_address The contract for which the presence of a confirmed sponsor is checked.78 /// @param contractAddress The contract for which the presence of a confirmed sponsor is checked.79 // @return **true** if contract has confirmed sponsor.79 /// @return **true** if contract has confirmed sponsor.80 //80 ///81 // Selector: hasSponsor(address) 9741860381 /// Selector: hasSponsor(address) 9741860382 function hasSponsor(address contractAddress) external view returns (bool);82 function hasSponsor(address contractAddress) external view returns (bool);838384 // Check tat contract has pending sponsor.84 /// Check tat contract has pending sponsor.85 //85 ///86 // @param contract_address The contract for which the presence of a pending sponsor is checked.86 /// @param contractAddress The contract for which the presence of a pending sponsor is checked.87 // @return **true** if contract has pending sponsor.87 /// @return **true** if contract has pending sponsor.88 //88 ///89 // Selector: hasPendingSponsor(address) 39b9b24289 /// Selector: hasPendingSponsor(address) 39b9b24290 function hasPendingSponsor(address contractAddress)90 function hasPendingSponsor(address contractAddress)91 external91 external92 view92 view93 returns (bool);93 returns (bool);949495 // Selector: sponsoringEnabled(address) 6027dc6195 /// Selector: sponsoringEnabled(address) 6027dc6196 function sponsoringEnabled(address contractAddress)96 function sponsoringEnabled(address contractAddress)97 external97 external98 view98 view99 returns (bool);99 returns (bool);100100101 // Selector: setSponsoringMode(address,uint8) fde8a560101 /// Selector: setSponsoringMode(address,uint8) fde8a560102 function setSponsoringMode(address contractAddress, uint8 mode) external;102 function setSponsoringMode(address contractAddress, uint8 mode) external;103103104 // Selector: sponsoringMode(address) b70c7267104 /// Selector: sponsoringMode(address) b70c7267105 function sponsoringMode(address contractAddress)105 function sponsoringMode(address contractAddress)106 external106 external107 view107 view108 returns (uint8);108 returns (uint8);109109110 // Selector: setSponsoringRateLimit(address,uint32) 77b6c908110 /// Selector: setSponsoringRateLimit(address,uint32) 77b6c908111 function setSponsoringRateLimit(address contractAddress, uint32 rateLimit)111 function setSponsoringRateLimit(address contractAddress, uint32 rateLimit)112 external;112 external;113113114 // Selector: getSponsoringRateLimit(address) 610cfabd114 /// Selector: getSponsoringRateLimit(address) 610cfabd115 function getSponsoringRateLimit(address contractAddress)115 function getSponsoringRateLimit(address contractAddress)116 external116 external117 view117 view118 returns (uint32);118 returns (uint32);119119120 // Selector: allowed(address,address) 5c658165120 /// Selector: allowed(address,address) 5c658165121 function allowed(address contractAddress, address user)121 function allowed(address contractAddress, address user)122 external122 external123 view123 view124 returns (bool);124 returns (bool);125125126 // Selector: allowlistEnabled(address) c772ef6c126 /// Selector: allowlistEnabled(address) c772ef6c127 function allowlistEnabled(address contractAddress)127 function allowlistEnabled(address contractAddress)128 external128 external129 view129 view130 returns (bool);130 returns (bool);131131132 // Selector: toggleAllowlist(address,bool) 36de20f5132 /// Selector: toggleAllowlist(address,bool) 36de20f5133 function toggleAllowlist(address contractAddress, bool enabled) external;133 function toggleAllowlist(address contractAddress, bool enabled) external;134134135 // Selector: toggleAllowed(address,address,bool) 4706cc1c135 /// Selector: toggleAllowed(address,address,bool) 4706cc1c136 function toggleAllowed(136 function toggleAllowed(137 address contractAddress,137 address contractAddress,138 address user,138 address user,139 bool allowed139 bool isAllowed140 ) external;140 ) external;141}141}142142tests/src/eth/api/UniqueFungible.soldiffbeforeafterboth334pragma solidity >=0.8.0 <0.9.0;4pragma solidity >=0.8.0 <0.9.0;556// Common stubs holder6/// @dev common stubs holder7interface Dummy {7interface Dummy {889}9}12 function supportsInterface(bytes4 interfaceID) external view returns (bool);12 function supportsInterface(bytes4 interfaceID) external view returns (bool);13}13}141415// Inline15/// @title A contract that allows you to work with collections.16/// @dev the ERC-165 identifier for this interface is 0xffe4da2317interface Collection is Dummy, ERC165 {18 /// Set collection property.19 ///20 /// @param key Property key.21 /// @param value Propery value.22 /// @dev EVM selector for this function is: 0x2f073f66,23 /// or in textual repr: setCollectionProperty(string,bytes)24 function setCollectionProperty(string memory key, bytes memory value)25 external;2627 /// Delete collection property.28 ///29 /// @param key Property key.30 /// @dev EVM selector for this function is: 0x7b7debce,31 /// or in textual repr: deleteCollectionProperty(string)32 function deleteCollectionProperty(string memory key) external;3334 /// Get collection property.35 ///36 /// @dev Throws error if key not found.37 ///38 /// @param key Property key.39 /// @return bytes The property corresponding to the key.40 /// @dev EVM selector for this function is: 0xcf24fd6d,41 /// or in textual repr: collectionProperty(string)42 function collectionProperty(string memory key)43 external44 view45 returns (bytes memory);4647 /// Set the sponsor of the collection.48 ///49 /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.50 ///51 /// @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.52 /// @dev EVM selector for this function is: 0x7623402e,53 /// or in textual repr: setCollectionSponsor(address)54 function setCollectionSponsor(address sponsor) external;5556 /// Collection sponsorship confirmation.57 ///58 /// @dev After setting the sponsor for the collection, it must be confirmed with this function.59 /// @dev EVM selector for this function is: 0x3c50e97a,60 /// or in textual repr: confirmCollectionSponsorship()61 function confirmCollectionSponsorship() external;6263 /// Set limits for the collection.64 /// @dev Throws error if limit not found.65 /// @param limit Name of the limit. Valid names:66 /// "accountTokenOwnershipLimit",67 /// "sponsoredDataSize",68 /// "sponsoredDataRateLimit",69 /// "tokenLimit",70 /// "sponsorTransferTimeout",71 /// "sponsorApproveTimeout"72 /// @param value Value of the limit.73 /// @dev EVM selector for this function is: 0x6a3841db,74 /// or in textual repr: setCollectionLimit(string,uint32)75 function setCollectionLimit(string memory limit, uint32 value) external;7677 /// Set limits for the collection.78 /// @dev Throws error if limit not found.79 /// @param limit Name of the limit. Valid names:80 /// "ownerCanTransfer",81 /// "ownerCanDestroy",82 /// "transfersEnabled"83 /// @param value Value of the limit.84 /// @dev EVM selector for this function is: 0x993b7fba,85 /// or in textual repr: setCollectionLimit(string,bool)86 function setCollectionLimit(string memory limit, bool value) external;8788 /// Get contract address.89 /// @dev EVM selector for this function is: 0xf6b4dfb4,90 /// or in textual repr: contractAddress()91 function contractAddress() external view returns (address);9293 /// Add collection admin by substrate address.94 /// @param newAdmin Substrate administrator address.95 /// @dev EVM selector for this function is: 0x5730062b,96 /// or in textual repr: addCollectionAdminSubstrate(uint256)97 function addCollectionAdminSubstrate(uint256 newAdmin) external;9899 /// Remove collection admin by substrate address.100 /// @param admin Substrate administrator address.101 /// @dev EVM selector for this function is: 0x4048fcf9,102 /// or in textual repr: removeCollectionAdminSubstrate(uint256)103 function removeCollectionAdminSubstrate(uint256 admin) external;104105 /// Add collection admin.106 /// @param newAdmin Address of the added administrator.107 /// @dev EVM selector for this function is: 0x92e462c7,108 /// or in textual repr: addCollectionAdmin(address)109 function addCollectionAdmin(address newAdmin) external;110111 /// Remove collection admin.112 ///113 /// @param admin Address of the removed administrator.114 /// @dev EVM selector for this function is: 0xfafd7b42,115 /// or in textual repr: removeCollectionAdmin(address)116 function removeCollectionAdmin(address admin) external;117118 /// Toggle accessibility of collection nesting.119 ///120 /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'121 /// @dev EVM selector for this function is: 0x112d4586,122 /// or in textual repr: setCollectionNesting(bool)123 function setCollectionNesting(bool enable) external;124125 /// Toggle accessibility of collection nesting.126 ///127 /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'128 /// @param collections Addresses of collections that will be available for nesting.129 /// @dev EVM selector for this function is: 0x64872396,130 /// or in textual repr: setCollectionNesting(bool,address[])131 function setCollectionNesting(bool enable, address[] memory collections)132 external;133134 /// Set the collection access method.135 /// @param mode Access mode136 /// 0 for Normal137 /// 1 for AllowList138 /// @dev EVM selector for this function is: 0x41835d4c,139 /// or in textual repr: setCollectionAccess(uint8)140 function setCollectionAccess(uint8 mode) external;141142 /// Add the user to the allowed list.143 ///144 /// @param user Address of a trusted user.145 /// @dev EVM selector for this function is: 0x67844fe6,146 /// or in textual repr: addToCollectionAllowList(address)147 function addToCollectionAllowList(address user) external;148149 /// Remove the user from the allowed list.150 ///151 /// @param user Address of a removed user.152 /// @dev EVM selector for this function is: 0x85c51acb,153 /// or in textual repr: removeFromCollectionAllowList(address)154 function removeFromCollectionAllowList(address user) external;155156 /// Switch permission for minting.157 ///158 /// @param mode Enable if "true".159 /// @dev EVM selector for this function is: 0x00018e84,160 /// or in textual repr: setCollectionMintMode(bool)161 function setCollectionMintMode(bool mode) external;162163 /// Check that account is the owner or admin of the collection164 ///165 /// @param user account to verify166 /// @return "true" if account is the owner or admin167 /// @dev EVM selector for this function is: 0x9811b0c7,168 /// or in textual repr: isOwnerOrAdmin(address)169 function isOwnerOrAdmin(address user) external view returns (bool);170171 /// Check that substrate account is the owner or admin of the collection172 ///173 /// @param user account to verify174 /// @return "true" if account is the owner or admin175 /// @dev EVM selector for this function is: 0x68910e00,176 /// or in textual repr: isOwnerOrAdminSubstrate(uint256)177 function isOwnerOrAdminSubstrate(uint256 user) external view returns (bool);178179 /// Returns collection type180 ///181 /// @return `Fungible` or `NFT` or `ReFungible`182 /// @dev EVM selector for this function is: 0xd34b55b8,183 /// or in textual repr: uniqueCollectionType()184 function uniqueCollectionType() external returns (string memory);185186 /// Changes collection owner to another account187 ///188 /// @dev Owner can be changed only by current owner189 /// @param newOwner new owner account190 /// @dev EVM selector for this function is: 0x13af4035,191 /// or in textual repr: setOwner(address)192 function setOwner(address newOwner) external;193194 /// Changes collection owner to another substrate account195 ///196 /// @dev Owner can be changed only by current owner197 /// @param newOwner new owner substrate account198 /// @dev EVM selector for this function is: 0xb212138f,199 /// or in textual repr: setOwnerSubstrate(uint256)200 function setOwnerSubstrate(uint256 newOwner) external;201}202203/// @dev the ERC-165 identifier for this interface is 0x79cc6790204interface ERC20UniqueExtensions is Dummy, ERC165 {205 /// @dev EVM selector for this function is: 0x79cc6790,206 /// or in textual repr: burnFrom(address,uint256)207 function burnFrom(address from, uint256 amount) external returns (bool);208}209210/// @dev inlined interface16interface ERC20Events {211interface ERC20Events {17 event Transfer(address indexed from, address indexed to, uint256 value);212 event Transfer(address indexed from, address indexed to, uint256 value);18 event Approval(213 event Approval(22 );217 );23}218}2421925// Selector: 79cc6790220/// @dev the ERC-165 identifier for this interface is 0x942e8b2226interface ERC20UniqueExtensions is Dummy, ERC165 {27 // Selector: burnFrom(address,uint256) 79cc679028 function burnFrom(address from, uint256 amount) external returns (bool);29}3031// Selector: 942e8b2232interface ERC20 is Dummy, ERC165, ERC20Events {221interface ERC20 is Dummy, ERC165, ERC20Events {33 // Selector: name() 06fdde03222 /// @dev EVM selector for this function is: 0x06fdde03,223 /// or in textual repr: name()34 function name() external view returns (string memory);224 function name() external view returns (string memory);3522536 // Selector: symbol() 95d89b41226 /// @dev EVM selector for this function is: 0x95d89b41,227 /// or in textual repr: symbol()37 function symbol() external view returns (string memory);228 function symbol() external view returns (string memory);3822939 // Selector: totalSupply() 18160ddd230 /// @dev EVM selector for this function is: 0x18160ddd,231 /// or in textual repr: totalSupply()40 function totalSupply() external view returns (uint256);232 function totalSupply() external view returns (uint256);4123342 // Selector: decimals() 313ce567234 /// @dev EVM selector for this function is: 0x313ce567,235 /// or in textual repr: decimals()43 function decimals() external view returns (uint8);236 function decimals() external view returns (uint8);44237238 /// @dev EVM selector for this function is: 0x70a08231,45 // Selector: balanceOf(address) 70a08231239 /// or in textual repr: balanceOf(address)46 function balanceOf(address owner) external view returns (uint256);240 function balanceOf(address owner) external view returns (uint256);47241242 /// @dev EVM selector for this function is: 0xa9059cbb,48 // Selector: transfer(address,uint256) a9059cbb243 /// or in textual repr: transfer(address,uint256)49 function transfer(address to, uint256 amount) external returns (bool);244 function transfer(address to, uint256 amount) external returns (bool);50245246 /// @dev EVM selector for this function is: 0x23b872dd,51 // Selector: transferFrom(address,address,uint256) 23b872dd247 /// or in textual repr: transferFrom(address,address,uint256)52 function transferFrom(248 function transferFrom(53 address from,249 address from,54 address to,250 address to,55 uint256 amount251 uint256 amount56 ) external returns (bool);252 ) external returns (bool);57253254 /// @dev EVM selector for this function is: 0x095ea7b3,58 // Selector: approve(address,uint256) 095ea7b3255 /// or in textual repr: approve(address,uint256)59 function approve(address spender, uint256 amount) external returns (bool);256 function approve(address spender, uint256 amount) external returns (bool);60257258 /// @dev EVM selector for this function is: 0xdd62ed3e,61 // Selector: allowance(address,address) dd62ed3e259 /// or in textual repr: allowance(address,address)62 function allowance(address owner, address spender)260 function allowance(address owner, address spender)63 external261 external64 view262 view65 returns (uint256);263 returns (uint256);66}264}6768// Selector: ffe4da2369interface 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) 2f073f6676 function setCollectionProperty(string memory key, bytes memory value)77 external;7879 // Delete collection property.80 //81 // @param key Property key.82 //83 // Selector: deleteCollectionProperty(string) 7b7debce84 function deleteCollectionProperty(string memory key) external;8586 // 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) cf24fd6d94 function collectionProperty(string memory key)95 external96 view97 returns (bytes memory);9899 // 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) 7623402e106 function setCollectionSponsor(address sponsor) external;107108 // Collection sponsorship confirmation.109 //110 // @dev After setting the sponsor for the collection, it must be confirmed with this function.111 //112 // Selector: confirmCollectionSponsorship() 3c50e97a113 function confirmCollectionSponsorship() external;114115 // 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) 6a3841db127 function setCollectionLimit(string memory limit, uint32 value) external;128129 // 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) 993b7fba138 function setCollectionLimit(string memory limit, bool value) external;139140 // Get contract address.141 //142 // Selector: contractAddress() f6b4dfb4143 function contractAddress() external view returns (address);144145 // Add collection admin by substrate address.146 // @param new_admin Substrate administrator address.147 //148 // Selector: addCollectionAdminSubstrate(uint256) 5730062b149 function addCollectionAdminSubstrate(uint256 newAdmin) external;150151 // Remove collection admin by substrate address.152 // @param admin Substrate administrator address.153 //154 // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9155 function removeCollectionAdminSubstrate(uint256 admin) external;156157 // Add collection admin.158 // @param new_admin Address of the added administrator.159 //160 // Selector: addCollectionAdmin(address) 92e462c7161 function addCollectionAdmin(address newAdmin) external;162163 // Remove collection admin.164 //165 // @param new_admin Address of the removed administrator.166 //167 // Selector: removeCollectionAdmin(address) fafd7b42168 function removeCollectionAdmin(address admin) external;169170 // Toggle accessibility of collection nesting.171 //172 // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'173 //174 // Selector: setCollectionNesting(bool) 112d4586175 function setCollectionNesting(bool enable) external;176177 // 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[]) 64872396183 function setCollectionNesting(bool enable, address[] memory collections)184 external;185186 // Set the collection access method.187 // @param mode Access mode188 // 0 for Normal189 // 1 for AllowList190 //191 // Selector: setCollectionAccess(uint8) 41835d4c192 function setCollectionAccess(uint8 mode) external;193194 // Add the user to the allowed list.195 //196 // @param user Address of a trusted user.197 //198 // Selector: addToCollectionAllowList(address) 67844fe6199 function addToCollectionAllowList(address user) external;200201 // Remove the user from the allowed list.202 //203 // @param user Address of a removed user.204 //205 // Selector: removeFromCollectionAllowList(address) 85c51acb206 function removeFromCollectionAllowList(address user) external;207208 // Switch permission for minting.209 //210 // @param mode Enable if "true".211 //212 // Selector: setCollectionMintMode(bool) 00018e84213 function setCollectionMintMode(bool mode) external;214215 // Check that account is the owner or admin of the collection216 //217 // @param user account to verify218 // @return "true" if account is the owner or admin219 //220 // Selector: isOwnerOrAdmin(address) 9811b0c7221 function isOwnerOrAdmin(address user) external view returns (bool);222223 // Check that substrate account is the owner or admin of the collection224 //225 // @param user account to verify226 // @return "true" if account is the owner or admin227 //228 // Selector: isOwnerOrAdminSubstrate(uint256) 68910e00229 function isOwnerOrAdminSubstrate(uint256 user) external view returns (bool);230231 // Returns collection type232 //233 // @return `Fungible` or `NFT` or `ReFungible`234 //235 // Selector: uniqueCollectionType() d34b55b8236 function uniqueCollectionType() external returns (string memory);237238 // Changes collection owner to another account239 //240 // @dev Owner can be changed only by current owner241 // @param newOwner new owner account242 //243 // Selector: setOwner(address) 13af4035244 function setOwner(address newOwner) external;245246 // Changes collection owner to another substrate account247 //248 // @dev Owner can be changed only by current owner249 // @param newOwner new owner substrate account250 //251 // Selector: setOwnerSubstrate(uint256) b212138f252 function setOwnerSubstrate(uint256 newOwner) external;253}254265255interface UniqueFungible is266interface UniqueFungible is256 Dummy,267 Dummy,tests/src/eth/api/UniqueNFT.soldiffbeforeafterboth334pragma solidity >=0.8.0 <0.9.0;4pragma solidity >=0.8.0 <0.9.0;56// Anonymous struct7struct Tuple0 {8 uint256 field_0;9 string field_1;10}11512// Common stubs holder6/// @dev common stubs holder13interface Dummy {7interface Dummy {14815}9}18 function supportsInterface(bytes4 interfaceID) external view returns (bool);12 function supportsInterface(bytes4 interfaceID) external view returns (bool);19}13}201421// Inline15/// @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 0x4136937717interface TokenProperties is Dummy, ERC165 {18 /// @notice Set permissions for token property.19 /// @dev Throws error if `msg.sender` is not admin or owner of the collection.20 /// @param key Property key.21 /// @param isMutable Permission to mutate property.22 /// @param collectionAdmin Permission to mutate property by collection admin if property is mutable.23 /// @param tokenOwner Permission to mutate property by token owner if property is mutable.24 /// @dev EVM selector for this function is: 0x222d97fa,25 /// or in textual repr: setTokenPropertyPermission(string,bool,bool,bool)26 function setTokenPropertyPermission(27 string memory key,28 bool isMutable,29 bool collectionAdmin,30 bool tokenOwner31 ) external;3233 /// @notice Set token property value.34 /// @dev Throws error if `msg.sender` has no permission to edit the property.35 /// @param tokenId ID of the token.36 /// @param key Property key.37 /// @param value Property value.38 /// @dev EVM selector for this function is: 0x1752d67b,39 /// or in textual repr: setProperty(uint256,string,bytes)40 function setProperty(41 uint256 tokenId,42 string memory key,43 bytes memory value44 ) external;4546 /// @notice Delete token property value.47 /// @dev Throws error if `msg.sender` has no permission to edit the property.48 /// @param tokenId ID of the token.49 /// @param key Property key.50 /// @dev EVM selector for this function is: 0x066111d1,51 /// or in textual repr: deleteProperty(uint256,string)52 function deleteProperty(uint256 tokenId, string memory key) external;5354 /// @notice Get token property value.55 /// @dev Throws error if key not found56 /// @param tokenId ID of the token.57 /// @param key Property key.58 /// @return Property value bytes59 /// @dev EVM selector for this function is: 0x7228c327,60 /// or in textual repr: property(uint256,string)61 function property(uint256 tokenId, string memory key)62 external63 view64 returns (bytes memory);65}6667/// @title A contract that allows you to work with collections.68/// @dev the ERC-165 identifier for this interface is 0xffe4da2369interface Collection is Dummy, ERC165 {70 /// Set collection property.71 ///72 /// @param key Property key.73 /// @param value Propery value.74 /// @dev EVM selector for this function is: 0x2f073f66,75 /// or in textual repr: setCollectionProperty(string,bytes)76 function setCollectionProperty(string memory key, bytes memory value)77 external;7879 /// Delete collection property.80 ///81 /// @param key Property key.82 /// @dev EVM selector for this function is: 0x7b7debce,83 /// or in textual repr: deleteCollectionProperty(string)84 function deleteCollectionProperty(string memory key) external;8586 /// 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 /// @dev EVM selector for this function is: 0xcf24fd6d,93 /// or in textual repr: collectionProperty(string)94 function collectionProperty(string memory key)95 external96 view97 returns (bytes memory);9899 /// 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 /// @dev EVM selector for this function is: 0x7623402e,105 /// or in textual repr: setCollectionSponsor(address)106 function setCollectionSponsor(address sponsor) external;107108 /// Collection sponsorship confirmation.109 ///110 /// @dev After setting the sponsor for the collection, it must be confirmed with this function.111 /// @dev EVM selector for this function is: 0x3c50e97a,112 /// or in textual repr: confirmCollectionSponsorship()113 function confirmCollectionSponsorship() external;114115 /// 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 /// @dev EVM selector for this function is: 0x6a3841db,126 /// or in textual repr: setCollectionLimit(string,uint32)127 function setCollectionLimit(string memory limit, uint32 value) external;128129 /// 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 /// @dev EVM selector for this function is: 0x993b7fba,137 /// or in textual repr: setCollectionLimit(string,bool)138 function setCollectionLimit(string memory limit, bool value) external;139140 /// Get contract address.141 /// @dev EVM selector for this function is: 0xf6b4dfb4,142 /// or in textual repr: contractAddress()143 function contractAddress() external view returns (address);144145 /// Add collection admin by substrate address.146 /// @param newAdmin Substrate administrator address.147 /// @dev EVM selector for this function is: 0x5730062b,148 /// or in textual repr: addCollectionAdminSubstrate(uint256)149 function addCollectionAdminSubstrate(uint256 newAdmin) external;150151 /// Remove collection admin by substrate address.152 /// @param admin Substrate administrator address.153 /// @dev EVM selector for this function is: 0x4048fcf9,154 /// or in textual repr: removeCollectionAdminSubstrate(uint256)155 function removeCollectionAdminSubstrate(uint256 admin) external;156157 /// Add collection admin.158 /// @param newAdmin Address of the added administrator.159 /// @dev EVM selector for this function is: 0x92e462c7,160 /// or in textual repr: addCollectionAdmin(address)161 function addCollectionAdmin(address newAdmin) external;162163 /// Remove collection admin.164 ///165 /// @param admin Address of the removed administrator.166 /// @dev EVM selector for this function is: 0xfafd7b42,167 /// or in textual repr: removeCollectionAdmin(address)168 function removeCollectionAdmin(address admin) external;169170 /// Toggle accessibility of collection nesting.171 ///172 /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'173 /// @dev EVM selector for this function is: 0x112d4586,174 /// or in textual repr: setCollectionNesting(bool)175 function setCollectionNesting(bool enable) external;176177 /// 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 /// @dev EVM selector for this function is: 0x64872396,182 /// or in textual repr: setCollectionNesting(bool,address[])183 function setCollectionNesting(bool enable, address[] memory collections)184 external;185186 /// Set the collection access method.187 /// @param mode Access mode188 /// 0 for Normal189 /// 1 for AllowList190 /// @dev EVM selector for this function is: 0x41835d4c,191 /// or in textual repr: setCollectionAccess(uint8)192 function setCollectionAccess(uint8 mode) external;193194 /// Add the user to the allowed list.195 ///196 /// @param user Address of a trusted user.197 /// @dev EVM selector for this function is: 0x67844fe6,198 /// or in textual repr: addToCollectionAllowList(address)199 function addToCollectionAllowList(address user) external;200201 /// Remove the user from the allowed list.202 ///203 /// @param user Address of a removed user.204 /// @dev EVM selector for this function is: 0x85c51acb,205 /// or in textual repr: removeFromCollectionAllowList(address)206 function removeFromCollectionAllowList(address user) external;207208 /// Switch permission for minting.209 ///210 /// @param mode Enable if "true".211 /// @dev EVM selector for this function is: 0x00018e84,212 /// or in textual repr: setCollectionMintMode(bool)213 function setCollectionMintMode(bool mode) external;214215 /// Check that account is the owner or admin of the collection216 ///217 /// @param user account to verify218 /// @return "true" if account is the owner or admin219 /// @dev EVM selector for this function is: 0x9811b0c7,220 /// or in textual repr: isOwnerOrAdmin(address)221 function isOwnerOrAdmin(address user) external view returns (bool);222223 /// Check that substrate account is the owner or admin of the collection224 ///225 /// @param user account to verify226 /// @return "true" if account is the owner or admin227 /// @dev EVM selector for this function is: 0x68910e00,228 /// or in textual repr: isOwnerOrAdminSubstrate(uint256)229 function isOwnerOrAdminSubstrate(uint256 user) external view returns (bool);230231 /// Returns collection type232 ///233 /// @return `Fungible` or `NFT` or `ReFungible`234 /// @dev EVM selector for this function is: 0xd34b55b8,235 /// or in textual repr: uniqueCollectionType()236 function uniqueCollectionType() external returns (string memory);237238 /// Changes collection owner to another account239 ///240 /// @dev Owner can be changed only by current owner241 /// @param newOwner new owner account242 /// @dev EVM selector for this function is: 0x13af4035,243 /// or in textual repr: setOwner(address)244 function setOwner(address newOwner) external;245246 /// Changes collection owner to another substrate account247 ///248 /// @dev Owner can be changed only by current owner249 /// @param newOwner new owner substrate account250 /// @dev EVM selector for this function is: 0xb212138f,251 /// or in textual repr: setOwnerSubstrate(uint256)252 function setOwnerSubstrate(uint256 newOwner) external;253}254255/// @title ERC721 Token that can be irreversibly burned (destroyed).256/// @dev the ERC-165 identifier for this interface is 0x42966c68257interface ERC721Burnable is Dummy, ERC165 {258 /// @notice Burns a specific ERC721 token.259 /// @dev Throws unless `msg.sender` is the current NFT owner, or an authorized260 /// operator of the current owner.261 /// @param tokenId The NFT to approve262 /// @dev EVM selector for this function is: 0x42966c68,263 /// or in textual repr: burn(uint256)264 function burn(uint256 tokenId) external;265}266267/// @dev inlined interface268interface ERC721MintableEvents {269 event MintingFinished();270}271272/// @title ERC721 minting logic.273/// @dev the ERC-165 identifier for this interface is 0x68ccfe89274interface ERC721Mintable is Dummy, ERC165, ERC721MintableEvents {275 /// @dev EVM selector for this function is: 0x05d2035b,276 /// or in textual repr: mintingFinished()277 function mintingFinished() external view returns (bool);278279 /// @notice Function to mint token.280 /// @dev `tokenId` should be obtained with `nextTokenId` method,281 /// unlike standard, you can't specify it manually282 /// @param to The new owner283 /// @param tokenId ID of the minted NFT284 /// @dev EVM selector for this function is: 0x40c10f19,285 /// or in textual repr: mint(address,uint256)286 function mint(address to, uint256 tokenId) external returns (bool);287288 /// @notice Function to mint token with the given tokenUri.289 /// @dev `tokenId` should be obtained with `nextTokenId` method,290 /// unlike standard, you can't specify it manually291 /// @param to The new owner292 /// @param tokenId ID of the minted NFT293 /// @param tokenUri Token URI that would be stored in the NFT properties294 /// @dev EVM selector for this function is: 0x50bb4e7f,295 /// or in textual repr: mintWithTokenURI(address,uint256,string)296 function mintWithTokenURI(297 address to,298 uint256 tokenId,299 string memory tokenUri300 ) external returns (bool);301302 /// @dev Not implemented303 /// @dev EVM selector for this function is: 0x7d64bcb4,304 /// or in textual repr: finishMinting()305 function finishMinting() external returns (bool);306}307308/// @title Unique extensions for ERC721.309/// @dev the ERC-165 identifier for this interface is 0xd74d154f310interface ERC721UniqueExtensions is Dummy, ERC165 {311 /// @notice Transfer ownership of an NFT312 /// @dev Throws unless `msg.sender` is the current owner. Throws if `to`313 /// is the zero address. Throws if `tokenId` is not a valid NFT.314 /// @param to The new owner315 /// @param tokenId The NFT to transfer316 /// @dev EVM selector for this function is: 0xa9059cbb,317 /// or in textual repr: transfer(address,uint256)318 function transfer(address to, uint256 tokenId) external;319320 /// @notice Burns a specific ERC721 token.321 /// @dev Throws unless `msg.sender` is the current owner or an authorized322 /// operator for this NFT. Throws if `from` is not the current owner. Throws323 /// if `to` is the zero address. Throws if `tokenId` is not a valid NFT.324 /// @param from The current owner of the NFT325 /// @param tokenId The NFT to transfer326 /// @dev EVM selector for this function is: 0x79cc6790,327 /// or in textual repr: burnFrom(address,uint256)328 function burnFrom(address from, uint256 tokenId) external;329330 /// @notice Returns next free NFT ID.331 /// @dev EVM selector for this function is: 0x75794a3c,332 /// or in textual repr: nextTokenId()333 function nextTokenId() external view returns (uint256);334335 /// @notice Function to mint multiple tokens.336 /// @dev `tokenIds` should be an array of consecutive numbers and first number337 /// should be obtained with `nextTokenId` method338 /// @param to The new owner339 /// @param tokenIds IDs of the minted NFTs340 /// @dev EVM selector for this function is: 0x44a9945e,341 /// or in textual repr: mintBulk(address,uint256[])342 function mintBulk(address to, uint256[] memory tokenIds)343 external344 returns (bool);345346 /// @notice Function to mint multiple tokens with the given tokenUris.347 /// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive348 /// numbers and first number should be obtained with `nextTokenId` method349 /// @param to The new owner350 /// @param tokens array of pairs of token ID and token URI for minted tokens351 /// @dev EVM selector for this function is: 0x36543006,352 /// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[])353 function mintBulkWithTokenURI(address to, Tuple8[] memory tokens)354 external355 returns (bool);356}357358/// @dev anonymous struct359struct Tuple8 {360 uint256 field_0;361 string field_1;362}363364/// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension365/// @dev See https://eips.ethereum.org/EIPS/eip-721366/// @dev the ERC-165 identifier for this interface is 0x780e9d63367interface ERC721Enumerable is Dummy, ERC165 {368 /// @notice Enumerate valid NFTs369 /// @param index A counter less than `totalSupply()`370 /// @return The token identifier for the `index`th NFT,371 /// (sort order not specified)372 /// @dev EVM selector for this function is: 0x4f6ccce7,373 /// or in textual repr: tokenByIndex(uint256)374 function tokenByIndex(uint256 index) external view returns (uint256);375376 /// @dev Not implemented377 /// @dev EVM selector for this function is: 0x2f745c59,378 /// or in textual repr: tokenOfOwnerByIndex(address,uint256)379 function tokenOfOwnerByIndex(address owner, uint256 index)380 external381 view382 returns (uint256);383384 /// @notice Count NFTs tracked by this contract385 /// @return A count of valid NFTs tracked by this contract, where each one of386 /// them has an assigned and queryable owner not equal to the zero address387 /// @dev EVM selector for this function is: 0x18160ddd,388 /// or in textual repr: totalSupply()389 function totalSupply() external view returns (uint256);390}391392/// @title ERC-721 Non-Fungible Token Standard, optional metadata extension393/// @dev See https://eips.ethereum.org/EIPS/eip-721394/// @dev the ERC-165 identifier for this interface is 0x5b5e139f395interface ERC721Metadata is Dummy, ERC165 {396 /// @notice A descriptive name for a collection of NFTs in this contract397 /// @dev EVM selector for this function is: 0x06fdde03,398 /// or in textual repr: name()399 function name() external view returns (string memory);400401 /// @notice An abbreviated name for NFTs in this contract402 /// @dev EVM selector for this function is: 0x95d89b41,403 /// or in textual repr: symbol()404 function symbol() external view returns (string memory);405406 /// @notice A distinct Uniform Resource Identifier (URI) for a given asset.407 ///408 /// @dev If the token has a `url` property and it is not empty, it is returned.409 /// 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`.410 /// If the collection property `baseURI` is empty or absent, return "" (empty string)411 /// otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix412 /// otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings).413 ///414 /// @return token's const_metadata415 /// @dev EVM selector for this function is: 0xc87b56dd,416 /// or in textual repr: tokenURI(uint256)417 function tokenURI(uint256 tokenId) external view returns (string memory);418}419420/// @dev inlined interface22interface ERC721Events {421interface ERC721Events {23 event Transfer(422 event Transfer(24 address indexed from,423 address indexed from,37 );436 );38}437}3943840// Inline439/// @title ERC-721 Non-Fungible Token Standard41interface ERC721MintableEvents {440/// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md42 event MintingFinished();441/// @dev the ERC-165 identifier for this interface is 0x80ac58cd43}4445// Selector: 4136937746interface TokenProperties is Dummy, ERC165 {47 // @notice Set permissions for token property.48 // @dev Throws error if `msg.sender` is not admin or owner of the collection.49 // @param key Property key.50 // @param is_mutable Permission to mutate property.51 // @param collection_admin Permission to mutate property by collection admin if property is mutable.52 // @param token_owner Permission to mutate property by token owner if property is mutable.53 //54 // Selector: setTokenPropertyPermission(string,bool,bool,bool) 222d97fa55 function setTokenPropertyPermission(56 string memory key,57 bool isMutable,58 bool collectionAdmin,59 bool tokenOwner60 ) external;6162 // @notice Set token property value.63 // @dev Throws error if `msg.sender` has no permission to edit the property.64 // @param tokenId ID of the token.65 // @param key Property key.66 // @param value Property value.67 //68 // Selector: setProperty(uint256,string,bytes) 1752d67b69 function setProperty(70 uint256 tokenId,71 string memory key,72 bytes memory value73 ) external;7475 // @notice Delete token property value.76 // @dev Throws error if `msg.sender` has no permission to edit the property.77 // @param tokenId ID of the token.78 // @param key Property key.79 //80 // Selector: deleteProperty(uint256,string) 066111d181 function deleteProperty(uint256 tokenId, string memory key) external;8283 // @notice Get token property value.84 // @dev Throws error if key not found85 // @param tokenId ID of the token.86 // @param key Property key.87 // @return Property value bytes88 //89 // Selector: property(uint256,string) 7228c32790 function property(uint256 tokenId, string memory key)91 external92 view93 returns (bytes memory);94}9596// Selector: 42966c6897interface ERC721Burnable is Dummy, ERC165 {98 // @notice Burns a specific ERC721 token.99 // @dev Throws unless `msg.sender` is the current NFT owner, or an authorized100 // operator of the current owner.101 // @param tokenId The NFT to approve102 //103 // Selector: burn(uint256) 42966c68104 function burn(uint256 tokenId) external;105}106107// Selector: 58800161108interface ERC721 is Dummy, ERC165, ERC721Events {442interface ERC721 is Dummy, ERC165, ERC721Events {109 // @notice Count all NFTs assigned to an owner443 /// @notice Count all NFTs assigned to an owner110 // @dev NFTs assigned to the zero address are considered invalid, and this444 /// @dev NFTs assigned to the zero address are considered invalid, and this111 // function throws for queries about the zero address.445 /// function throws for queries about the zero address.112 // @param owner An address for whom to query the balance446 /// @param owner An address for whom to query the balance113 // @return The number of NFTs owned by `owner`, possibly zero447 /// @return The number of NFTs owned by `owner`, possibly zero114 //448 /// @dev EVM selector for this function is: 0x70a08231,115 // Selector: balanceOf(address) 70a08231449 /// or in textual repr: balanceOf(address)116 function balanceOf(address owner) external view returns (uint256);450 function balanceOf(address owner) external view returns (uint256);117451118 // @notice Find the owner of an NFT452 /// @notice Find the owner of an NFT119 // @dev NFTs assigned to zero address are considered invalid, and queries453 /// @dev NFTs assigned to zero address are considered invalid, and queries120 // about them do throw.454 /// about them do throw.121 // @param tokenId The identifier for an NFT455 /// @param tokenId The identifier for an NFT122 // @return The address of the owner of the NFT456 /// @return The address of the owner of the NFT123 //457 /// @dev EVM selector for this function is: 0x6352211e,124 // Selector: ownerOf(uint256) 6352211e458 /// or in textual repr: ownerOf(uint256)125 function ownerOf(uint256 tokenId) external view returns (address);459 function ownerOf(uint256 tokenId) external view returns (address);126460127 // @dev Not implemented461 /// @dev Not implemented128 //462 /// @dev EVM selector for this function is: 0xb88d4fde,129 // Selector: safeTransferFromWithData(address,address,uint256,bytes) 60a11672463 /// or in textual repr: safeTransferFrom(address,address,uint256,bytes)130 function safeTransferFromWithData(464 function safeTransferFrom(131 address from,465 address from,132 address to,466 address to,133 uint256 tokenId,467 uint256 tokenId,134 bytes memory data468 bytes memory data135 ) external;469 ) external;136470137 // @dev Not implemented471 /// @dev Not implemented138 //472 /// @dev EVM selector for this function is: 0x42842e0e,139 // Selector: safeTransferFrom(address,address,uint256) 42842e0e473 /// or in textual repr: safeTransferFrom(address,address,uint256)140 function safeTransferFrom(474 function safeTransferFrom(141 address from,475 address from,142 address to,476 address to,143 uint256 tokenId477 uint256 tokenId144 ) external;478 ) external;145479146 // @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE480 /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE147 // TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE481 /// TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE148 // THEY MAY BE PERMANENTLY LOST482 /// THEY MAY BE PERMANENTLY LOST149 // @dev Throws unless `msg.sender` is the current owner or an authorized483 /// @dev Throws unless `msg.sender` is the current owner or an authorized150 // operator for this NFT. Throws if `from` is not the current owner. Throws484 /// operator for this NFT. Throws if `from` is not the current owner. Throws151 // if `to` is the zero address. Throws if `tokenId` is not a valid NFT.485 /// if `to` is the zero address. Throws if `tokenId` is not a valid NFT.152 // @param from The current owner of the NFT486 /// @param from The current owner of the NFT153 // @param to The new owner487 /// @param to The new owner154 // @param tokenId The NFT to transfer488 /// @param tokenId The NFT to transfer155 // @param _value Not used for an NFT489 /// @dev EVM selector for this function is: 0x23b872dd,156 //157 // Selector: transferFrom(address,address,uint256) 23b872dd490 /// or in textual repr: transferFrom(address,address,uint256)158 function transferFrom(491 function transferFrom(159 address from,492 address from,160 address to,493 address to,161 uint256 tokenId494 uint256 tokenId162 ) external;495 ) external;163496164 // @notice Set or reaffirm the approved address for an NFT497 /// @notice Set or reaffirm the approved address for an NFT165 // @dev The zero address indicates there is no approved address.498 /// @dev The zero address indicates there is no approved address.166 // @dev Throws unless `msg.sender` is the current NFT owner, or an authorized499 /// @dev Throws unless `msg.sender` is the current NFT owner, or an authorized167 // operator of the current owner.500 /// operator of the current owner.168 // @param approved The new approved NFT controller501 /// @param approved The new approved NFT controller169 // @param tokenId The NFT to approve502 /// @param tokenId The NFT to approve170 //503 /// @dev EVM selector for this function is: 0x095ea7b3,171 // Selector: approve(address,uint256) 095ea7b3504 /// or in textual repr: approve(address,uint256)172 function approve(address approved, uint256 tokenId) external;505 function approve(address approved, uint256 tokenId) external;173506174 // @dev Not implemented507 /// @dev Not implemented175 //508 /// @dev EVM selector for this function is: 0xa22cb465,176 // Selector: setApprovalForAll(address,bool) a22cb465509 /// or in textual repr: setApprovalForAll(address,bool)177 function setApprovalForAll(address operator, bool approved) external;510 function setApprovalForAll(address operator, bool approved) external;178511179 // @dev Not implemented512 /// @dev Not implemented180 //513 /// @dev EVM selector for this function is: 0x081812fc,181 // Selector: getApproved(uint256) 081812fc514 /// or in textual repr: getApproved(uint256)182 function getApproved(uint256 tokenId) external view returns (address);515 function getApproved(uint256 tokenId) external view returns (address);183516184 // @dev Not implemented517 /// @dev Not implemented185 //518 /// @dev EVM selector for this function is: 0xe985e9c5,186 // Selector: isApprovedForAll(address,address) e985e9c5519 /// or in textual repr: isApprovedForAll(address,address)187 function isApprovedForAll(address owner, address operator)520 function isApprovedForAll(address owner, address operator)188 external521 external189 view522 view190 returns (address);523 returns (address);191}524}192193// Selector: 5b5e139f194interface ERC721Metadata is Dummy, ERC165 {195 // @notice A descriptive name for a collection of NFTs in this contract196 //197 // Selector: name() 06fdde03198 function name() external view returns (string memory);199200 // @notice An abbreviated name for NFTs in this contract201 //202 // Selector: symbol() 95d89b41203 function symbol() external view returns (string memory);204205 // @notice A distinct Uniform Resource Identifier (URI) for a given asset.206 //207 // @dev If the token has a `url` property and it is not empty, it is returned.208 // 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`.209 // If the collection property `baseURI` is empty or absent, return "" (empty string)210 // otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix211 // otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings).212 //213 // @return token's const_metadata214 //215 // Selector: tokenURI(uint256) c87b56dd216 function tokenURI(uint256 tokenId) external view returns (string memory);217}218219// Selector: 68ccfe89220interface ERC721Mintable is Dummy, ERC165, ERC721MintableEvents {221 // Selector: mintingFinished() 05d2035b222 function mintingFinished() external view returns (bool);223224 // @notice Function to mint token.225 // @dev `tokenId` should be obtained with `nextTokenId` method,226 // unlike standard, you can't specify it manually227 // @param to The new owner228 // @param tokenId ID of the minted NFT229 //230 // Selector: mint(address,uint256) 40c10f19231 function mint(address to, uint256 tokenId) external returns (bool);232233 // @notice Function to mint token with the given tokenUri.234 // @dev `tokenId` should be obtained with `nextTokenId` method,235 // unlike standard, you can't specify it manually236 // @param to The new owner237 // @param tokenId ID of the minted NFT238 // @param tokenUri Token URI that would be stored in the NFT properties239 //240 // Selector: mintWithTokenURI(address,uint256,string) 50bb4e7f241 function mintWithTokenURI(242 address to,243 uint256 tokenId,244 string memory tokenUri245 ) external returns (bool);246247 // @dev Not implemented248 //249 // Selector: finishMinting() 7d64bcb4250 function finishMinting() external returns (bool);251}252253// Selector: 780e9d63254interface ERC721Enumerable is Dummy, ERC165 {255 // @notice Enumerate valid NFTs256 // @param index A counter less than `totalSupply()`257 // @return The token identifier for the `index`th NFT,258 // (sort order not specified)259 //260 // Selector: tokenByIndex(uint256) 4f6ccce7261 function tokenByIndex(uint256 index) external view returns (uint256);262263 // @dev Not implemented264 //265 // Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59266 function tokenOfOwnerByIndex(address owner, uint256 index)267 external268 view269 returns (uint256);270271 // @notice Count NFTs tracked by this contract272 // @return A count of valid NFTs tracked by this contract, where each one of273 // them has an assigned and queryable owner not equal to the zero address274 //275 // Selector: totalSupply() 18160ddd276 function totalSupply() external view returns (uint256);277}278279// Selector: d74d154f280interface ERC721UniqueExtensions is Dummy, ERC165 {281 // @notice Transfer ownership of an NFT282 // @dev Throws unless `msg.sender` is the current owner. Throws if `to`283 // is the zero address. Throws if `tokenId` is not a valid NFT.284 // @param to The new owner285 // @param tokenId The NFT to transfer286 // @param _value Not used for an NFT287 //288 // Selector: transfer(address,uint256) a9059cbb289 function transfer(address to, uint256 tokenId) external;290291 // @notice Burns a specific ERC721 token.292 // @dev Throws unless `msg.sender` is the current owner or an authorized293 // operator for this NFT. Throws if `from` is not the current owner. Throws294 // if `to` is the zero address. Throws if `tokenId` is not a valid NFT.295 // @param from The current owner of the NFT296 // @param tokenId The NFT to transfer297 // @param _value Not used for an NFT298 //299 // Selector: burnFrom(address,uint256) 79cc6790300 function burnFrom(address from, uint256 tokenId) external;301302 // @notice Returns next free NFT ID.303 //304 // Selector: nextTokenId() 75794a3c305 function nextTokenId() external view returns (uint256);306307 // @notice Function to mint multiple tokens.308 // @dev `tokenIds` should be an array of consecutive numbers and first number309 // should be obtained with `nextTokenId` method310 // @param to The new owner311 // @param tokenIds IDs of the minted NFTs312 //313 // Selector: mintBulk(address,uint256[]) 44a9945e314 function mintBulk(address to, uint256[] memory tokenIds)315 external316 returns (bool);317318 // @notice Function to mint multiple tokens with the given tokenUris.319 // @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive320 // numbers and first number should be obtained with `nextTokenId` method321 // @param to The new owner322 // @param tokens array of pairs of token ID and token URI for minted tokens323 //324 // Selector: mintBulkWithTokenURI(address,(uint256,string)[]) 36543006325 function mintBulkWithTokenURI(address to, Tuple0[] memory tokens)326 external327 returns (bool);328}329330// Selector: ffe4da23331interface 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) 2f073f66338 function setCollectionProperty(string memory key, bytes memory value)339 external;340341 // Delete collection property.342 //343 // @param key Property key.344 //345 // Selector: deleteCollectionProperty(string) 7b7debce346 function deleteCollectionProperty(string memory key) external;347348 // 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) cf24fd6d356 function collectionProperty(string memory key)357 external358 view359 returns (bytes memory);360361 // 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) 7623402e368 function setCollectionSponsor(address sponsor) external;369370 // Collection sponsorship confirmation.371 //372 // @dev After setting the sponsor for the collection, it must be confirmed with this function.373 //374 // Selector: confirmCollectionSponsorship() 3c50e97a375 function confirmCollectionSponsorship() external;376377 // 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) 6a3841db389 function setCollectionLimit(string memory limit, uint32 value) external;390391 // 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) 993b7fba400 function setCollectionLimit(string memory limit, bool value) external;401402 // Get contract address.403 //404 // Selector: contractAddress() f6b4dfb4405 function contractAddress() external view returns (address);406407 // Add collection admin by substrate address.408 // @param new_admin Substrate administrator address.409 //410 // Selector: addCollectionAdminSubstrate(uint256) 5730062b411 function addCollectionAdminSubstrate(uint256 newAdmin) external;412413 // Remove collection admin by substrate address.414 // @param admin Substrate administrator address.415 //416 // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9417 function removeCollectionAdminSubstrate(uint256 admin) external;418419 // Add collection admin.420 // @param new_admin Address of the added administrator.421 //422 // Selector: addCollectionAdmin(address) 92e462c7423 function addCollectionAdmin(address newAdmin) external;424425 // Remove collection admin.426 //427 // @param new_admin Address of the removed administrator.428 //429 // Selector: removeCollectionAdmin(address) fafd7b42430 function removeCollectionAdmin(address admin) external;431432 // Toggle accessibility of collection nesting.433 //434 // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'435 //436 // Selector: setCollectionNesting(bool) 112d4586437 function setCollectionNesting(bool enable) external;438439 // 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[]) 64872396445 function setCollectionNesting(bool enable, address[] memory collections)446 external;447448 // Set the collection access method.449 // @param mode Access mode450 // 0 for Normal451 // 1 for AllowList452 //453 // Selector: setCollectionAccess(uint8) 41835d4c454 function setCollectionAccess(uint8 mode) external;455456 // Add the user to the allowed list.457 //458 // @param user Address of a trusted user.459 //460 // Selector: addToCollectionAllowList(address) 67844fe6461 function addToCollectionAllowList(address user) external;462463 // Remove the user from the allowed list.464 //465 // @param user Address of a removed user.466 //467 // Selector: removeFromCollectionAllowList(address) 85c51acb468 function removeFromCollectionAllowList(address user) external;469470 // Switch permission for minting.471 //472 // @param mode Enable if "true".473 //474 // Selector: setCollectionMintMode(bool) 00018e84475 function setCollectionMintMode(bool mode) external;476477 // Check that account is the owner or admin of the collection478 //479 // @param user account to verify480 // @return "true" if account is the owner or admin481 //482 // Selector: isOwnerOrAdmin(address) 9811b0c7483 function isOwnerOrAdmin(address user) external view returns (bool);484485 // Check that substrate account is the owner or admin of the collection486 //487 // @param user account to verify488 // @return "true" if account is the owner or admin489 //490 // Selector: isOwnerOrAdminSubstrate(uint256) 68910e00491 function isOwnerOrAdminSubstrate(uint256 user) external view returns (bool);492493 // Returns collection type494 //495 // @return `Fungible` or `NFT` or `ReFungible`496 //497 // Selector: uniqueCollectionType() d34b55b8498 function uniqueCollectionType() external returns (string memory);499500 // Changes collection owner to another account501 //502 // @dev Owner can be changed only by current owner503 // @param newOwner new owner account504 //505 // Selector: setOwner(address) 13af4035506 function setOwner(address newOwner) external;507508 // Changes collection owner to another substrate account509 //510 // @dev Owner can be changed only by current owner511 // @param newOwner new owner substrate account512 //513 // Selector: setOwnerSubstrate(uint256) b212138f514 function setOwnerSubstrate(uint256 newOwner) external;515}516525517interface UniqueNFT is526interface UniqueNFT is518 Dummy,527 Dummy,tests/src/eth/api/UniqueRefungible.soldiffbeforeafterboth334pragma solidity >=0.8.0 <0.9.0;4pragma solidity >=0.8.0 <0.9.0;56// Anonymous struct7struct Tuple0 {8 uint256 field_0;9 string field_1;10}11512// Common stubs holder6/// @dev common stubs holder13interface Dummy {7interface Dummy {14815}9}18 function supportsInterface(bytes4 interfaceID) external view returns (bool);12 function supportsInterface(bytes4 interfaceID) external view returns (bool);19}13}201421// Inline15/// @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 0x4136937717interface TokenProperties is Dummy, ERC165 {18 /// @notice Set permissions for token property.19 /// @dev Throws error if `msg.sender` is not admin or owner of the collection.20 /// @param key Property key.21 /// @param isMutable Permission to mutate property.22 /// @param collectionAdmin Permission to mutate property by collection admin if property is mutable.23 /// @param tokenOwner Permission to mutate property by token owner if property is mutable.24 /// @dev EVM selector for this function is: 0x222d97fa,25 /// or in textual repr: setTokenPropertyPermission(string,bool,bool,bool)26 function setTokenPropertyPermission(27 string memory key,28 bool isMutable,29 bool collectionAdmin,30 bool tokenOwner31 ) external;3233 /// @notice Set token property value.34 /// @dev Throws error if `msg.sender` has no permission to edit the property.35 /// @param tokenId ID of the token.36 /// @param key Property key.37 /// @param value Property value.38 /// @dev EVM selector for this function is: 0x1752d67b,39 /// or in textual repr: setProperty(uint256,string,bytes)40 function setProperty(41 uint256 tokenId,42 string memory key,43 bytes memory value44 ) external;4546 /// @notice Delete token property value.47 /// @dev Throws error if `msg.sender` has no permission to edit the property.48 /// @param tokenId ID of the token.49 /// @param key Property key.50 /// @dev EVM selector for this function is: 0x066111d1,51 /// or in textual repr: deleteProperty(uint256,string)52 function deleteProperty(uint256 tokenId, string memory key) external;5354 /// @notice Get token property value.55 /// @dev Throws error if key not found56 /// @param tokenId ID of the token.57 /// @param key Property key.58 /// @return Property value bytes59 /// @dev EVM selector for this function is: 0x7228c327,60 /// or in textual repr: property(uint256,string)61 function property(uint256 tokenId, string memory key)62 external63 view64 returns (bytes memory);65}6667/// @title A contract that allows you to work with collections.68/// @dev the ERC-165 identifier for this interface is 0xffe4da2369interface Collection is Dummy, ERC165 {70 /// Set collection property.71 ///72 /// @param key Property key.73 /// @param value Propery value.74 /// @dev EVM selector for this function is: 0x2f073f66,75 /// or in textual repr: setCollectionProperty(string,bytes)76 function setCollectionProperty(string memory key, bytes memory value)77 external;7879 /// Delete collection property.80 ///81 /// @param key Property key.82 /// @dev EVM selector for this function is: 0x7b7debce,83 /// or in textual repr: deleteCollectionProperty(string)84 function deleteCollectionProperty(string memory key) external;8586 /// 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 /// @dev EVM selector for this function is: 0xcf24fd6d,93 /// or in textual repr: collectionProperty(string)94 function collectionProperty(string memory key)95 external96 view97 returns (bytes memory);9899 /// 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 /// @dev EVM selector for this function is: 0x7623402e,105 /// or in textual repr: setCollectionSponsor(address)106 function setCollectionSponsor(address sponsor) external;107108 /// Collection sponsorship confirmation.109 ///110 /// @dev After setting the sponsor for the collection, it must be confirmed with this function.111 /// @dev EVM selector for this function is: 0x3c50e97a,112 /// or in textual repr: confirmCollectionSponsorship()113 function confirmCollectionSponsorship() external;114115 /// 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 /// @dev EVM selector for this function is: 0x6a3841db,126 /// or in textual repr: setCollectionLimit(string,uint32)127 function setCollectionLimit(string memory limit, uint32 value) external;128129 /// 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 /// @dev EVM selector for this function is: 0x993b7fba,137 /// or in textual repr: setCollectionLimit(string,bool)138 function setCollectionLimit(string memory limit, bool value) external;139140 /// Get contract address.141 /// @dev EVM selector for this function is: 0xf6b4dfb4,142 /// or in textual repr: contractAddress()143 function contractAddress() external view returns (address);144145 /// Add collection admin by substrate address.146 /// @param newAdmin Substrate administrator address.147 /// @dev EVM selector for this function is: 0x5730062b,148 /// or in textual repr: addCollectionAdminSubstrate(uint256)149 function addCollectionAdminSubstrate(uint256 newAdmin) external;150151 /// Remove collection admin by substrate address.152 /// @param admin Substrate administrator address.153 /// @dev EVM selector for this function is: 0x4048fcf9,154 /// or in textual repr: removeCollectionAdminSubstrate(uint256)155 function removeCollectionAdminSubstrate(uint256 admin) external;156157 /// Add collection admin.158 /// @param newAdmin Address of the added administrator.159 /// @dev EVM selector for this function is: 0x92e462c7,160 /// or in textual repr: addCollectionAdmin(address)161 function addCollectionAdmin(address newAdmin) external;162163 /// Remove collection admin.164 ///165 /// @param admin Address of the removed administrator.166 /// @dev EVM selector for this function is: 0xfafd7b42,167 /// or in textual repr: removeCollectionAdmin(address)168 function removeCollectionAdmin(address admin) external;169170 /// Toggle accessibility of collection nesting.171 ///172 /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'173 /// @dev EVM selector for this function is: 0x112d4586,174 /// or in textual repr: setCollectionNesting(bool)175 function setCollectionNesting(bool enable) external;176177 /// 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 /// @dev EVM selector for this function is: 0x64872396,182 /// or in textual repr: setCollectionNesting(bool,address[])183 function setCollectionNesting(bool enable, address[] memory collections)184 external;185186 /// Set the collection access method.187 /// @param mode Access mode188 /// 0 for Normal189 /// 1 for AllowList190 /// @dev EVM selector for this function is: 0x41835d4c,191 /// or in textual repr: setCollectionAccess(uint8)192 function setCollectionAccess(uint8 mode) external;193194 /// Add the user to the allowed list.195 ///196 /// @param user Address of a trusted user.197 /// @dev EVM selector for this function is: 0x67844fe6,198 /// or in textual repr: addToCollectionAllowList(address)199 function addToCollectionAllowList(address user) external;200201 /// Remove the user from the allowed list.202 ///203 /// @param user Address of a removed user.204 /// @dev EVM selector for this function is: 0x85c51acb,205 /// or in textual repr: removeFromCollectionAllowList(address)206 function removeFromCollectionAllowList(address user) external;207208 /// Switch permission for minting.209 ///210 /// @param mode Enable if "true".211 /// @dev EVM selector for this function is: 0x00018e84,212 /// or in textual repr: setCollectionMintMode(bool)213 function setCollectionMintMode(bool mode) external;214215 /// Check that account is the owner or admin of the collection216 ///217 /// @param user account to verify218 /// @return "true" if account is the owner or admin219 /// @dev EVM selector for this function is: 0x9811b0c7,220 /// or in textual repr: isOwnerOrAdmin(address)221 function isOwnerOrAdmin(address user) external view returns (bool);222223 /// Check that substrate account is the owner or admin of the collection224 ///225 /// @param user account to verify226 /// @return "true" if account is the owner or admin227 /// @dev EVM selector for this function is: 0x68910e00,228 /// or in textual repr: isOwnerOrAdminSubstrate(uint256)229 function isOwnerOrAdminSubstrate(uint256 user) external view returns (bool);230231 /// Returns collection type232 ///233 /// @return `Fungible` or `NFT` or `ReFungible`234 /// @dev EVM selector for this function is: 0xd34b55b8,235 /// or in textual repr: uniqueCollectionType()236 function uniqueCollectionType() external returns (string memory);237238 /// Changes collection owner to another account239 ///240 /// @dev Owner can be changed only by current owner241 /// @param newOwner new owner account242 /// @dev EVM selector for this function is: 0x13af4035,243 /// or in textual repr: setOwner(address)244 function setOwner(address newOwner) external;245246 /// Changes collection owner to another substrate account247 ///248 /// @dev Owner can be changed only by current owner249 /// @param newOwner new owner substrate account250 /// @dev EVM selector for this function is: 0xb212138f,251 /// or in textual repr: setOwnerSubstrate(uint256)252 function setOwnerSubstrate(uint256 newOwner) external;253}254255/// @title ERC721 Token that can be irreversibly burned (destroyed).256/// @dev the ERC-165 identifier for this interface is 0x42966c68257interface ERC721Burnable is Dummy, ERC165 {258 /// @notice Burns a specific ERC721 token.259 /// @dev Throws unless `msg.sender` is the current RFT owner, or an authorized260 /// operator of the current owner.261 /// @param tokenId The RFT to approve262 /// @dev EVM selector for this function is: 0x42966c68,263 /// or in textual repr: burn(uint256)264 function burn(uint256 tokenId) external;265}266267/// @dev inlined interface268interface ERC721MintableEvents {269 event MintingFinished();270}271272/// @title ERC721 minting logic.273/// @dev the ERC-165 identifier for this interface is 0x68ccfe89274interface ERC721Mintable is Dummy, ERC165, ERC721MintableEvents {275 /// @dev EVM selector for this function is: 0x05d2035b,276 /// or in textual repr: mintingFinished()277 function mintingFinished() external view returns (bool);278279 /// @notice Function to mint token.280 /// @dev `tokenId` should be obtained with `nextTokenId` method,281 /// unlike standard, you can't specify it manually282 /// @param to The new owner283 /// @param tokenId ID of the minted RFT284 /// @dev EVM selector for this function is: 0x40c10f19,285 /// or in textual repr: mint(address,uint256)286 function mint(address to, uint256 tokenId) external returns (bool);287288 /// @notice Function to mint token with the given tokenUri.289 /// @dev `tokenId` should be obtained with `nextTokenId` method,290 /// unlike standard, you can't specify it manually291 /// @param to The new owner292 /// @param tokenId ID of the minted RFT293 /// @param tokenUri Token URI that would be stored in the RFT properties294 /// @dev EVM selector for this function is: 0x50bb4e7f,295 /// or in textual repr: mintWithTokenURI(address,uint256,string)296 function mintWithTokenURI(297 address to,298 uint256 tokenId,299 string memory tokenUri300 ) external returns (bool);301302 /// @dev Not implemented303 /// @dev EVM selector for this function is: 0x7d64bcb4,304 /// or in textual repr: finishMinting()305 function finishMinting() external returns (bool);306}307308/// @title Unique extensions for ERC721.309/// @dev the ERC-165 identifier for this interface is 0x7c3bef89310interface ERC721UniqueExtensions is Dummy, ERC165 {311 /// @notice Transfer ownership of an RFT312 /// @dev Throws unless `msg.sender` is the current owner. Throws if `to`313 /// is the zero address. Throws if `tokenId` is not a valid RFT.314 /// Throws if RFT pieces have multiple owners.315 /// @param to The new owner316 /// @param tokenId The RFT to transfer317 /// @dev EVM selector for this function is: 0xa9059cbb,318 /// or in textual repr: transfer(address,uint256)319 function transfer(address to, uint256 tokenId) external;320321 /// @notice Burns a specific ERC721 token.322 /// @dev Throws unless `msg.sender` is the current owner or an authorized323 /// operator for this RFT. Throws if `from` is not the current owner. Throws324 /// if `to` is the zero address. Throws if `tokenId` is not a valid RFT.325 /// Throws if RFT pieces have multiple owners.326 /// @param from The current owner of the RFT327 /// @param tokenId The RFT to transfer328 /// @dev EVM selector for this function is: 0x79cc6790,329 /// or in textual repr: burnFrom(address,uint256)330 function burnFrom(address from, uint256 tokenId) external;331332 /// @notice Returns next free RFT ID.333 /// @dev EVM selector for this function is: 0x75794a3c,334 /// or in textual repr: nextTokenId()335 function nextTokenId() external view returns (uint256);336337 /// @notice Function to mint multiple tokens.338 /// @dev `tokenIds` should be an array of consecutive numbers and first number339 /// should be obtained with `nextTokenId` method340 /// @param to The new owner341 /// @param tokenIds IDs of the minted RFTs342 /// @dev EVM selector for this function is: 0x44a9945e,343 /// or in textual repr: mintBulk(address,uint256[])344 function mintBulk(address to, uint256[] memory tokenIds)345 external346 returns (bool);347348 /// @notice Function to mint multiple tokens with the given tokenUris.349 /// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive350 /// numbers and first number should be obtained with `nextTokenId` method351 /// @param to The new owner352 /// @param tokens array of pairs of token ID and token URI for minted tokens353 /// @dev EVM selector for this function is: 0x36543006,354 /// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[])355 function mintBulkWithTokenURI(address to, Tuple8[] memory tokens)356 external357 returns (bool);358359 /// Returns EVM address for refungible token360 ///361 /// @param token ID of the token362 /// @dev EVM selector for this function is: 0xab76fac6,363 /// or in textual repr: tokenContractAddress(uint256)364 function tokenContractAddress(uint256 token)365 external366 view367 returns (address);368}369370/// @dev anonymous struct371struct Tuple8 {372 uint256 field_0;373 string field_1;374}375376/// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension377/// @dev See https://eips.ethereum.org/EIPS/eip-721378/// @dev the ERC-165 identifier for this interface is 0x780e9d63379interface ERC721Enumerable is Dummy, ERC165 {380 /// @notice Enumerate valid RFTs381 /// @param index A counter less than `totalSupply()`382 /// @return The token identifier for the `index`th NFT,383 /// (sort order not specified)384 /// @dev EVM selector for this function is: 0x4f6ccce7,385 /// or in textual repr: tokenByIndex(uint256)386 function tokenByIndex(uint256 index) external view returns (uint256);387388 /// Not implemented389 /// @dev EVM selector for this function is: 0x2f745c59,390 /// or in textual repr: tokenOfOwnerByIndex(address,uint256)391 function tokenOfOwnerByIndex(address owner, uint256 index)392 external393 view394 returns (uint256);395396 /// @notice Count RFTs tracked by this contract397 /// @return A count of valid RFTs tracked by this contract, where each one of398 /// them has an assigned and queryable owner not equal to the zero address399 /// @dev EVM selector for this function is: 0x18160ddd,400 /// or in textual repr: totalSupply()401 function totalSupply() external view returns (uint256);402}403404/// @dev the ERC-165 identifier for this interface is 0x5b5e139f405interface ERC721Metadata is Dummy, ERC165 {406 /// @notice A descriptive name for a collection of RFTs in this contract407 /// @dev EVM selector for this function is: 0x06fdde03,408 /// or in textual repr: name()409 function name() external view returns (string memory);410411 /// @notice An abbreviated name for RFTs in this contract412 /// @dev EVM selector for this function is: 0x95d89b41,413 /// or in textual repr: symbol()414 function symbol() external view returns (string memory);415416 /// @notice A distinct Uniform Resource Identifier (URI) for a given asset.417 ///418 /// @dev If the token has a `url` property and it is not empty, it is returned.419 /// 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`.420 /// If the collection property `baseURI` is empty or absent, return "" (empty string)421 /// otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix422 /// otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings).423 ///424 /// @return token's const_metadata425 /// @dev EVM selector for this function is: 0xc87b56dd,426 /// or in textual repr: tokenURI(uint256)427 function tokenURI(uint256 tokenId) external view returns (string memory);428}429430/// @dev inlined interface22interface ERC721Events {431interface ERC721Events {23 event Transfer(432 event Transfer(24 address indexed from,433 address indexed from,37 );446 );38}447}3944840// Inline449/// @title ERC-721 Non-Fungible Token Standard41interface ERC721MintableEvents {450/// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md42 event MintingFinished();451/// @dev the ERC-165 identifier for this interface is 0x5880016143}4445// Selector: 4136937746interface TokenProperties is Dummy, ERC165 {47 // @notice Set permissions for token property.48 // @dev Throws error if `msg.sender` is not admin or owner of the collection.49 // @param key Property key.50 // @param is_mutable Permission to mutate property.51 // @param collection_admin Permission to mutate property by collection admin if property is mutable.52 // @param token_owner Permission to mutate property by token owner if property is mutable.53 //54 // Selector: setTokenPropertyPermission(string,bool,bool,bool) 222d97fa55 function setTokenPropertyPermission(56 string memory key,57 bool isMutable,58 bool collectionAdmin,59 bool tokenOwner60 ) external;6162 // @notice Set token property value.63 // @dev Throws error if `msg.sender` has no permission to edit the property.64 // @param tokenId ID of the token.65 // @param key Property key.66 // @param value Property value.67 //68 // Selector: setProperty(uint256,string,bytes) 1752d67b69 function setProperty(70 uint256 tokenId,71 string memory key,72 bytes memory value73 ) external;7475 // @notice Delete token property value.76 // @dev Throws error if `msg.sender` has no permission to edit the property.77 // @param tokenId ID of the token.78 // @param key Property key.79 //80 // Selector: deleteProperty(uint256,string) 066111d181 function deleteProperty(uint256 tokenId, string memory key) external;8283 // @notice Get token property value.84 // @dev Throws error if key not found85 // @param tokenId ID of the token.86 // @param key Property key.87 // @return Property value bytes88 //89 // Selector: property(uint256,string) 7228c32790 function property(uint256 tokenId, string memory key)91 external92 view93 returns (bytes memory);94}9596// Selector: 42966c6897interface ERC721Burnable is Dummy, ERC165 {98 // @notice Burns a specific ERC721 token.99 // @dev Throws unless `msg.sender` is the current RFT owner, or an authorized100 // operator of the current owner.101 // @param tokenId The RFT to approve102 //103 // Selector: burn(uint256) 42966c68104 function burn(uint256 tokenId) external;105}106107// Selector: 58800161108interface ERC721 is Dummy, ERC165, ERC721Events {452interface ERC721 is Dummy, ERC165, ERC721Events {109 // @notice Count all RFTs assigned to an owner453 /// @notice Count all RFTs assigned to an owner110 // @dev RFTs assigned to the zero address are considered invalid, and this454 /// @dev RFTs assigned to the zero address are considered invalid, and this111 // function throws for queries about the zero address.455 /// function throws for queries about the zero address.112 // @param owner An address for whom to query the balance456 /// @param owner An address for whom to query the balance113 // @return The number of RFTs owned by `owner`, possibly zero457 /// @return The number of RFTs owned by `owner`, possibly zero114 //458 /// @dev EVM selector for this function is: 0x70a08231,115 // Selector: balanceOf(address) 70a08231459 /// or in textual repr: balanceOf(address)116 function balanceOf(address owner) external view returns (uint256);460 function balanceOf(address owner) external view returns (uint256);117461118 // @notice Find the owner of an RFT462 /// @notice Find the owner of an RFT119 // @dev RFTs assigned to zero address are considered invalid, and queries463 /// @dev RFTs assigned to zero address are considered invalid, and queries120 // about them do throw.464 /// about them do throw.121 // Returns special 0xffffffffffffffffffffffffffffffffffffffff address for465 /// Returns special 0xffffffffffffffffffffffffffffffffffffffff address for122 // the tokens that are partially owned.466 /// the tokens that are partially owned.123 // @param tokenId The identifier for an RFT467 /// @param tokenId The identifier for an RFT124 // @return The address of the owner of the RFT468 /// @return The address of the owner of the RFT125 //469 /// @dev EVM selector for this function is: 0x6352211e,126 // Selector: ownerOf(uint256) 6352211e470 /// or in textual repr: ownerOf(uint256)127 function ownerOf(uint256 tokenId) external view returns (address);471 function ownerOf(uint256 tokenId) external view returns (address);128472129 // @dev Not implemented473 /// @dev Not implemented130 //474 /// @dev EVM selector for this function is: 0x60a11672,131 // Selector: safeTransferFromWithData(address,address,uint256,bytes) 60a11672475 /// or in textual repr: safeTransferFromWithData(address,address,uint256,bytes)132 function safeTransferFromWithData(476 function safeTransferFromWithData(133 address from,477 address from,134 address to,478 address to,135 uint256 tokenId,479 uint256 tokenId,136 bytes memory data480 bytes memory data137 ) external;481 ) external;138482139 // @dev Not implemented483 /// @dev Not implemented140 //484 /// @dev EVM selector for this function is: 0x42842e0e,141 // Selector: safeTransferFrom(address,address,uint256) 42842e0e485 /// or in textual repr: safeTransferFrom(address,address,uint256)142 function safeTransferFrom(486 function safeTransferFrom(143 address from,487 address from,144 address to,488 address to,145 uint256 tokenId489 uint256 tokenId146 ) external;490 ) external;147491148 // @notice Transfer ownership of an RFT -- THE CALLER IS RESPONSIBLE492 /// @notice Transfer ownership of an RFT -- THE CALLER IS RESPONSIBLE149 // TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE493 /// TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE150 // THEY MAY BE PERMANENTLY LOST494 /// THEY MAY BE PERMANENTLY LOST151 // @dev Throws unless `msg.sender` is the current owner or an authorized495 /// @dev Throws unless `msg.sender` is the current owner or an authorized152 // operator for this RFT. Throws if `from` is not the current owner. Throws496 /// operator for this RFT. Throws if `from` is not the current owner. Throws153 // if `to` is the zero address. Throws if `tokenId` is not a valid RFT.497 /// if `to` is the zero address. Throws if `tokenId` is not a valid RFT.154 // Throws if RFT pieces have multiple owners.498 /// Throws if RFT pieces have multiple owners.155 // @param from The current owner of the NFT499 /// @param from The current owner of the NFT156 // @param to The new owner500 /// @param to The new owner157 // @param tokenId The NFT to transfer501 /// @param tokenId The NFT to transfer158 // @param _value Not used for an NFT502 /// @dev EVM selector for this function is: 0x23b872dd,159 //160 // Selector: transferFrom(address,address,uint256) 23b872dd503 /// or in textual repr: transferFrom(address,address,uint256)161 function transferFrom(504 function transferFrom(162 address from,505 address from,163 address to,506 address to,164 uint256 tokenId507 uint256 tokenId165 ) external;508 ) external;166509167 // @dev Not implemented510 /// @dev Not implemented168 //511 /// @dev EVM selector for this function is: 0x095ea7b3,169 // Selector: approve(address,uint256) 095ea7b3512 /// or in textual repr: approve(address,uint256)170 function approve(address approved, uint256 tokenId) external;513 function approve(address approved, uint256 tokenId) external;171514172 // @dev Not implemented515 /// @dev Not implemented173 //516 /// @dev EVM selector for this function is: 0xa22cb465,174 // Selector: setApprovalForAll(address,bool) a22cb465517 /// or in textual repr: setApprovalForAll(address,bool)175 function setApprovalForAll(address operator, bool approved) external;518 function setApprovalForAll(address operator, bool approved) external;176519177 // @dev Not implemented520 /// @dev Not implemented178 //521 /// @dev EVM selector for this function is: 0x081812fc,179 // Selector: getApproved(uint256) 081812fc522 /// or in textual repr: getApproved(uint256)180 function getApproved(uint256 tokenId) external view returns (address);523 function getApproved(uint256 tokenId) external view returns (address);181524182 // @dev Not implemented525 /// @dev Not implemented183 //526 /// @dev EVM selector for this function is: 0xe985e9c5,184 // Selector: isApprovedForAll(address,address) e985e9c5527 /// or in textual repr: isApprovedForAll(address,address)185 function isApprovedForAll(address owner, address operator)528 function isApprovedForAll(address owner, address operator)186 external529 external187 view530 view188 returns (address);531 returns (address);189}532}190191// Selector: 5b5e139f192interface ERC721Metadata is Dummy, ERC165 {193 // @notice A descriptive name for a collection of RFTs in this contract194 //195 // Selector: name() 06fdde03196 function name() external view returns (string memory);197198 // @notice An abbreviated name for RFTs in this contract199 //200 // Selector: symbol() 95d89b41201 function symbol() external view returns (string memory);202203 // @notice A distinct Uniform Resource Identifier (URI) for a given asset.204 //205 // @dev If the token has a `url` property and it is not empty, it is returned.206 // 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`.207 // If the collection property `baseURI` is empty or absent, return "" (empty string)208 // otherwise, if token property `suffix` present and is non-empty, return concatenation of baseURI and suffix209 // otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings).210 //211 // @return token's const_metadata212 //213 // Selector: tokenURI(uint256) c87b56dd214 function tokenURI(uint256 tokenId) external view returns (string memory);215}216217// Selector: 68ccfe89218interface ERC721Mintable is Dummy, ERC165, ERC721MintableEvents {219 // Selector: mintingFinished() 05d2035b220 function mintingFinished() external view returns (bool);221222 // @notice Function to mint token.223 // @dev `tokenId` should be obtained with `nextTokenId` method,224 // unlike standard, you can't specify it manually225 // @param to The new owner226 // @param tokenId ID of the minted RFT227 //228 // Selector: mint(address,uint256) 40c10f19229 function mint(address to, uint256 tokenId) external returns (bool);230231 // @notice Function to mint token with the given tokenUri.232 // @dev `tokenId` should be obtained with `nextTokenId` method,233 // unlike standard, you can't specify it manually234 // @param to The new owner235 // @param tokenId ID of the minted RFT236 // @param tokenUri Token URI that would be stored in the RFT properties237 //238 // Selector: mintWithTokenURI(address,uint256,string) 50bb4e7f239 function mintWithTokenURI(240 address to,241 uint256 tokenId,242 string memory tokenUri243 ) external returns (bool);244245 // @dev Not implemented246 //247 // Selector: finishMinting() 7d64bcb4248 function finishMinting() external returns (bool);249}250251// Selector: 780e9d63252interface ERC721Enumerable is Dummy, ERC165 {253 // @notice Enumerate valid RFTs254 // @param index A counter less than `totalSupply()`255 // @return The token identifier for the `index`th NFT,256 // (sort order not specified)257 //258 // Selector: tokenByIndex(uint256) 4f6ccce7259 function tokenByIndex(uint256 index) external view returns (uint256);260261 // Not implemented262 //263 // Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59264 function tokenOfOwnerByIndex(address owner, uint256 index)265 external266 view267 returns (uint256);268269 // @notice Count RFTs tracked by this contract270 // @return A count of valid RFTs tracked by this contract, where each one of271 // them has an assigned and queryable owner not equal to the zero address272 //273 // Selector: totalSupply() 18160ddd274 function totalSupply() external view returns (uint256);275}276277// Selector: 7c3bef89278interface ERC721UniqueExtensions is Dummy, ERC165 {279 // @notice Transfer ownership of an RFT280 // @dev Throws unless `msg.sender` is the current owner. Throws if `to`281 // is the zero address. Throws if `tokenId` is not a valid RFT.282 // Throws if RFT pieces have multiple owners.283 // @param to The new owner284 // @param tokenId The RFT to transfer285 // @param _value Not used for an RFT286 //287 // Selector: transfer(address,uint256) a9059cbb288 function transfer(address to, uint256 tokenId) external;289290 // @notice Burns a specific ERC721 token.291 // @dev Throws unless `msg.sender` is the current owner or an authorized292 // operator for this RFT. Throws if `from` is not the current owner. Throws293 // if `to` is the zero address. Throws if `tokenId` is not a valid RFT.294 // Throws if RFT pieces have multiple owners.295 // @param from The current owner of the RFT296 // @param tokenId The RFT to transfer297 // @param _value Not used for an RFT298 //299 // Selector: burnFrom(address,uint256) 79cc6790300 function burnFrom(address from, uint256 tokenId) external;301302 // @notice Returns next free RFT ID.303 //304 // Selector: nextTokenId() 75794a3c305 function nextTokenId() external view returns (uint256);306307 // @notice Function to mint multiple tokens.308 // @dev `tokenIds` should be an array of consecutive numbers and first number309 // should be obtained with `nextTokenId` method310 // @param to The new owner311 // @param tokenIds IDs of the minted RFTs312 //313 // Selector: mintBulk(address,uint256[]) 44a9945e314 function mintBulk(address to, uint256[] memory tokenIds)315 external316 returns (bool);317318 // @notice Function to mint multiple tokens with the given tokenUris.319 // @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive320 // numbers and first number should be obtained with `nextTokenId` method321 // @param to The new owner322 // @param tokens array of pairs of token ID and token URI for minted tokens323 //324 // Selector: mintBulkWithTokenURI(address,(uint256,string)[]) 36543006325 function mintBulkWithTokenURI(address to, Tuple0[] memory tokens)326 external327 returns (bool);328329 // Returns EVM address for refungible token330 //331 // @param token ID of the token332 //333 // Selector: tokenContractAddress(uint256) ab76fac6334 function tokenContractAddress(uint256 token)335 external336 view337 returns (address);338}339340// Selector: ffe4da23341interface 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) 2f073f66348 function setCollectionProperty(string memory key, bytes memory value)349 external;350351 // Delete collection property.352 //353 // @param key Property key.354 //355 // Selector: deleteCollectionProperty(string) 7b7debce356 function deleteCollectionProperty(string memory key) external;357358 // 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) cf24fd6d366 function collectionProperty(string memory key)367 external368 view369 returns (bytes memory);370371 // 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) 7623402e378 function setCollectionSponsor(address sponsor) external;379380 // Collection sponsorship confirmation.381 //382 // @dev After setting the sponsor for the collection, it must be confirmed with this function.383 //384 // Selector: confirmCollectionSponsorship() 3c50e97a385 function confirmCollectionSponsorship() external;386387 // 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) 6a3841db399 function setCollectionLimit(string memory limit, uint32 value) external;400401 // 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) 993b7fba410 function setCollectionLimit(string memory limit, bool value) external;411412 // Get contract address.413 //414 // Selector: contractAddress() f6b4dfb4415 function contractAddress() external view returns (address);416417 // Add collection admin by substrate address.418 // @param new_admin Substrate administrator address.419 //420 // Selector: addCollectionAdminSubstrate(uint256) 5730062b421 function addCollectionAdminSubstrate(uint256 newAdmin) external;422423 // Remove collection admin by substrate address.424 // @param admin Substrate administrator address.425 //426 // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9427 function removeCollectionAdminSubstrate(uint256 admin) external;428429 // Add collection admin.430 // @param new_admin Address of the added administrator.431 //432 // Selector: addCollectionAdmin(address) 92e462c7433 function addCollectionAdmin(address newAdmin) external;434435 // Remove collection admin.436 //437 // @param new_admin Address of the removed administrator.438 //439 // Selector: removeCollectionAdmin(address) fafd7b42440 function removeCollectionAdmin(address admin) external;441442 // Toggle accessibility of collection nesting.443 //444 // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'445 //446 // Selector: setCollectionNesting(bool) 112d4586447 function setCollectionNesting(bool enable) external;448449 // 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[]) 64872396455 function setCollectionNesting(bool enable, address[] memory collections)456 external;457458 // Set the collection access method.459 // @param mode Access mode460 // 0 for Normal461 // 1 for AllowList462 //463 // Selector: setCollectionAccess(uint8) 41835d4c464 function setCollectionAccess(uint8 mode) external;465466 // Add the user to the allowed list.467 //468 // @param user Address of a trusted user.469 //470 // Selector: addToCollectionAllowList(address) 67844fe6471 function addToCollectionAllowList(address user) external;472473 // Remove the user from the allowed list.474 //475 // @param user Address of a removed user.476 //477 // Selector: removeFromCollectionAllowList(address) 85c51acb478 function removeFromCollectionAllowList(address user) external;479480 // Switch permission for minting.481 //482 // @param mode Enable if "true".483 //484 // Selector: setCollectionMintMode(bool) 00018e84485 function setCollectionMintMode(bool mode) external;486487 // Check that account is the owner or admin of the collection488 //489 // @param user account to verify490 // @return "true" if account is the owner or admin491 //492 // Selector: isOwnerOrAdmin(address) 9811b0c7493 function isOwnerOrAdmin(address user) external view returns (bool);494495 // Check that substrate account is the owner or admin of the collection496 //497 // @param user account to verify498 // @return "true" if account is the owner or admin499 //500 // Selector: isOwnerOrAdminSubstrate(uint256) 68910e00501 function isOwnerOrAdminSubstrate(uint256 user) external view returns (bool);502503 // Returns collection type504 //505 // @return `Fungible` or `NFT` or `ReFungible`506 //507 // Selector: uniqueCollectionType() d34b55b8508 function uniqueCollectionType() external returns (string memory);509510 // Changes collection owner to another account511 //512 // @dev Owner can be changed only by current owner513 // @param newOwner new owner account514 //515 // Selector: setOwner(address) 13af4035516 function setOwner(address newOwner) external;517518 // Changes collection owner to another substrate account519 //520 // @dev Owner can be changed only by current owner521 // @param newOwner new owner substrate account522 //523 // Selector: setOwnerSubstrate(uint256) b212138f524 function setOwnerSubstrate(uint256 newOwner) external;525}526533527interface UniqueRefungible is534interface UniqueRefungible is528 Dummy,535 Dummy,tests/src/eth/api/UniqueRefungibleToken.soldiffbeforeafterboth334pragma solidity >=0.8.0 <0.9.0;4pragma solidity >=0.8.0 <0.9.0;556// Common stubs holder6/// @dev common stubs holder7interface Dummy {7interface Dummy {889}9}12 function supportsInterface(bytes4 interfaceID) external view returns (bool);12 function supportsInterface(bytes4 interfaceID) external view returns (bool);13}13}141415// Inline15/// @dev the ERC-165 identifier for this interface is 0x042f110616interface ERC1633UniqueExtensions is Dummy, ERC165 {17 /// @dev EVM selector for this function is: 0x042f1106,18 /// or in textual repr: setParentNFT(address,uint256)19 function setParentNFT(address collection, uint256 nftId)20 external21 returns (bool);22}2324/// @dev the ERC-165 identifier for this interface is 0x5755c3f225interface ERC1633 is Dummy, ERC165 {26 /// @dev EVM selector for this function is: 0x80a54001,27 /// or in textual repr: parentToken()28 function parentToken() external view returns (address);2930 /// @dev EVM selector for this function is: 0xd7f083f3,31 /// or in textual repr: parentTokenId()32 function parentTokenId() external view returns (uint256);33}3435/// @dev the ERC-165 identifier for this interface is 0xab8deb3736interface ERC20UniqueExtensions is Dummy, ERC165 {37 /// @dev Function that burns an amount of the token of a given account,38 /// deducting from the sender's allowance for said account.39 /// @param from The account whose tokens will be burnt.40 /// @param amount The amount that will be burnt.41 /// @dev EVM selector for this function is: 0x79cc6790,42 /// or in textual repr: burnFrom(address,uint256)43 function burnFrom(address from, uint256 amount) external returns (bool);4445 /// @dev Function that changes total amount of the tokens.46 /// Throws if `msg.sender` doesn't owns all of the tokens.47 /// @param amount New total amount of the tokens.48 /// @dev EVM selector for this function is: 0xd2418ca7,49 /// or in textual repr: repartition(uint256)50 function repartition(uint256 amount) external returns (bool);51}5253/// @dev inlined interface16interface ERC20Events {54interface ERC20Events {17 event Transfer(address indexed from, address indexed to, uint256 value);55 event Transfer(address indexed from, address indexed to, uint256 value);18 event Approval(56 event Approval(22 );60 );23}61}246225// Selector: 042f110663/// @title Standard ERC20 token26interface ERC1633UniqueExtensions is Dummy, ERC165 {64///27 // Selector: setParentNFT(address,uint256) 042f110665/// @dev Implementation of the basic standard token.28 function setParentNFT(address collection, uint256 nftId)66/// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md29 external67/// @dev the ERC-165 identifier for this interface is 0x942e8b2230 returns (bool);31}3233// Selector: 5755c3f234interface ERC1633 is Dummy, ERC165 {35 // Selector: parentToken() 80a5400136 function parentToken() external view returns (address);3738 // Selector: parentTokenId() d7f083f339 function parentTokenId() external view returns (uint256);40}4142// Selector: 942e8b2243interface ERC20 is Dummy, ERC165, ERC20Events {68interface ERC20 is Dummy, ERC165, ERC20Events {44 // @return the name of the token.69 /// @return the name of the token.45 //70 /// @dev EVM selector for this function is: 0x06fdde03,46 // Selector: name() 06fdde0371 /// or in textual repr: name()47 function name() external view returns (string memory);72 function name() external view returns (string memory);487349 // @return the symbol of the token.74 /// @return the symbol of the token.50 //75 /// @dev EVM selector for this function is: 0x95d89b41,51 // Selector: symbol() 95d89b4176 /// or in textual repr: symbol()52 function symbol() external view returns (string memory);77 function symbol() external view returns (string memory);537854 // @dev Total number of tokens in existence79 /// @dev Total number of tokens in existence55 //80 /// @dev EVM selector for this function is: 0x18160ddd,56 // Selector: totalSupply() 18160ddd81 /// or in textual repr: totalSupply()57 function totalSupply() external view returns (uint256);82 function totalSupply() external view returns (uint256);588359 // @dev Not supported84 /// @dev Not supported60 //85 /// @dev EVM selector for this function is: 0x313ce567,61 // Selector: decimals() 313ce56786 /// or in textual repr: decimals()62 function decimals() external view returns (uint8);87 function decimals() external view returns (uint8);638864 // @dev Gets the balance of the specified address.89 /// @dev Gets the balance of the specified address.65 // @param owner The address to query the balance of.90 /// @param owner The address to query the balance of.66 // @return An uint256 representing the amount owned by the passed address.91 /// @return An uint256 representing the amount owned by the passed address.67 //92 /// @dev EVM selector for this function is: 0x70a08231,68 // Selector: balanceOf(address) 70a0823193 /// or in textual repr: balanceOf(address)69 function balanceOf(address owner) external view returns (uint256);94 function balanceOf(address owner) external view returns (uint256);709571 // @dev Transfer token for a specified address96 /// @dev Transfer token for a specified address72 // @param to The address to transfer to.97 /// @param to The address to transfer to.73 // @param amount The amount to be transferred.98 /// @param amount The amount to be transferred.74 //99 /// @dev EVM selector for this function is: 0xa9059cbb,75 // Selector: transfer(address,uint256) a9059cbb100 /// or in textual repr: transfer(address,uint256)76 function transfer(address to, uint256 amount) external returns (bool);101 function transfer(address to, uint256 amount) external returns (bool);7710278 // @dev Transfer tokens from one address to another103 /// @dev Transfer tokens from one address to another79 // @param from address The address which you want to send tokens from104 /// @param from address The address which you want to send tokens from80 // @param to address The address which you want to transfer to105 /// @param to address The address which you want to transfer to81 // @param amount uint256 the amount of tokens to be transferred106 /// @param amount uint256 the amount of tokens to be transferred82 //107 /// @dev EVM selector for this function is: 0x23b872dd,83 // Selector: transferFrom(address,address,uint256) 23b872dd108 /// or in textual repr: transferFrom(address,address,uint256)84 function transferFrom(109 function transferFrom(85 address from,110 address from,86 address to,111 address to,87 uint256 amount112 uint256 amount88 ) external returns (bool);113 ) external returns (bool);8911490 // @dev Approve the passed address to spend the specified amount of tokens on behalf of `msg.sender`.115 /// @dev Approve the passed address to spend the specified amount of tokens on behalf of `msg.sender`.91 // Beware that changing an allowance with this method brings the risk that someone may use both the old116 /// Beware that changing an allowance with this method brings the risk that someone may use both the old92 // and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this117 /// and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this93 // race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:118 /// race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:94 // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729119 /// https://github.com/ethereum/EIPs/issues/20#issuecomment-26352472995 // @param spender The address which will spend the funds.120 /// @param spender The address which will spend the funds.96 // @param amount The amount of tokens to be spent.121 /// @param amount The amount of tokens to be spent.97 //122 /// @dev EVM selector for this function is: 0x095ea7b3,98 // Selector: approve(address,uint256) 095ea7b3123 /// or in textual repr: approve(address,uint256)99 function approve(address spender, uint256 amount) external returns (bool);124 function approve(address spender, uint256 amount) external returns (bool);100125101 // @dev Function to check the amount of tokens that an owner allowed to a spender.126 /// @dev Function to check the amount of tokens that an owner allowed to a spender.102 // @param owner address The address which owns the funds.127 /// @param owner address The address which owns the funds.103 // @param spender address The address which will spend the funds.128 /// @param spender address The address which will spend the funds.104 // @return A uint256 specifying the amount of tokens still available for the spender.129 /// @return A uint256 specifying the amount of tokens still available for the spender.105 //130 /// @dev EVM selector for this function is: 0xdd62ed3e,106 // Selector: allowance(address,address) dd62ed3e131 /// or in textual repr: allowance(address,address)107 function allowance(address owner, address spender)132 function allowance(address owner, address spender)108 external133 external109 view134 view110 returns (uint256);135 returns (uint256);111}136}112113// Selector: ab8deb37114interface ERC20UniqueExtensions is Dummy, ERC165 {115 // @dev Function that burns an amount of the token of a given account,116 // deducting from the sender's allowance for said account.117 // @param from The account whose tokens will be burnt.118 // @param amount The amount that will be burnt.119 //120 // Selector: burnFrom(address,uint256) 79cc6790121 function burnFrom(address from, uint256 amount) external returns (bool);122123 // @dev Function that changes total amount of the tokens.124 // Throws if `msg.sender` doesn't owns all of the tokens.125 // @param amount New total amount of the tokens.126 //127 // Selector: repartition(uint256) d2418ca7128 function repartition(uint256 amount) external returns (bool);129}130137131interface UniqueRefungibleToken is138interface UniqueRefungibleToken is132 Dummy,139 Dummy,tests/src/eth/nonFungibleAbi.jsondiffbeforeafterboth255 { "internalType": "uint256", "name": "field_0", "type": "uint256" },255 { "internalType": "uint256", "name": "field_0", "type": "uint256" },256 { "internalType": "string", "name": "field_1", "type": "string" }256 { "internalType": "string", "name": "field_1", "type": "string" }257 ],257 ],258 "internalType": "struct Tuple0[]",258 "internalType": "struct Tuple8[]",259 "name": "tokens",259 "name": "tokens",260 "type": "tuple[]"260 "type": "tuple[]"261 }261 }361 { "internalType": "uint256", "name": "tokenId", "type": "uint256" },361 { "internalType": "uint256", "name": "tokenId", "type": "uint256" },362 { "internalType": "bytes", "name": "data", "type": "bytes" }362 { "internalType": "bytes", "name": "data", "type": "bytes" }363 ],363 ],364 "name": "safeTransferFromWithData",364 "name": "safeTransferFrom",365 "outputs": [],365 "outputs": [],366 "stateMutability": "nonpayable",366 "stateMutability": "nonpayable",367 "type": "function"367 "type": "function"tests/src/eth/reFungibleAbi.jsondiffbeforeafterboth255 { "internalType": "uint256", "name": "field_0", "type": "uint256" },255 { "internalType": "uint256", "name": "field_0", "type": "uint256" },256 { "internalType": "string", "name": "field_1", "type": "string" }256 { "internalType": "string", "name": "field_1", "type": "string" }257 ],257 ],258 "internalType": "struct Tuple0[]",258 "internalType": "struct Tuple8[]",259 "name": "tokens",259 "name": "tokens",260 "type": "tuple[]"260 "type": "tuple[]"261 }261 }tests/src/eth/util/contractHelpersAbi.jsondiffbeforeafterboth225 "type": "address"225 "type": "address"226 },226 },227 { "internalType": "address", "name": "user", "type": "address" },227 { "internalType": "address", "name": "user", "type": "address" },228 { "internalType": "bool", "name": "allowed", "type": "bool" }228 { "internalType": "bool", "name": "isAllowed", "type": "bool" }229 ],229 ],230 "name": "toggleAllowed",230 "name": "toggleAllowed",231 "outputs": [],231 "outputs": [],