git.delta.rocks / unique-network / refs/commits / 4e01cb3cfaf7

difftreelog

build upgrade to new evm-coder syntax

Yaroslav Bolyukin2022-07-12parent: #b6f414f.patch.diff
in: master

29 files changed

modifiedCargo.lockdiffbeforeafterboth
1771 "zeroize",1771 "zeroize",
1772]1772]
1773
1774[[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]
1783
1784[[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]
1797
1798[[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]
18081773
1809[[package]]1774[[package]]
1810name = "data-encoding"1775name = "data-encoding"
22172182
2218[[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]
22302194
3428 "winapi",3392 "winapi",
3429]3393]
3430
3431[[package]]
3432name = "ident_case"
3433version = "1.0.1"
3434source = "registry+https://github.com/rust-lang/crates.io-index"
3435checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
34363394
3437[[package]]3395[[package]]
3438name = "idna"3396name = "idna"
modifiedpallets/common/src/erc.rsdiffbeforeafterboth
60}60}
6161
62/// @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>
65where65where
66 T::AccountId: From<[u8; 32]>,66 T::AccountId: From<[u8; 32]>,
228 }228 }
229229
230 /// 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 }
255255
256 /// 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);
264264
265 /// 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);
modifiedpallets/evm-contract-helpers/src/eth.rsdiffbeforeafterboth
42 }42 }
43}43}
4444
45#[solidity_interface(name = "ContractHelpers")]45#[solidity_interface(name = ContractHelpers)]
46impl<T: Config> ContractHelpers<T>46impl<T: Config> ContractHelpers<T>
47where47where
48 T::AccountId: AsRef<[u8; 32]>,48 T::AccountId: AsRef<[u8; 32]>,
49{49{
50 /// Get contract ovner50 /// Get contract ovner
51 ///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 }
5757
58 /// 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,
8080
81 /// 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()?;
9393
94 /// 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()?;
106106
107 /// 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()?;
121121
122 /// 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 =
138138
139 /// 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 }
146146
147 /// 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()?;
236236
237 <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);
239239
240 Ok(())240 Ok(())
241 }241 }
modifiedpallets/evm-contract-helpers/src/stubs/ContractHelpers.rawdiffbeforeafterboth

binary blob — no preview

modifiedpallets/evm-contract-helpers/src/stubs/ContractHelpers.soldiffbeforeafterboth
33
4pragma solidity >=0.8.0 <0.9.0;4pragma solidity >=0.8.0 <0.9.0;
55
6// Anonymous struct6/// @dev anonymous struct
7struct Tuple0 {7struct Tuple0 {
8 address field_0;8 address field_0;
9 uint256 field_1;9 uint256 field_1;
10}10}
1111
12// Common stubs holder12/// @dev common stubs holder
13contract 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}
2929
30// Selector: 6073d91730/// @dev the ERC-165 identifier for this interface is 0x6073d917
31contract ContractHelpers is Dummy, ERC165 {31contract ContractHelpers is Dummy, ERC165 {
32 // Get contract ovner32 /// Get contract ovner
33 //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) 5152b14c
38 function contractOwner(address contractAddress)38 function contractOwner(address contractAddress)
39 public39 public
40 view40 view
46 return 0x0000000000000000000000000000000000000000;46 return 0x0000000000000000000000000000000000000000;
47 }47 }
4848
49 // 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) f01fba93
55 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 }
6161
62 // 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) 89f7d9ae
67 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 }
7272
73 // 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) ef784250
78 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 }
8383
84 // 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) abc00001
91 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 }
9696
97 // 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) 743fc745
103 function getSponsor(address contractAddress)103 function getSponsor(address contractAddress)
104 public104 public
105 view105 view
111 return Tuple0(0x0000000000000000000000000000000000000000, 0);111 return Tuple0(0x0000000000000000000000000000000000000000, 0);
112 }112 }
113113
114 // 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) 97418603
120 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 }
126126
127 // 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) 39b9b242
133 function hasPendingSponsor(address contractAddress)133 function hasPendingSponsor(address contractAddress)
134 public134 public
135 view135 view
141 return false;141 return false;
142 }142 }
143143
144 // Selector: sponsoringEnabled(address) 6027dc61144 /// Selector: sponsoringEnabled(address) 6027dc61
145 function sponsoringEnabled(address contractAddress)145 function sponsoringEnabled(address contractAddress)
146 public146 public
147 view147 view
153 return false;153 return false;
154 }154 }
155155
156 // Selector: setSponsoringMode(address,uint8) fde8a560156 /// Selector: setSponsoringMode(address,uint8) fde8a560
157 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 }
163163
164 // Selector: sponsoringMode(address) b70c7267164 /// Selector: sponsoringMode(address) b70c7267
165 function sponsoringMode(address contractAddress)165 function sponsoringMode(address contractAddress)
166 public166 public
167 view167 view
173 return 0;173 return 0;
174 }174 }
175175
176 // Selector: setSponsoringRateLimit(address,uint32) 77b6c908176 /// Selector: setSponsoringRateLimit(address,uint32) 77b6c908
177 function setSponsoringRateLimit(address contractAddress, uint32 rateLimit)177 function setSponsoringRateLimit(address contractAddress, uint32 rateLimit)
178 public178 public
179 {179 {
183 dummy = 0;183 dummy = 0;
184 }184 }
185185
186 // Selector: getSponsoringRateLimit(address) 610cfabd186 /// Selector: getSponsoringRateLimit(address) 610cfabd
187 function getSponsoringRateLimit(address contractAddress)187 function getSponsoringRateLimit(address contractAddress)
188 public188 public
189 view189 view
195 return 0;195 return 0;
196 }196 }
197197
198 // Selector: allowed(address,address) 5c658165198 /// Selector: allowed(address,address) 5c658165
199 function allowed(address contractAddress, address user)199 function allowed(address contractAddress, address user)
200 public200 public
201 view201 view
208 return false;208 return false;
209 }209 }
210210
211 // Selector: allowlistEnabled(address) c772ef6c211 /// Selector: allowlistEnabled(address) c772ef6c
212 function allowlistEnabled(address contractAddress)212 function allowlistEnabled(address contractAddress)
213 public213 public
214 view214 view
220 return false;220 return false;
221 }221 }
222222
223 // Selector: toggleAllowlist(address,bool) 36de20f5223 /// Selector: toggleAllowlist(address,bool) 36de20f5
224 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 }
230230
231 // Selector: toggleAllowed(address,address,bool) 4706cc1c231 /// Selector: toggleAllowed(address,address,bool) 4706cc1c
232 function toggleAllowed(232 function toggleAllowed(
233 address contractAddress,233 address contractAddress,
234 address user,234 address user,
235 bool allowed235 bool isAllowed
236 ) 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}
modifiedpallets/fungible/src/erc.rsdiffbeforeafterboth
50 },50 },
51}51}
5252
53#[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}
131131
132#[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}
148148
149#[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]> {}
modifiedpallets/fungible/src/stubs/UniqueFungible.rawdiffbeforeafterboth

binary blob — no preview

modifiedpallets/fungible/src/stubs/UniqueFungible.soldiffbeforeafterboth
33
4pragma solidity >=0.8.0 <0.9.0;4pragma solidity >=0.8.0 <0.9.0;
55
6// Common stubs holder6/// @dev common stubs holder
7contract 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}
2323
24// Inline24/// @title A contract that allows you to work with collections.
25/// @dev the ERC-165 identifier for this interface is 0xffe4da23
26contract 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 public
35 {
36 require(false, stub_error);
37 key;
38 value;
39 dummy = 0;
40 }
41
42 /// 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 }
52
53 /// 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 public
63 view
64 returns (bytes memory)
65 {
66 require(false, stub_error);
67 key;
68 dummy;
69 return hex"";
70 }
71
72 /// 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 }
84
85 /// 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 }
94
95 /// 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 }
113
114 /// 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 }
129
130 /// 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 }
138
139 /// 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 }
148
149 /// 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 }
158
159 /// 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 }
168
169 /// 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 }
179
180 /// 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 }
190
191 /// 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 public
199 {
200 require(false, stub_error);
201 enable;
202 collections;
203 dummy = 0;
204 }
205
206 /// Set the collection access method.
207 /// @param mode Access mode
208 /// 0 for Normal
209 /// 1 for AllowList
210 /// @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 }
217
218 /// 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 }
228
229 /// 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 }
239
240 /// 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 }
250
251 /// Check that account is the owner or admin of the collection
252 ///
253 /// @param user account to verify
254 /// @return "true" if account is the owner or admin
255 /// @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 }
263
264 /// Check that substrate account is the owner or admin of the collection
265 ///
266 /// @param user account to verify
267 /// @return "true" if account is the owner or admin
268 /// @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 }
276
277 /// Returns collection type
278 ///
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 }
287
288 /// Changes collection owner to another account
289 ///
290 /// @dev Owner can be changed only by current owner
291 /// @param newOwner new owner account
292 /// @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 }
299
300 /// Changes collection owner to another substrate account
301 ///
302 /// @dev Owner can be changed only by current owner
303 /// @param newOwner new owner substrate account
304 /// @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}
312
313/// @dev the ERC-165 identifier for this interface is 0x79cc6790
314contract 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}
325
326/// @dev inlined interface
25contract 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}
33335
34// Selector: 79cc6790336/// @dev the ERC-165 identifier for this interface is 0x942e8b22
35contract ERC20UniqueExtensions is Dummy, ERC165 {
36 // Selector: burnFrom(address,uint256) 79cc6790
37 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}
45
46// Selector: 942e8b22
47contract 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 }
54345
55 // 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 }
61353
62 // 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 }
68361
69 // 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 }
75369
370 /// @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 }
83378
379 /// @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 }
92388
389 /// @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 }
106403
404 /// @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 }
115413
414 /// @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 public
119 view418 view
127 }426 }
128}427}
129
130// Selector: ffe4da23
131contract Collection is Dummy, ERC165 {
132 // Set collection property.
133 //
134 // @param key Property key.
135 // @param value Propery value.
136 //
137 // Selector: setCollectionProperty(string,bytes) 2f073f66
138 function setCollectionProperty(string memory key, bytes memory value)
139 public
140 {
141 require(false, stub_error);
142 key;
143 value;
144 dummy = 0;
145 }
146
147 // Delete collection property.
148 //
149 // @param key Property key.
150 //
151 // Selector: deleteCollectionProperty(string) 7b7debce
152 function deleteCollectionProperty(string memory key) public {
153 require(false, stub_error);
154 key;
155 dummy = 0;
156 }
157
158 // Get collection property.
159 //
160 // @dev Throws error if key not found.
161 //
162 // @param key Property key.
163 // @return bytes The property corresponding to the key.
164 //
165 // Selector: collectionProperty(string) cf24fd6d
166 function collectionProperty(string memory key)
167 public
168 view
169 returns (bytes memory)
170 {
171 require(false, stub_error);
172 key;
173 dummy;
174 return hex"";
175 }
176
177 // Set the sponsor of the collection.
178 //
179 // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.
180 //
181 // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.
182 //
183 // Selector: setCollectionSponsor(address) 7623402e
184 function setCollectionSponsor(address sponsor) public {
185 require(false, stub_error);
186 sponsor;
187 dummy = 0;
188 }
189
190 // Collection sponsorship confirmation.
191 //
192 // @dev After setting the sponsor for the collection, it must be confirmed with this function.
193 //
194 // Selector: confirmCollectionSponsorship() 3c50e97a
195 function confirmCollectionSponsorship() public {
196 require(false, stub_error);
197 dummy = 0;
198 }
199
200 // Set limits for the collection.
201 // @dev Throws error if limit not found.
202 // @param limit Name of the limit. Valid names:
203 // "accountTokenOwnershipLimit",
204 // "sponsoredDataSize",
205 // "sponsoredDataRateLimit",
206 // "tokenLimit",
207 // "sponsorTransferTimeout",
208 // "sponsorApproveTimeout"
209 // @param value Value of the limit.
210 //
211 // Selector: setCollectionLimit(string,uint32) 6a3841db
212 function setCollectionLimit(string memory limit, uint32 value) public {
213 require(false, stub_error);
214 limit;
215 value;
216 dummy = 0;
217 }
218
219 // Set limits for the collection.
220 // @dev Throws error if limit not found.
221 // @param limit Name of the limit. Valid names:
222 // "ownerCanTransfer",
223 // "ownerCanDestroy",
224 // "transfersEnabled"
225 // @param value Value of the limit.
226 //
227 // Selector: setCollectionLimit(string,bool) 993b7fba
228 function setCollectionLimit(string memory limit, bool value) public {
229 require(false, stub_error);
230 limit;
231 value;
232 dummy = 0;
233 }
234
235 // Get contract address.
236 //
237 // Selector: contractAddress() f6b4dfb4
238 function contractAddress() public view returns (address) {
239 require(false, stub_error);
240 dummy;
241 return 0x0000000000000000000000000000000000000000;
242 }
243
244 // Add collection admin by substrate address.
245 // @param new_admin Substrate administrator address.
246 //
247 // Selector: addCollectionAdminSubstrate(uint256) 5730062b
248 function addCollectionAdminSubstrate(uint256 newAdmin) public {
249 require(false, stub_error);
250 newAdmin;
251 dummy = 0;
252 }
253
254 // Remove collection admin by substrate address.
255 // @param admin Substrate administrator address.
256 //
257 // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9
258 function removeCollectionAdminSubstrate(uint256 admin) public {
259 require(false, stub_error);
260 admin;
261 dummy = 0;
262 }
263
264 // Add collection admin.
265 // @param new_admin Address of the added administrator.
266 //
267 // Selector: addCollectionAdmin(address) 92e462c7
268 function addCollectionAdmin(address newAdmin) public {
269 require(false, stub_error);
270 newAdmin;
271 dummy = 0;
272 }
273
274 // Remove collection admin.
275 //
276 // @param new_admin Address of the removed administrator.
277 //
278 // Selector: removeCollectionAdmin(address) fafd7b42
279 function removeCollectionAdmin(address admin) public {
280 require(false, stub_error);
281 admin;
282 dummy = 0;
283 }
284
285 // Toggle accessibility of collection nesting.
286 //
287 // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
288 //
289 // Selector: setCollectionNesting(bool) 112d4586
290 function setCollectionNesting(bool enable) public {
291 require(false, stub_error);
292 enable;
293 dummy = 0;
294 }
295
296 // Toggle accessibility of collection nesting.
297 //
298 // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
299 // @param collections Addresses of collections that will be available for nesting.
300 //
301 // Selector: setCollectionNesting(bool,address[]) 64872396
302 function setCollectionNesting(bool enable, address[] memory collections)
303 public
304 {
305 require(false, stub_error);
306 enable;
307 collections;
308 dummy = 0;
309 }
310
311 // Set the collection access method.
312 // @param mode Access mode
313 // 0 for Normal
314 // 1 for AllowList
315 //
316 // Selector: setCollectionAccess(uint8) 41835d4c
317 function setCollectionAccess(uint8 mode) public {
318 require(false, stub_error);
319 mode;
320 dummy = 0;
321 }
322
323 // Add the user to the allowed list.
324 //
325 // @param user Address of a trusted user.
326 //
327 // Selector: addToCollectionAllowList(address) 67844fe6
328 function addToCollectionAllowList(address user) public {
329 require(false, stub_error);
330 user;
331 dummy = 0;
332 }
333
334 // Remove the user from the allowed list.
335 //
336 // @param user Address of a removed user.
337 //
338 // Selector: removeFromCollectionAllowList(address) 85c51acb
339 function removeFromCollectionAllowList(address user) public {
340 require(false, stub_error);
341 user;
342 dummy = 0;
343 }
344
345 // Switch permission for minting.
346 //
347 // @param mode Enable if "true".
348 //
349 // Selector: setCollectionMintMode(bool) 00018e84
350 function setCollectionMintMode(bool mode) public {
351 require(false, stub_error);
352 mode;
353 dummy = 0;
354 }
355
356 // Check that account is the owner or admin of the collection
357 //
358 // @param user account to verify
359 // @return "true" if account is the owner or admin
360 //
361 // Selector: isOwnerOrAdmin(address) 9811b0c7
362 function isOwnerOrAdmin(address user) public view returns (bool) {
363 require(false, stub_error);
364 user;
365 dummy;
366 return false;
367 }
368
369 // Check that substrate account is the owner or admin of the collection
370 //
371 // @param user account to verify
372 // @return "true" if account is the owner or admin
373 //
374 // Selector: isOwnerOrAdminSubstrate(uint256) 68910e00
375 function isOwnerOrAdminSubstrate(uint256 user) public view returns (bool) {
376 require(false, stub_error);
377 user;
378 dummy;
379 return false;
380 }
381
382 // Returns collection type
383 //
384 // @return `Fungible` or `NFT` or `ReFungible`
385 //
386 // Selector: uniqueCollectionType() d34b55b8
387 function uniqueCollectionType() public returns (string memory) {
388 require(false, stub_error);
389 dummy = 0;
390 return "";
391 }
392
393 // Changes collection owner to another account
394 //
395 // @dev Owner can be changed only by current owner
396 // @param newOwner new owner account
397 //
398 // Selector: setOwner(address) 13af4035
399 function setOwner(address newOwner) public {
400 require(false, stub_error);
401 newOwner;
402 dummy = 0;
403 }
404
405 // Changes collection owner to another substrate account
406 //
407 // @dev Owner can be changed only by current owner
408 // @param newOwner new owner substrate account
409 //
410 // Selector: setOwnerSubstrate(uint256) b212138f
411 function setOwnerSubstrate(uint256 newOwner) public {
412 require(false, stub_error);
413 newOwner;
414 dummy = 0;
415 }
416}
417428
418contract UniqueFungible is429contract UniqueFungible is
419 Dummy,430 Dummy,
modifiedpallets/nonfungible/src/erc.rsdiffbeforeafterboth
50};50};
5151
52/// @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,
201201
202/// @title ERC-721 Non-Fungible Token Standard, optional metadata extension202/// @title ERC-721 Non-Fungible Token Standard, optional metadata extension
203/// @dev See https://eips.ethereum.org/EIPS/eip-721203/// @dev See https://eips.ethereum.org/EIPS/eip-721
204#[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 contract
207 fn name(&self) -> Result<string> {207 fn name(&self) -> Result<string> {
262262
263/// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension263/// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
264/// @dev See https://eips.ethereum.org/EIPS/eip-721264/// @dev See https://eips.ethereum.org/EIPS/eip-721
265#[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 NFTs
268 /// @param index A counter less than `totalSupply()`268 /// @param index A counter less than `totalSupply()`
289289
290/// @title ERC-721 Non-Fungible Token Standard290/// @title ERC-721 Non-Fungible Token Standard
291/// @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.md
292#[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 owner
295 /// @dev NFTs assigned to the zero address are considered invalid, and this295 /// @dev NFTs assigned to the zero address are considered invalid, and this
316 .as_eth())316 .as_eth())
317 }317 }
318 /// @dev Not implemented318 /// @dev Not implemented
319 #[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 implemetable
328 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 implemetable
339 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 NFT
349 /// @param to The new owner348 /// @param to The new owner
350 /// @param tokenId The NFT to transfer349 /// @param tokenId The NFT to transfer
351 /// @param _value Not used for an NFT
352 #[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}
420411
421/// @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 authorized
436}427}
437428
438/// @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}
598589
599/// @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 NFT
603 /// @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 owner
606 /// @param tokenId The NFT to transfer597 /// @param tokenId The NFT to transfer
607 /// @param _value Not used for an NFT
608 #[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 NFT
632 /// @param tokenId The NFT to transfer616 /// @param tokenId The NFT to transfer
633 /// @param _value Not used for an NFT
634 #[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}
752729
753#[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)]
modifiedpallets/nonfungible/src/stubs/UniqueNFT.rawdiffbeforeafterboth

binary blob — no preview

modifiedpallets/nonfungible/src/stubs/UniqueNFT.soldiffbeforeafterboth
33
4pragma solidity >=0.8.0 <0.9.0;4pragma solidity >=0.8.0 <0.9.0;
5
6// Anonymous struct
7struct Tuple0 {
8 uint256 field_0;
9 string field_1;
10}
115
12// Common stubs holder6/// @dev common stubs holder
13contract 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}
2923
30// 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 0x41369377
26contract 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 tokenOwner
40 ) public {
41 require(false, stub_error);
42 key;
43 isMutable;
44 collectionAdmin;
45 tokenOwner;
46 dummy = 0;
47 }
48
49 /// @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 value
60 ) public {
61 require(false, stub_error);
62 tokenId;
63 key;
64 value;
65 dummy = 0;
66 }
67
68 /// @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 }
80
81 /// @notice Get token property value.
82 /// @dev Throws error if key not found
83 /// @param tokenId ID of the token.
84 /// @param key Property key.
85 /// @return Property value bytes
86 /// @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 public
90 view
91 returns (bytes memory)
92 {
93 require(false, stub_error);
94 tokenId;
95 key;
96 dummy;
97 return hex"";
98 }
99}
100
101/// @title A contract that allows you to work with collections.
102/// @dev the ERC-165 identifier for this interface is 0xffe4da23
103contract 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 public
112 {
113 require(false, stub_error);
114 key;
115 value;
116 dummy = 0;
117 }
118
119 /// 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 }
129
130 /// 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 public
140 view
141 returns (bytes memory)
142 {
143 require(false, stub_error);
144 key;
145 dummy;
146 return hex"";
147 }
148
149 /// 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 }
161
162 /// 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 }
171
172 /// 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 }
190
191 /// 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 }
206
207 /// 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 }
215
216 /// 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 }
225
226 /// 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 }
235
236 /// 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 }
245
246 /// 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 }
256
257 /// 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 }
267
268 /// 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 public
276 {
277 require(false, stub_error);
278 enable;
279 collections;
280 dummy = 0;
281 }
282
283 /// Set the collection access method.
284 /// @param mode Access mode
285 /// 0 for Normal
286 /// 1 for AllowList
287 /// @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 }
294
295 /// 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 }
305
306 /// 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 }
316
317 /// 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 }
327
328 /// Check that account is the owner or admin of the collection
329 ///
330 /// @param user account to verify
331 /// @return "true" if account is the owner or admin
332 /// @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 }
340
341 /// Check that substrate account is the owner or admin of the collection
342 ///
343 /// @param user account to verify
344 /// @return "true" if account is the owner or admin
345 /// @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 }
353
354 /// Returns collection type
355 ///
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 }
364
365 /// Changes collection owner to another account
366 ///
367 /// @dev Owner can be changed only by current owner
368 /// @param newOwner new owner account
369 /// @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 }
376
377 /// Changes collection owner to another substrate account
378 ///
379 /// @dev Owner can be changed only by current owner
380 /// @param newOwner new owner substrate account
381 /// @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}
389
390/// @title ERC721 Token that can be irreversibly burned (destroyed).
391/// @dev the ERC-165 identifier for this interface is 0x42966c68
392contract ERC721Burnable is Dummy, ERC165 {
393 /// @notice Burns a specific ERC721 token.
394 /// @dev Throws unless `msg.sender` is the current NFT owner, or an authorized
395 /// operator of the current owner.
396 /// @param tokenId The NFT to approve
397 /// @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}
405
406/// @dev inlined interface
407contract ERC721MintableEvents {
408 event MintingFinished();
409}
410
411/// @title ERC721 minting logic.
412/// @dev the ERC-165 identifier for this interface is 0x68ccfe89
413contract 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 }
421
422 /// @notice Function to mint token.
423 /// @dev `tokenId` should be obtained with `nextTokenId` method,
424 /// unlike standard, you can't specify it manually
425 /// @param to The new owner
426 /// @param tokenId ID of the minted NFT
427 /// @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 }
436
437 /// @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 manually
440 /// @param to The new owner
441 /// @param tokenId ID of the minted NFT
442 /// @param tokenUri Token URI that would be stored in the NFT properties
443 /// @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 tokenUri
449 ) public returns (bool) {
450 require(false, stub_error);
451 to;
452 tokenId;
453 tokenUri;
454 dummy = 0;
455 return false;
456 }
457
458 /// @dev Not implemented
459 /// @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}
467
468/// @title Unique extensions for ERC721.
469/// @dev the ERC-165 identifier for this interface is 0xd74d154f
470contract ERC721UniqueExtensions is Dummy, ERC165 {
471 /// @notice Transfer ownership of an NFT
472 /// @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 owner
475 /// @param tokenId The NFT to transfer
476 /// @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 }
484
485 /// @notice Burns a specific ERC721 token.
486 /// @dev Throws unless `msg.sender` is the current owner or an authorized
487 /// operator for this NFT. Throws if `from` is not the current owner. Throws
488 /// if `to` is the zero address. Throws if `tokenId` is not a valid NFT.
489 /// @param from The current owner of the NFT
490 /// @param tokenId The NFT to transfer
491 /// @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 }
499
500 /// @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 }
508
509 /// @notice Function to mint multiple tokens.
510 /// @dev `tokenIds` should be an array of consecutive numbers and first number
511 /// should be obtained with `nextTokenId` method
512 /// @param to The new owner
513 /// @param tokenIds IDs of the minted NFTs
514 /// @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 public
518 returns (bool)
519 {
520 require(false, stub_error);
521 to;
522 tokenIds;
523 dummy = 0;
524 return false;
525 }
526
527 /// @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 consecutive
529 /// numbers and first number should be obtained with `nextTokenId` method
530 /// @param to The new owner
531 /// @param tokens array of pairs of token ID and token URI for minted tokens
532 /// @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 public
536 returns (bool)
537 {
538 require(false, stub_error);
539 to;
540 tokens;
541 dummy = 0;
542 return false;
543 }
544}
545
546/// @dev anonymous struct
547struct Tuple8 {
548 uint256 field_0;
549 string field_1;
550}
551
552/// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
553/// @dev See https://eips.ethereum.org/EIPS/eip-721
554/// @dev the ERC-165 identifier for this interface is 0x780e9d63
555contract ERC721Enumerable is Dummy, ERC165 {
556 /// @notice Enumerate valid NFTs
557 /// @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 }
568
569 /// @dev Not implemented
570 /// @dev EVM selector for this function is: 0x2f745c59,
571 /// or in textual repr: tokenOfOwnerByIndex(address,uint256)
572 function tokenOfOwnerByIndex(address owner, uint256 index)
573 public
574 view
575 returns (uint256)
576 {
577 require(false, stub_error);
578 owner;
579 index;
580 dummy;
581 return 0;
582 }
583
584 /// @notice Count NFTs tracked by this contract
585 /// @return A count of valid NFTs tracked by this contract, where each one of
586 /// them has an assigned and queryable owner not equal to the zero address
587 /// @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}
595
596/// @title ERC-721 Non-Fungible Token Standard, optional metadata extension
597/// @dev See https://eips.ethereum.org/EIPS/eip-721
598/// @dev the ERC-165 identifier for this interface is 0x5b5e139f
599contract ERC721Metadata is Dummy, ERC165 {
600 /// @notice A descriptive name for a collection of NFTs in this contract
601 /// @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 }
608
609 /// @notice An abbreviated name for NFTs in this contract
610 /// @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 }
617
618 /// @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 suffix
624 /// otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings).
625 ///
626 /// @return token's const_metadata
627 /// @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}
636
637/// @dev inlined interface
31contract ERC721Events {638contract ERC721Events {
32 event Transfer(639 event Transfer(
33 address indexed from,640 address indexed from,
46 );653 );
47}654}
48655
49// Inline656/// @title ERC-721 Non-Fungible Token Standard
50contract ERC721MintableEvents {657/// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
51 event MintingFinished();658/// @dev the ERC-165 identifier for this interface is 0x80ac58cd
52}
53
54// Selector: 41369377
55contract 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) 222d97fa
64 function setTokenPropertyPermission(
65 string memory key,
66 bool isMutable,
67 bool collectionAdmin,
68 bool tokenOwner
69 ) public {
70 require(false, stub_error);
71 key;
72 isMutable;
73 collectionAdmin;
74 tokenOwner;
75 dummy = 0;
76 }
77
78 // @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) 1752d67b
85 function setProperty(
86 uint256 tokenId,
87 string memory key,
88 bytes memory value
89 ) public {
90 require(false, stub_error);
91 tokenId;
92 key;
93 value;
94 dummy = 0;
95 }
96
97 // @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) 066111d1
103 function deleteProperty(uint256 tokenId, string memory key) public {
104 require(false, stub_error);
105 tokenId;
106 key;
107 dummy = 0;
108 }
109
110 // @notice Get token property value.
111 // @dev Throws error if key not found
112 // @param tokenId ID of the token.
113 // @param key Property key.
114 // @return Property value bytes
115 //
116 // Selector: property(uint256,string) 7228c327
117 function property(uint256 tokenId, string memory key)
118 public
119 view
120 returns (bytes memory)
121 {
122 require(false, stub_error);
123 tokenId;
124 key;
125 dummy;
126 return hex"";
127 }
128}
129
130// Selector: 42966c68
131contract ERC721Burnable is Dummy, ERC165 {
132 // @notice Burns a specific ERC721 token.
133 // @dev Throws unless `msg.sender` is the current NFT owner, or an authorized
134 // operator of the current owner.
135 // @param tokenId The NFT to approve
136 //
137 // Selector: burn(uint256) 42966c68
138 function burn(uint256 tokenId) public {
139 require(false, stub_error);
140 tokenId;
141 dummy = 0;
142 }
143}
144
145// Selector: 58800161
146contract 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 owner
148 // @dev NFTs assigned to the zero address are considered invalid, and this661 /// @dev NFTs assigned to the zero address are considered invalid, and this
149 // 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 balance
151 // @return The number of NFTs owned by `owner`, possibly zero664 /// @return The number of NFTs owned by `owner`, possibly zero
152 //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 }
160673
161 // @notice Find the owner of an NFT674 /// @notice Find the owner of an NFT
162 // @dev NFTs assigned to zero address are considered invalid, and queries675 /// @dev NFTs assigned to zero address are considered invalid, and queries
163 // about them do throw.676 /// about them do throw.
164 // @param tokenId The identifier for an NFT677 /// @param tokenId The identifier for an NFT
165 // @return The address of the owner of the NFT678 /// @return The address of the owner of the NFT
166 //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 }
174687
175 // @dev Not implemented688 /// @dev Not implemented
176 //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 }
191704
192 // @dev Not implemented705 /// @dev Not implemented
193 //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 }
206719
207 // @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE720 /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE
208 // TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE721 /// TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE
209 // THEY MAY BE PERMANENTLY LOST722 /// THEY MAY BE PERMANENTLY LOST
210 // @dev Throws unless `msg.sender` is the current owner or an authorized723 /// @dev Throws unless `msg.sender` is the current owner or an authorized
211 // 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. Throws
212 // 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 NFT
214 // @param to The new owner727 /// @param to The new owner
215 // @param tokenId The NFT to transfer728 /// @param tokenId The NFT to transfer
216 // @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 }
230742
231 // @notice Set or reaffirm the approved address for an NFT743 /// @notice Set or reaffirm the approved address for an NFT
232 // @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 authorized
234 // 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 controller
236 // @param tokenId The NFT to approve748 /// @param tokenId The NFT to approve
237 //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 }
245757
246 // @dev Not implemented758 /// @dev Not implemented
247 //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 }
255767
256 // @dev Not implemented768 /// @dev Not implemented
257 //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 }
265777
266 // @dev Not implemented778 /// @dev Not implemented
267 //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 public
271 view783 view
279 }791 }
280}792}
281
282// Selector: 5b5e139f
283contract ERC721Metadata is Dummy, ERC165 {
284 // @notice A descriptive name for a collection of NFTs in this contract
285 //
286 // Selector: name() 06fdde03
287 function name() public view returns (string memory) {
288 require(false, stub_error);
289 dummy;
290 return "";
291 }
292
293 // @notice An abbreviated name for NFTs in this contract
294 //
295 // Selector: symbol() 95d89b41
296 function symbol() public view returns (string memory) {
297 require(false, stub_error);
298 dummy;
299 return "";
300 }
301
302 // @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 suffix
308 // otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings).
309 //
310 // @return token's const_metadata
311 //
312 // Selector: tokenURI(uint256) c87b56dd
313 function tokenURI(uint256 tokenId) public view returns (string memory) {
314 require(false, stub_error);
315 tokenId;
316 dummy;
317 return "";
318 }
319}
320
321// Selector: 68ccfe89
322contract ERC721Mintable is Dummy, ERC165, ERC721MintableEvents {
323 // Selector: mintingFinished() 05d2035b
324 function mintingFinished() public view returns (bool) {
325 require(false, stub_error);
326 dummy;
327 return false;
328 }
329
330 // @notice Function to mint token.
331 // @dev `tokenId` should be obtained with `nextTokenId` method,
332 // unlike standard, you can't specify it manually
333 // @param to The new owner
334 // @param tokenId ID of the minted NFT
335 //
336 // Selector: mint(address,uint256) 40c10f19
337 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 }
344
345 // @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 manually
348 // @param to The new owner
349 // @param tokenId ID of the minted NFT
350 // @param tokenUri Token URI that would be stored in the NFT properties
351 //
352 // Selector: mintWithTokenURI(address,uint256,string) 50bb4e7f
353 function mintWithTokenURI(
354 address to,
355 uint256 tokenId,
356 string memory tokenUri
357 ) public returns (bool) {
358 require(false, stub_error);
359 to;
360 tokenId;
361 tokenUri;
362 dummy = 0;
363 return false;
364 }
365
366 // @dev Not implemented
367 //
368 // Selector: finishMinting() 7d64bcb4
369 function finishMinting() public returns (bool) {
370 require(false, stub_error);
371 dummy = 0;
372 return false;
373 }
374}
375
376// Selector: 780e9d63
377contract ERC721Enumerable is Dummy, ERC165 {
378 // @notice Enumerate valid NFTs
379 // @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) 4f6ccce7
384 function tokenByIndex(uint256 index) public view returns (uint256) {
385 require(false, stub_error);
386 index;
387 dummy;
388 return 0;
389 }
390
391 // @dev Not implemented
392 //
393 // Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59
394 function tokenOfOwnerByIndex(address owner, uint256 index)
395 public
396 view
397 returns (uint256)
398 {
399 require(false, stub_error);
400 owner;
401 index;
402 dummy;
403 return 0;
404 }
405
406 // @notice Count NFTs tracked by this contract
407 // @return A count of valid NFTs tracked by this contract, where each one of
408 // them has an assigned and queryable owner not equal to the zero address
409 //
410 // Selector: totalSupply() 18160ddd
411 function totalSupply() public view returns (uint256) {
412 require(false, stub_error);
413 dummy;
414 return 0;
415 }
416}
417
418// Selector: d74d154f
419contract ERC721UniqueExtensions is Dummy, ERC165 {
420 // @notice Transfer ownership of an NFT
421 // @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 owner
424 // @param tokenId The NFT to transfer
425 // @param _value Not used for an NFT
426 //
427 // Selector: transfer(address,uint256) a9059cbb
428 function transfer(address to, uint256 tokenId) public {
429 require(false, stub_error);
430 to;
431 tokenId;
432 dummy = 0;
433 }
434
435 // @notice Burns a specific ERC721 token.
436 // @dev Throws unless `msg.sender` is the current owner or an authorized
437 // operator for this NFT. Throws if `from` is not the current owner. Throws
438 // if `to` is the zero address. Throws if `tokenId` is not a valid NFT.
439 // @param from The current owner of the NFT
440 // @param tokenId The NFT to transfer
441 // @param _value Not used for an NFT
442 //
443 // Selector: burnFrom(address,uint256) 79cc6790
444 function burnFrom(address from, uint256 tokenId) public {
445 require(false, stub_error);
446 from;
447 tokenId;
448 dummy = 0;
449 }
450
451 // @notice Returns next free NFT ID.
452 //
453 // Selector: nextTokenId() 75794a3c
454 function nextTokenId() public view returns (uint256) {
455 require(false, stub_error);
456 dummy;
457 return 0;
458 }
459
460 // @notice Function to mint multiple tokens.
461 // @dev `tokenIds` should be an array of consecutive numbers and first number
462 // should be obtained with `nextTokenId` method
463 // @param to The new owner
464 // @param tokenIds IDs of the minted NFTs
465 //
466 // Selector: mintBulk(address,uint256[]) 44a9945e
467 function mintBulk(address to, uint256[] memory tokenIds)
468 public
469 returns (bool)
470 {
471 require(false, stub_error);
472 to;
473 tokenIds;
474 dummy = 0;
475 return false;
476 }
477
478 // @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 consecutive
480 // numbers and first number should be obtained with `nextTokenId` method
481 // @param to The new owner
482 // @param tokens array of pairs of token ID and token URI for minted tokens
483 //
484 // Selector: mintBulkWithTokenURI(address,(uint256,string)[]) 36543006
485 function mintBulkWithTokenURI(address to, Tuple0[] memory tokens)
486 public
487 returns (bool)
488 {
489 require(false, stub_error);
490 to;
491 tokens;
492 dummy = 0;
493 return false;
494 }
495}
496
497// Selector: ffe4da23
498contract Collection is Dummy, ERC165 {
499 // Set collection property.
500 //
501 // @param key Property key.
502 // @param value Propery value.
503 //
504 // Selector: setCollectionProperty(string,bytes) 2f073f66
505 function setCollectionProperty(string memory key, bytes memory value)
506 public
507 {
508 require(false, stub_error);
509 key;
510 value;
511 dummy = 0;
512 }
513
514 // Delete collection property.
515 //
516 // @param key Property key.
517 //
518 // Selector: deleteCollectionProperty(string) 7b7debce
519 function deleteCollectionProperty(string memory key) public {
520 require(false, stub_error);
521 key;
522 dummy = 0;
523 }
524
525 // Get collection property.
526 //
527 // @dev Throws error if key not found.
528 //
529 // @param key Property key.
530 // @return bytes The property corresponding to the key.
531 //
532 // Selector: collectionProperty(string) cf24fd6d
533 function collectionProperty(string memory key)
534 public
535 view
536 returns (bytes memory)
537 {
538 require(false, stub_error);
539 key;
540 dummy;
541 return hex"";
542 }
543
544 // Set the sponsor of the collection.
545 //
546 // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.
547 //
548 // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.
549 //
550 // Selector: setCollectionSponsor(address) 7623402e
551 function setCollectionSponsor(address sponsor) public {
552 require(false, stub_error);
553 sponsor;
554 dummy = 0;
555 }
556
557 // Collection sponsorship confirmation.
558 //
559 // @dev After setting the sponsor for the collection, it must be confirmed with this function.
560 //
561 // Selector: confirmCollectionSponsorship() 3c50e97a
562 function confirmCollectionSponsorship() public {
563 require(false, stub_error);
564 dummy = 0;
565 }
566
567 // Set limits for the collection.
568 // @dev Throws error if limit not found.
569 // @param limit Name of the limit. Valid names:
570 // "accountTokenOwnershipLimit",
571 // "sponsoredDataSize",
572 // "sponsoredDataRateLimit",
573 // "tokenLimit",
574 // "sponsorTransferTimeout",
575 // "sponsorApproveTimeout"
576 // @param value Value of the limit.
577 //
578 // Selector: setCollectionLimit(string,uint32) 6a3841db
579 function setCollectionLimit(string memory limit, uint32 value) public {
580 require(false, stub_error);
581 limit;
582 value;
583 dummy = 0;
584 }
585
586 // Set limits for the collection.
587 // @dev Throws error if limit not found.
588 // @param limit Name of the limit. Valid names:
589 // "ownerCanTransfer",
590 // "ownerCanDestroy",
591 // "transfersEnabled"
592 // @param value Value of the limit.
593 //
594 // Selector: setCollectionLimit(string,bool) 993b7fba
595 function setCollectionLimit(string memory limit, bool value) public {
596 require(false, stub_error);
597 limit;
598 value;
599 dummy = 0;
600 }
601
602 // Get contract address.
603 //
604 // Selector: contractAddress() f6b4dfb4
605 function contractAddress() public view returns (address) {
606 require(false, stub_error);
607 dummy;
608 return 0x0000000000000000000000000000000000000000;
609 }
610
611 // Add collection admin by substrate address.
612 // @param new_admin Substrate administrator address.
613 //
614 // Selector: addCollectionAdminSubstrate(uint256) 5730062b
615 function addCollectionAdminSubstrate(uint256 newAdmin) public {
616 require(false, stub_error);
617 newAdmin;
618 dummy = 0;
619 }
620
621 // Remove collection admin by substrate address.
622 // @param admin Substrate administrator address.
623 //
624 // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9
625 function removeCollectionAdminSubstrate(uint256 admin) public {
626 require(false, stub_error);
627 admin;
628 dummy = 0;
629 }
630
631 // Add collection admin.
632 // @param new_admin Address of the added administrator.
633 //
634 // Selector: addCollectionAdmin(address) 92e462c7
635 function addCollectionAdmin(address newAdmin) public {
636 require(false, stub_error);
637 newAdmin;
638 dummy = 0;
639 }
640
641 // Remove collection admin.
642 //
643 // @param new_admin Address of the removed administrator.
644 //
645 // Selector: removeCollectionAdmin(address) fafd7b42
646 function removeCollectionAdmin(address admin) public {
647 require(false, stub_error);
648 admin;
649 dummy = 0;
650 }
651
652 // Toggle accessibility of collection nesting.
653 //
654 // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
655 //
656 // Selector: setCollectionNesting(bool) 112d4586
657 function setCollectionNesting(bool enable) public {
658 require(false, stub_error);
659 enable;
660 dummy = 0;
661 }
662
663 // Toggle accessibility of collection nesting.
664 //
665 // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
666 // @param collections Addresses of collections that will be available for nesting.
667 //
668 // Selector: setCollectionNesting(bool,address[]) 64872396
669 function setCollectionNesting(bool enable, address[] memory collections)
670 public
671 {
672 require(false, stub_error);
673 enable;
674 collections;
675 dummy = 0;
676 }
677
678 // Set the collection access method.
679 // @param mode Access mode
680 // 0 for Normal
681 // 1 for AllowList
682 //
683 // Selector: setCollectionAccess(uint8) 41835d4c
684 function setCollectionAccess(uint8 mode) public {
685 require(false, stub_error);
686 mode;
687 dummy = 0;
688 }
689
690 // Add the user to the allowed list.
691 //
692 // @param user Address of a trusted user.
693 //
694 // Selector: addToCollectionAllowList(address) 67844fe6
695 function addToCollectionAllowList(address user) public {
696 require(false, stub_error);
697 user;
698 dummy = 0;
699 }
700
701 // Remove the user from the allowed list.
702 //
703 // @param user Address of a removed user.
704 //
705 // Selector: removeFromCollectionAllowList(address) 85c51acb
706 function removeFromCollectionAllowList(address user) public {
707 require(false, stub_error);
708 user;
709 dummy = 0;
710 }
711
712 // Switch permission for minting.
713 //
714 // @param mode Enable if "true".
715 //
716 // Selector: setCollectionMintMode(bool) 00018e84
717 function setCollectionMintMode(bool mode) public {
718 require(false, stub_error);
719 mode;
720 dummy = 0;
721 }
722
723 // Check that account is the owner or admin of the collection
724 //
725 // @param user account to verify
726 // @return "true" if account is the owner or admin
727 //
728 // Selector: isOwnerOrAdmin(address) 9811b0c7
729 function isOwnerOrAdmin(address user) public view returns (bool) {
730 require(false, stub_error);
731 user;
732 dummy;
733 return false;
734 }
735
736 // Check that substrate account is the owner or admin of the collection
737 //
738 // @param user account to verify
739 // @return "true" if account is the owner or admin
740 //
741 // Selector: isOwnerOrAdminSubstrate(uint256) 68910e00
742 function isOwnerOrAdminSubstrate(uint256 user) public view returns (bool) {
743 require(false, stub_error);
744 user;
745 dummy;
746 return false;
747 }
748
749 // Returns collection type
750 //
751 // @return `Fungible` or `NFT` or `ReFungible`
752 //
753 // Selector: uniqueCollectionType() d34b55b8
754 function uniqueCollectionType() public returns (string memory) {
755 require(false, stub_error);
756 dummy = 0;
757 return "";
758 }
759
760 // Changes collection owner to another account
761 //
762 // @dev Owner can be changed only by current owner
763 // @param newOwner new owner account
764 //
765 // Selector: setOwner(address) 13af4035
766 function setOwner(address newOwner) public {
767 require(false, stub_error);
768 newOwner;
769 dummy = 0;
770 }
771
772 // Changes collection owner to another substrate account
773 //
774 // @dev Owner can be changed only by current owner
775 // @param newOwner new owner substrate account
776 //
777 // Selector: setOwnerSubstrate(uint256) b212138f
778 function setOwnerSubstrate(uint256 newOwner) public {
779 require(false, stub_error);
780 newOwner;
781 dummy = 0;
782 }
783}
784793
785contract UniqueNFT is794contract UniqueNFT is
786 Dummy,795 Dummy,
modifiedpallets/refungible/src/erc.rsdiffbeforeafterboth
53pub const ADDRESS_FOR_PARTIALLY_OWNED_TOKENS: H160 = H160::repeat_byte(0xff);53pub const ADDRESS_FOR_PARTIALLY_OWNED_TOKENS: H160 = H160::repeat_byte(0xff);
5454
55/// @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}
199199
200#[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 contract
203 fn name(&self) -> Result<string> {203 fn name(&self) -> Result<string> {
258258
259/// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension259/// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
260/// @dev See https://eips.ethereum.org/EIPS/eip-721260/// @dev See https://eips.ethereum.org/EIPS/eip-721
261#[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 RFTs
264 /// @param index A counter less than `totalSupply()`264 /// @param index A counter less than `totalSupply()`
285285
286/// @title ERC-721 Non-Fungible Token Standard286/// @title ERC-721 Non-Fungible Token Standard
287/// @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.md
288#[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 owner
291 /// @dev RFTs assigned to the zero address are considered invalid, and this291 /// @dev RFTs assigned to the zero address are considered invalid, and this
322 _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 implemetable
328 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 implemetable
340 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 NFT
351 /// @param to The new owner349 /// @param to The new owner
352 /// @param tokenId The NFT to transfer350 /// @param tokenId The NFT to transfer
353 /// @param _value Not used for an NFT
354 #[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}
439429
440/// @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 authorized
458}448}
459449
460/// @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}
617607
618/// @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 RFT
622 /// @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 owner
626 /// @param tokenId The RFT to transfer616 /// @param tokenId The RFT to transfer
627 /// @param _value Not used for an RFT
628 #[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 RFT
657 /// @param tokenId The RFT to transfer640 /// @param tokenId The RFT to transfer
658 /// @param _value Not used for an RFT
659 #[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}
802778
803#[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)]
modifiedpallets/refungible/src/erc_token.rsdiffbeforeafterboth
4949
50pub struct RefungibleTokenHandle<T: Config>(pub RefungibleHandle<T>, pub TokenId);50pub struct RefungibleTokenHandle<T: Config>(pub RefungibleHandle<T>, pub TokenId);
5151
52#[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}
8989
90#[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.md
140#[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}
248248
249#[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}
307307
308#[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]> {}
modifiedpallets/refungible/src/stubs/UniqueRefungible.rawdiffbeforeafterboth

binary blob — no preview

modifiedpallets/refungible/src/stubs/UniqueRefungible.soldiffbeforeafterboth
33
4pragma solidity >=0.8.0 <0.9.0;4pragma solidity >=0.8.0 <0.9.0;
5
6// Anonymous struct
7struct Tuple0 {
8 uint256 field_0;
9 string field_1;
10}
115
12// Common stubs holder6/// @dev common stubs holder
13contract 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}
2923
30// 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 0x41369377
26contract 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 tokenOwner
40 ) public {
41 require(false, stub_error);
42 key;
43 isMutable;
44 collectionAdmin;
45 tokenOwner;
46 dummy = 0;
47 }
48
49 /// @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 value
60 ) public {
61 require(false, stub_error);
62 tokenId;
63 key;
64 value;
65 dummy = 0;
66 }
67
68 /// @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 }
80
81 /// @notice Get token property value.
82 /// @dev Throws error if key not found
83 /// @param tokenId ID of the token.
84 /// @param key Property key.
85 /// @return Property value bytes
86 /// @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 public
90 view
91 returns (bytes memory)
92 {
93 require(false, stub_error);
94 tokenId;
95 key;
96 dummy;
97 return hex"";
98 }
99}
100
101/// @title A contract that allows you to work with collections.
102/// @dev the ERC-165 identifier for this interface is 0xffe4da23
103contract 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 public
112 {
113 require(false, stub_error);
114 key;
115 value;
116 dummy = 0;
117 }
118
119 /// 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 }
129
130 /// 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 public
140 view
141 returns (bytes memory)
142 {
143 require(false, stub_error);
144 key;
145 dummy;
146 return hex"";
147 }
148
149 /// 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 }
161
162 /// 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 }
171
172 /// 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 }
190
191 /// 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 }
206
207 /// 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 }
215
216 /// 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 }
225
226 /// 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 }
235
236 /// 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 }
245
246 /// 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 }
256
257 /// 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 }
267
268 /// 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 public
276 {
277 require(false, stub_error);
278 enable;
279 collections;
280 dummy = 0;
281 }
282
283 /// Set the collection access method.
284 /// @param mode Access mode
285 /// 0 for Normal
286 /// 1 for AllowList
287 /// @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 }
294
295 /// 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 }
305
306 /// 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 }
316
317 /// 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 }
327
328 /// Check that account is the owner or admin of the collection
329 ///
330 /// @param user account to verify
331 /// @return "true" if account is the owner or admin
332 /// @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 }
340
341 /// Check that substrate account is the owner or admin of the collection
342 ///
343 /// @param user account to verify
344 /// @return "true" if account is the owner or admin
345 /// @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 }
353
354 /// Returns collection type
355 ///
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 }
364
365 /// Changes collection owner to another account
366 ///
367 /// @dev Owner can be changed only by current owner
368 /// @param newOwner new owner account
369 /// @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 }
376
377 /// Changes collection owner to another substrate account
378 ///
379 /// @dev Owner can be changed only by current owner
380 /// @param newOwner new owner substrate account
381 /// @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}
389
390/// @title ERC721 Token that can be irreversibly burned (destroyed).
391/// @dev the ERC-165 identifier for this interface is 0x42966c68
392contract ERC721Burnable is Dummy, ERC165 {
393 /// @notice Burns a specific ERC721 token.
394 /// @dev Throws unless `msg.sender` is the current RFT owner, or an authorized
395 /// operator of the current owner.
396 /// @param tokenId The RFT to approve
397 /// @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}
405
406/// @dev inlined interface
407contract ERC721MintableEvents {
408 event MintingFinished();
409}
410
411/// @title ERC721 minting logic.
412/// @dev the ERC-165 identifier for this interface is 0x68ccfe89
413contract 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 }
421
422 /// @notice Function to mint token.
423 /// @dev `tokenId` should be obtained with `nextTokenId` method,
424 /// unlike standard, you can't specify it manually
425 /// @param to The new owner
426 /// @param tokenId ID of the minted RFT
427 /// @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 }
436
437 /// @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 manually
440 /// @param to The new owner
441 /// @param tokenId ID of the minted RFT
442 /// @param tokenUri Token URI that would be stored in the RFT properties
443 /// @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 tokenUri
449 ) public returns (bool) {
450 require(false, stub_error);
451 to;
452 tokenId;
453 tokenUri;
454 dummy = 0;
455 return false;
456 }
457
458 /// @dev Not implemented
459 /// @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}
467
468/// @title Unique extensions for ERC721.
469/// @dev the ERC-165 identifier for this interface is 0x7c3bef89
470contract ERC721UniqueExtensions is Dummy, ERC165 {
471 /// @notice Transfer ownership of an RFT
472 /// @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 owner
476 /// @param tokenId The RFT to transfer
477 /// @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 }
485
486 /// @notice Burns a specific ERC721 token.
487 /// @dev Throws unless `msg.sender` is the current owner or an authorized
488 /// operator for this RFT. Throws if `from` is not the current owner. Throws
489 /// 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 RFT
492 /// @param tokenId The RFT to transfer
493 /// @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 }
501
502 /// @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 }
510
511 /// @notice Function to mint multiple tokens.
512 /// @dev `tokenIds` should be an array of consecutive numbers and first number
513 /// should be obtained with `nextTokenId` method
514 /// @param to The new owner
515 /// @param tokenIds IDs of the minted RFTs
516 /// @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 public
520 returns (bool)
521 {
522 require(false, stub_error);
523 to;
524 tokenIds;
525 dummy = 0;
526 return false;
527 }
528
529 /// @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 consecutive
531 /// numbers and first number should be obtained with `nextTokenId` method
532 /// @param to The new owner
533 /// @param tokens array of pairs of token ID and token URI for minted tokens
534 /// @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 public
538 returns (bool)
539 {
540 require(false, stub_error);
541 to;
542 tokens;
543 dummy = 0;
544 return false;
545 }
546
547 /// Returns EVM address for refungible token
548 ///
549 /// @param token ID of the token
550 /// @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}
559
560/// @dev anonymous struct
561struct Tuple8 {
562 uint256 field_0;
563 string field_1;
564}
565
566/// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
567/// @dev See https://eips.ethereum.org/EIPS/eip-721
568/// @dev the ERC-165 identifier for this interface is 0x780e9d63
569contract ERC721Enumerable is Dummy, ERC165 {
570 /// @notice Enumerate valid RFTs
571 /// @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 }
582
583 /// Not implemented
584 /// @dev EVM selector for this function is: 0x2f745c59,
585 /// or in textual repr: tokenOfOwnerByIndex(address,uint256)
586 function tokenOfOwnerByIndex(address owner, uint256 index)
587 public
588 view
589 returns (uint256)
590 {
591 require(false, stub_error);
592 owner;
593 index;
594 dummy;
595 return 0;
596 }
597
598 /// @notice Count RFTs tracked by this contract
599 /// @return A count of valid RFTs tracked by this contract, where each one of
600 /// them has an assigned and queryable owner not equal to the zero address
601 /// @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}
609
610/// @dev the ERC-165 identifier for this interface is 0x5b5e139f
611contract ERC721Metadata is Dummy, ERC165 {
612 /// @notice A descriptive name for a collection of RFTs in this contract
613 /// @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 }
620
621 /// @notice An abbreviated name for RFTs in this contract
622 /// @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 }
629
630 /// @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 suffix
636 /// otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings).
637 ///
638 /// @return token's const_metadata
639 /// @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}
648
649/// @dev inlined interface
31contract ERC721Events {650contract ERC721Events {
32 event Transfer(651 event Transfer(
33 address indexed from,652 address indexed from,
46 );665 );
47}666}
48667
49// Inline668/// @title ERC-721 Non-Fungible Token Standard
50contract ERC721MintableEvents {669/// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
51 event MintingFinished();670/// @dev the ERC-165 identifier for this interface is 0x58800161
52}
53
54// Selector: 41369377
55contract 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) 222d97fa
64 function setTokenPropertyPermission(
65 string memory key,
66 bool isMutable,
67 bool collectionAdmin,
68 bool tokenOwner
69 ) public {
70 require(false, stub_error);
71 key;
72 isMutable;
73 collectionAdmin;
74 tokenOwner;
75 dummy = 0;
76 }
77
78 // @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) 1752d67b
85 function setProperty(
86 uint256 tokenId,
87 string memory key,
88 bytes memory value
89 ) public {
90 require(false, stub_error);
91 tokenId;
92 key;
93 value;
94 dummy = 0;
95 }
96
97 // @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) 066111d1
103 function deleteProperty(uint256 tokenId, string memory key) public {
104 require(false, stub_error);
105 tokenId;
106 key;
107 dummy = 0;
108 }
109
110 // @notice Get token property value.
111 // @dev Throws error if key not found
112 // @param tokenId ID of the token.
113 // @param key Property key.
114 // @return Property value bytes
115 //
116 // Selector: property(uint256,string) 7228c327
117 function property(uint256 tokenId, string memory key)
118 public
119 view
120 returns (bytes memory)
121 {
122 require(false, stub_error);
123 tokenId;
124 key;
125 dummy;
126 return hex"";
127 }
128}
129
130// Selector: 42966c68
131contract ERC721Burnable is Dummy, ERC165 {
132 // @notice Burns a specific ERC721 token.
133 // @dev Throws unless `msg.sender` is the current RFT owner, or an authorized
134 // operator of the current owner.
135 // @param tokenId The RFT to approve
136 //
137 // Selector: burn(uint256) 42966c68
138 function burn(uint256 tokenId) public {
139 require(false, stub_error);
140 tokenId;
141 dummy = 0;
142 }
143}
144
145// Selector: 58800161
146contract 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 owner
148 // @dev RFTs assigned to the zero address are considered invalid, and this673 /// @dev RFTs assigned to the zero address are considered invalid, and this
149 // 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 balance
151 // @return The number of RFTs owned by `owner`, possibly zero676 /// @return The number of RFTs owned by `owner`, possibly zero
152 //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 }
160685
161 // @notice Find the owner of an RFT686 /// @notice Find the owner of an RFT
162 // @dev RFTs assigned to zero address are considered invalid, and queries687 /// @dev RFTs assigned to zero address are considered invalid, and queries
163 // about them do throw.688 /// about them do throw.
164 // Returns special 0xffffffffffffffffffffffffffffffffffffffff address for689 /// Returns special 0xffffffffffffffffffffffffffffffffffffffff address for
165 // 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 RFT
167 // @return The address of the owner of the RFT692 /// @return The address of the owner of the RFT
168 //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 }
176701
177 // @dev Not implemented702 /// @dev Not implemented
178 //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 }
193718
194 // @dev Not implemented719 /// @dev Not implemented
195 //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 }
208733
209 // @notice Transfer ownership of an RFT -- THE CALLER IS RESPONSIBLE734 /// @notice Transfer ownership of an RFT -- THE CALLER IS RESPONSIBLE
210 // TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE735 /// TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE
211 // THEY MAY BE PERMANENTLY LOST736 /// THEY MAY BE PERMANENTLY LOST
212 // @dev Throws unless `msg.sender` is the current owner or an authorized737 /// @dev Throws unless `msg.sender` is the current owner or an authorized
213 // 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. Throws
214 // 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 NFT
217 // @param to The new owner742 /// @param to The new owner
218 // @param tokenId The NFT to transfer743 /// @param tokenId The NFT to transfer
219 // @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 }
233757
234 // @dev Not implemented758 /// @dev Not implemented
235 //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 }
243767
244 // @dev Not implemented768 /// @dev Not implemented
245 //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 }
253777
254 // @dev Not implemented778 /// @dev Not implemented
255 //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 }
263787
264 // @dev Not implemented788 /// @dev Not implemented
265 //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 public
269 view793 view
277 }801 }
278}802}
279
280// Selector: 5b5e139f
281contract ERC721Metadata is Dummy, ERC165 {
282 // @notice A descriptive name for a collection of RFTs in this contract
283 //
284 // Selector: name() 06fdde03
285 function name() public view returns (string memory) {
286 require(false, stub_error);
287 dummy;
288 return "";
289 }
290
291 // @notice An abbreviated name for RFTs in this contract
292 //
293 // Selector: symbol() 95d89b41
294 function symbol() public view returns (string memory) {
295 require(false, stub_error);
296 dummy;
297 return "";
298 }
299
300 // @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 suffix
306 // otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings).
307 //
308 // @return token's const_metadata
309 //
310 // Selector: tokenURI(uint256) c87b56dd
311 function tokenURI(uint256 tokenId) public view returns (string memory) {
312 require(false, stub_error);
313 tokenId;
314 dummy;
315 return "";
316 }
317}
318
319// Selector: 68ccfe89
320contract ERC721Mintable is Dummy, ERC165, ERC721MintableEvents {
321 // Selector: mintingFinished() 05d2035b
322 function mintingFinished() public view returns (bool) {
323 require(false, stub_error);
324 dummy;
325 return false;
326 }
327
328 // @notice Function to mint token.
329 // @dev `tokenId` should be obtained with `nextTokenId` method,
330 // unlike standard, you can't specify it manually
331 // @param to The new owner
332 // @param tokenId ID of the minted RFT
333 //
334 // Selector: mint(address,uint256) 40c10f19
335 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 }
342
343 // @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 manually
346 // @param to The new owner
347 // @param tokenId ID of the minted RFT
348 // @param tokenUri Token URI that would be stored in the RFT properties
349 //
350 // Selector: mintWithTokenURI(address,uint256,string) 50bb4e7f
351 function mintWithTokenURI(
352 address to,
353 uint256 tokenId,
354 string memory tokenUri
355 ) public returns (bool) {
356 require(false, stub_error);
357 to;
358 tokenId;
359 tokenUri;
360 dummy = 0;
361 return false;
362 }
363
364 // @dev Not implemented
365 //
366 // Selector: finishMinting() 7d64bcb4
367 function finishMinting() public returns (bool) {
368 require(false, stub_error);
369 dummy = 0;
370 return false;
371 }
372}
373
374// Selector: 780e9d63
375contract ERC721Enumerable is Dummy, ERC165 {
376 // @notice Enumerate valid RFTs
377 // @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) 4f6ccce7
382 function tokenByIndex(uint256 index) public view returns (uint256) {
383 require(false, stub_error);
384 index;
385 dummy;
386 return 0;
387 }
388
389 // Not implemented
390 //
391 // Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59
392 function tokenOfOwnerByIndex(address owner, uint256 index)
393 public
394 view
395 returns (uint256)
396 {
397 require(false, stub_error);
398 owner;
399 index;
400 dummy;
401 return 0;
402 }
403
404 // @notice Count RFTs tracked by this contract
405 // @return A count of valid RFTs tracked by this contract, where each one of
406 // them has an assigned and queryable owner not equal to the zero address
407 //
408 // Selector: totalSupply() 18160ddd
409 function totalSupply() public view returns (uint256) {
410 require(false, stub_error);
411 dummy;
412 return 0;
413 }
414}
415
416// Selector: 7c3bef89
417contract ERC721UniqueExtensions is Dummy, ERC165 {
418 // @notice Transfer ownership of an RFT
419 // @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 owner
423 // @param tokenId The RFT to transfer
424 // @param _value Not used for an RFT
425 //
426 // Selector: transfer(address,uint256) a9059cbb
427 function transfer(address to, uint256 tokenId) public {
428 require(false, stub_error);
429 to;
430 tokenId;
431 dummy = 0;
432 }
433
434 // @notice Burns a specific ERC721 token.
435 // @dev Throws unless `msg.sender` is the current owner or an authorized
436 // operator for this RFT. Throws if `from` is not the current owner. Throws
437 // 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 RFT
440 // @param tokenId The RFT to transfer
441 // @param _value Not used for an RFT
442 //
443 // Selector: burnFrom(address,uint256) 79cc6790
444 function burnFrom(address from, uint256 tokenId) public {
445 require(false, stub_error);
446 from;
447 tokenId;
448 dummy = 0;
449 }
450
451 // @notice Returns next free RFT ID.
452 //
453 // Selector: nextTokenId() 75794a3c
454 function nextTokenId() public view returns (uint256) {
455 require(false, stub_error);
456 dummy;
457 return 0;
458 }
459
460 // @notice Function to mint multiple tokens.
461 // @dev `tokenIds` should be an array of consecutive numbers and first number
462 // should be obtained with `nextTokenId` method
463 // @param to The new owner
464 // @param tokenIds IDs of the minted RFTs
465 //
466 // Selector: mintBulk(address,uint256[]) 44a9945e
467 function mintBulk(address to, uint256[] memory tokenIds)
468 public
469 returns (bool)
470 {
471 require(false, stub_error);
472 to;
473 tokenIds;
474 dummy = 0;
475 return false;
476 }
477
478 // @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 consecutive
480 // numbers and first number should be obtained with `nextTokenId` method
481 // @param to The new owner
482 // @param tokens array of pairs of token ID and token URI for minted tokens
483 //
484 // Selector: mintBulkWithTokenURI(address,(uint256,string)[]) 36543006
485 function mintBulkWithTokenURI(address to, Tuple0[] memory tokens)
486 public
487 returns (bool)
488 {
489 require(false, stub_error);
490 to;
491 tokens;
492 dummy = 0;
493 return false;
494 }
495
496 // Returns EVM address for refungible token
497 //
498 // @param token ID of the token
499 //
500 // Selector: tokenContractAddress(uint256) ab76fac6
501 function tokenContractAddress(uint256 token) public view returns (address) {
502 require(false, stub_error);
503 token;
504 dummy;
505 return 0x0000000000000000000000000000000000000000;
506 }
507}
508
509// Selector: ffe4da23
510contract Collection is Dummy, ERC165 {
511 // Set collection property.
512 //
513 // @param key Property key.
514 // @param value Propery value.
515 //
516 // Selector: setCollectionProperty(string,bytes) 2f073f66
517 function setCollectionProperty(string memory key, bytes memory value)
518 public
519 {
520 require(false, stub_error);
521 key;
522 value;
523 dummy = 0;
524 }
525
526 // Delete collection property.
527 //
528 // @param key Property key.
529 //
530 // Selector: deleteCollectionProperty(string) 7b7debce
531 function deleteCollectionProperty(string memory key) public {
532 require(false, stub_error);
533 key;
534 dummy = 0;
535 }
536
537 // Get collection property.
538 //
539 // @dev Throws error if key not found.
540 //
541 // @param key Property key.
542 // @return bytes The property corresponding to the key.
543 //
544 // Selector: collectionProperty(string) cf24fd6d
545 function collectionProperty(string memory key)
546 public
547 view
548 returns (bytes memory)
549 {
550 require(false, stub_error);
551 key;
552 dummy;
553 return hex"";
554 }
555
556 // Set the sponsor of the collection.
557 //
558 // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.
559 //
560 // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.
561 //
562 // Selector: setCollectionSponsor(address) 7623402e
563 function setCollectionSponsor(address sponsor) public {
564 require(false, stub_error);
565 sponsor;
566 dummy = 0;
567 }
568
569 // Collection sponsorship confirmation.
570 //
571 // @dev After setting the sponsor for the collection, it must be confirmed with this function.
572 //
573 // Selector: confirmCollectionSponsorship() 3c50e97a
574 function confirmCollectionSponsorship() public {
575 require(false, stub_error);
576 dummy = 0;
577 }
578
579 // Set limits for the collection.
580 // @dev Throws error if limit not found.
581 // @param limit Name of the limit. Valid names:
582 // "accountTokenOwnershipLimit",
583 // "sponsoredDataSize",
584 // "sponsoredDataRateLimit",
585 // "tokenLimit",
586 // "sponsorTransferTimeout",
587 // "sponsorApproveTimeout"
588 // @param value Value of the limit.
589 //
590 // Selector: setCollectionLimit(string,uint32) 6a3841db
591 function setCollectionLimit(string memory limit, uint32 value) public {
592 require(false, stub_error);
593 limit;
594 value;
595 dummy = 0;
596 }
597
598 // Set limits for the collection.
599 // @dev Throws error if limit not found.
600 // @param limit Name of the limit. Valid names:
601 // "ownerCanTransfer",
602 // "ownerCanDestroy",
603 // "transfersEnabled"
604 // @param value Value of the limit.
605 //
606 // Selector: setCollectionLimit(string,bool) 993b7fba
607 function setCollectionLimit(string memory limit, bool value) public {
608 require(false, stub_error);
609 limit;
610 value;
611 dummy = 0;
612 }
613
614 // Get contract address.
615 //
616 // Selector: contractAddress() f6b4dfb4
617 function contractAddress() public view returns (address) {
618 require(false, stub_error);
619 dummy;
620 return 0x0000000000000000000000000000000000000000;
621 }
622
623 // Add collection admin by substrate address.
624 // @param new_admin Substrate administrator address.
625 //
626 // Selector: addCollectionAdminSubstrate(uint256) 5730062b
627 function addCollectionAdminSubstrate(uint256 newAdmin) public {
628 require(false, stub_error);
629 newAdmin;
630 dummy = 0;
631 }
632
633 // Remove collection admin by substrate address.
634 // @param admin Substrate administrator address.
635 //
636 // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9
637 function removeCollectionAdminSubstrate(uint256 admin) public {
638 require(false, stub_error);
639 admin;
640 dummy = 0;
641 }
642
643 // Add collection admin.
644 // @param new_admin Address of the added administrator.
645 //
646 // Selector: addCollectionAdmin(address) 92e462c7
647 function addCollectionAdmin(address newAdmin) public {
648 require(false, stub_error);
649 newAdmin;
650 dummy = 0;
651 }
652
653 // Remove collection admin.
654 //
655 // @param new_admin Address of the removed administrator.
656 //
657 // Selector: removeCollectionAdmin(address) fafd7b42
658 function removeCollectionAdmin(address admin) public {
659 require(false, stub_error);
660 admin;
661 dummy = 0;
662 }
663
664 // Toggle accessibility of collection nesting.
665 //
666 // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
667 //
668 // Selector: setCollectionNesting(bool) 112d4586
669 function setCollectionNesting(bool enable) public {
670 require(false, stub_error);
671 enable;
672 dummy = 0;
673 }
674
675 // Toggle accessibility of collection nesting.
676 //
677 // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
678 // @param collections Addresses of collections that will be available for nesting.
679 //
680 // Selector: setCollectionNesting(bool,address[]) 64872396
681 function setCollectionNesting(bool enable, address[] memory collections)
682 public
683 {
684 require(false, stub_error);
685 enable;
686 collections;
687 dummy = 0;
688 }
689
690 // Set the collection access method.
691 // @param mode Access mode
692 // 0 for Normal
693 // 1 for AllowList
694 //
695 // Selector: setCollectionAccess(uint8) 41835d4c
696 function setCollectionAccess(uint8 mode) public {
697 require(false, stub_error);
698 mode;
699 dummy = 0;
700 }
701
702 // Add the user to the allowed list.
703 //
704 // @param user Address of a trusted user.
705 //
706 // Selector: addToCollectionAllowList(address) 67844fe6
707 function addToCollectionAllowList(address user) public {
708 require(false, stub_error);
709 user;
710 dummy = 0;
711 }
712
713 // Remove the user from the allowed list.
714 //
715 // @param user Address of a removed user.
716 //
717 // Selector: removeFromCollectionAllowList(address) 85c51acb
718 function removeFromCollectionAllowList(address user) public {
719 require(false, stub_error);
720 user;
721 dummy = 0;
722 }
723
724 // Switch permission for minting.
725 //
726 // @param mode Enable if "true".
727 //
728 // Selector: setCollectionMintMode(bool) 00018e84
729 function setCollectionMintMode(bool mode) public {
730 require(false, stub_error);
731 mode;
732 dummy = 0;
733 }
734
735 // Check that account is the owner or admin of the collection
736 //
737 // @param user account to verify
738 // @return "true" if account is the owner or admin
739 //
740 // Selector: isOwnerOrAdmin(address) 9811b0c7
741 function isOwnerOrAdmin(address user) public view returns (bool) {
742 require(false, stub_error);
743 user;
744 dummy;
745 return false;
746 }
747
748 // Check that substrate account is the owner or admin of the collection
749 //
750 // @param user account to verify
751 // @return "true" if account is the owner or admin
752 //
753 // Selector: isOwnerOrAdminSubstrate(uint256) 68910e00
754 function isOwnerOrAdminSubstrate(uint256 user) public view returns (bool) {
755 require(false, stub_error);
756 user;
757 dummy;
758 return false;
759 }
760
761 // Returns collection type
762 //
763 // @return `Fungible` or `NFT` or `ReFungible`
764 //
765 // Selector: uniqueCollectionType() d34b55b8
766 function uniqueCollectionType() public returns (string memory) {
767 require(false, stub_error);
768 dummy = 0;
769 return "";
770 }
771
772 // Changes collection owner to another account
773 //
774 // @dev Owner can be changed only by current owner
775 // @param newOwner new owner account
776 //
777 // Selector: setOwner(address) 13af4035
778 function setOwner(address newOwner) public {
779 require(false, stub_error);
780 newOwner;
781 dummy = 0;
782 }
783
784 // Changes collection owner to another substrate account
785 //
786 // @dev Owner can be changed only by current owner
787 // @param newOwner new owner substrate account
788 //
789 // Selector: setOwnerSubstrate(uint256) b212138f
790 function setOwnerSubstrate(uint256 newOwner) public {
791 require(false, stub_error);
792 newOwner;
793 dummy = 0;
794 }
795}
796803
797contract UniqueRefungible is804contract UniqueRefungible is
798 Dummy,805 Dummy,
modifiedpallets/refungible/src/stubs/UniqueRefungibleToken.rawdiffbeforeafterboth

binary blob — no preview

modifiedpallets/refungible/src/stubs/UniqueRefungibleToken.soldiffbeforeafterboth
33
4pragma solidity >=0.8.0 <0.9.0;4pragma solidity >=0.8.0 <0.9.0;
55
6// Common stubs holder6/// @dev common stubs holder
7contract 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}
2323
24// Inline24/// @dev the ERC-165 identifier for this interface is 0x042f1106
25contract 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 public
30 returns (bool)
31 {
32 require(false, stub_error);
33 collection;
34 nftId;
35 dummy = 0;
36 return false;
37 }
38}
39
40/// @dev the ERC-165 identifier for this interface is 0x5755c3f2
41contract 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 }
49
50 /// @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}
58
59/// @dev the ERC-165 identifier for this interface is 0xab8deb37
60contract 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 }
74
75 /// @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}
87
88/// @dev inlined interface
25contract 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}
3397
34// Selector: 042f110698/// @title Standard ERC20 token
35contract 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.md
38 public102/// @dev the ERC-165 identifier for this interface is 0x942e8b22
39 returns (bool)
40 {
41 require(false, stub_error);
42 collection;
43 nftId;
44 dummy = 0;
45 return false;
46 }
47}
48
49// Selector: 5755c3f2
50contract ERC1633 is Dummy, ERC165 {
51 // Selector: parentToken() 80a54001
52 function parentToken() public view returns (address) {
53 require(false, stub_error);
54 dummy;
55 return 0x0000000000000000000000000000000000000000;
56 }
57
58 // Selector: parentTokenId() d7f083f3
59 function parentTokenId() public view returns (uint256) {
60 require(false, stub_error);
61 dummy;
62 return 0;
63 }
64}
65
66// Selector: 942e8b22
67contract 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 }
76112
77 // @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 }
85121
86 // @dev Total number of tokens in existence122 /// @dev Total number of tokens in existence
87 //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 }
94130
95 // @dev Not supported131 /// @dev Not supported
96 //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 }
103139
104 // @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 }
115151
116 // @dev Transfer token for a specified address152 /// @dev Transfer token for a specified address
117 // @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 }
128164
129 // @dev Transfer tokens from one address to another165 /// @dev Transfer tokens from one address to another
130 // @param from address The address which you want to send tokens from166 /// @param from address The address which you want to send tokens from
131 // @param to address The address which you want to transfer to167 /// @param to address The address which you want to transfer to
132 // @param amount uint256 the amount of tokens to be transferred168 /// @param amount uint256 the amount of tokens to be transferred
133 //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 }
147183
148 // @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 old
150 // 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 this
151 // 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-263524729
153 // @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 }
164200
165 // @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 public
173 view209 view
181 }217 }
182}218}
183
184// Selector: ab8deb37
185contract 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) 79cc6790
192 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 }
199
200 // @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) d2418ca7
205 function repartition(uint256 amount) public returns (bool) {
206 require(false, stub_error);
207 amount;
208 dummy = 0;
209 return false;
210 }
211}
212219
213contract UniqueRefungibleToken is220contract UniqueRefungibleToken is
214 Dummy,221 Dummy,
modifiedpallets/unique/src/eth/mod.rsdiffbeforeafterboth
203}203}
204204
205/// @title Contract, which allows users to operate with collections205/// @title Contract, which allows users to operate with collections
206#[solidity_interface(name = "CollectionHelpers", events(CollectionHelpersEvents))]206#[solidity_interface(name = CollectionHelpers, events(CollectionHelpersEvents))]
207impl<T> EvmCollectionHelpers<T>207impl<T> EvmCollectionHelpers<T>
208where208where
209 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 collection
212 /// @param name Name of the collection212 /// @param name Name of the collection
213 /// @param description Informative description of the collection213 /// @param description Informative description of the collection
214 /// @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 applications
215 /// @return address Address of the newly created collection215 /// @return address Address of the newly created collection
216 #[weight(<SelfWeightOf<T>>::create_collection())]216 #[weight(<SelfWeightOf<T>>::create_collection())]
217 fn create_nonfungible_collection(217 fn create_nonfungible_collection(
304 }304 }
305305
306 /// Check if a collection exists306 /// Check if a collection exists
307 /// @param collection_address Address of the collection in question307 /// @param collectionAddress Address of the collection in question
308 /// @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) {
modifiedpallets/unique/src/eth/stubs/CollectionHelpers.rawdiffbeforeafterboth

binary blob — no preview

modifiedpallets/unique/src/eth/stubs/CollectionHelpers.soldiffbeforeafterboth
33
4pragma solidity >=0.8.0 <0.9.0;4pragma solidity >=0.8.0 <0.9.0;
55
6// Common stubs holder6/// @dev common stubs holder
7contract 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}
2323
24// Inline24/// @dev inlined interface
25contract CollectionHelpersEvents {25contract CollectionHelpersEvents {
26 event CollectionCreated(26 event CollectionCreated(
27 address indexed owner,27 address indexed owner,
28 address indexed collectionId28 address indexed collectionId
29 );29 );
30}30}
3131
32// Selector: 675f307432/// @title Contract, which allows users to operate with collections
33/// @dev the ERC-165 identifier for this interface is 0x675f3074
33contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents {34contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents {
34 // Create an NFT collection35 /// Create an NFT collection
35 // @param name Name of the collection36 /// @param name Name of the collection
36 // @param description Informative description of the collection37 /// @param description Informative description of the collection
37 // @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 applications
38 // @return address Address of the newly created collection39 /// @return address Address of the newly created collection
39 //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 }
5354
55 /// @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 }
6971
72 /// @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 }
8386
87 /// @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 }
99103
100 // Check if a collection exists104 /// Check if a collection exists
101 // @param collection_address Address of the collection in question105 /// @param collectionAddress Address of the collection in question
102 // @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 public
107 view111 view
modifiedtests/src/eth/api/CollectionHelpers.soldiffbeforeafterboth
33
4pragma solidity >=0.8.0 <0.9.0;4pragma solidity >=0.8.0 <0.9.0;
55
6// Common stubs holder6/// @dev common stubs holder
7interface Dummy {7interface Dummy {
88
9}9}
12 function supportsInterface(bytes4 interfaceID) external view returns (bool);12 function supportsInterface(bytes4 interfaceID) external view returns (bool);
13}13}
1414
15// Inline15/// @dev inlined interface
16interface CollectionHelpersEvents {16interface CollectionHelpersEvents {
17 event CollectionCreated(17 event CollectionCreated(
18 address indexed owner,18 address indexed owner,
19 address indexed collectionId19 address indexed collectionId
20 );20 );
21}21}
2222
23// Selector: 675f307423/// @title Contract, which allows users to operate with collections
24/// @dev the ERC-165 identifier for this interface is 0x675f3074
24interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents {25interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents {
25 // Create an NFT collection26 /// Create an NFT collection
26 // @param name Name of the collection27 /// @param name Name of the collection
27 // @param description Informative description of the collection28 /// @param description Informative description of the collection
28 // @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 applications
29 // @return address Address of the newly created collection30 /// @return address Address of the newly created collection
30 //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 tokenPrefix
36 ) external returns (address);37 ) external returns (address);
3738
39 /// @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 baseUri
44 ) external returns (address);46 ) external returns (address);
4547
48 /// @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 tokenPrefix
51 ) external returns (address);54 ) external returns (address);
5255
56 /// @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 baseUri
59 ) external returns (address);63 ) external returns (address);
6064
61 // Check if a collection exists65 /// Check if a collection exists
62 // @param collection_address Address of the collection in question66 /// @param collectionAddress Address of the collection in question
63 // @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 external
68 view72 view
modifiedtests/src/eth/api/ContractHelpers.soldiffbeforeafterboth
33
4pragma solidity >=0.8.0 <0.9.0;4pragma solidity >=0.8.0 <0.9.0;
55
6// Anonymous struct6/// @dev anonymous struct
7struct Tuple0 {7struct Tuple0 {
8 address field_0;8 address field_0;
9 uint256 field_1;9 uint256 field_1;
10}10}
1111
12// Common stubs holder12/// @dev common stubs holder
13interface Dummy {13interface Dummy {
1414
15}15}
18 function supportsInterface(bytes4 interfaceID) external view returns (bool);18 function supportsInterface(bytes4 interfaceID) external view returns (bool);
19}19}
2020
21// Selector: 6073d91721/// @dev the ERC-165 identifier for this interface is 0x6073d917
22interface ContractHelpers is Dummy, ERC165 {22interface ContractHelpers is Dummy, ERC165 {
23 // Get contract ovner23 /// Get contract ovner
24 //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) 5152b14c
29 function contractOwner(address contractAddress)29 function contractOwner(address contractAddress)
30 external30 external
31 view31 view
32 returns (address);32 returns (address);
3333
34 // 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) f01fba93
40 function setSponsor(address contractAddress, address sponsor) external;40 function setSponsor(address contractAddress, address sponsor) external;
4141
42 // 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) 89f7d9ae
47 function selfSponsoredEnable(address contractAddress) external;47 function selfSponsoredEnable(address contractAddress) external;
4848
49 // 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) ef784250
54 function removeSponsor(address contractAddress) external;54 function removeSponsor(address contractAddress) external;
5555
56 // 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) abc00001
63 function confirmSponsorship(address contractAddress) external;63 function confirmSponsorship(address contractAddress) external;
6464
65 // 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) 743fc745
71 function getSponsor(address contractAddress)71 function getSponsor(address contractAddress)
72 external72 external
73 view73 view
74 returns (Tuple0 memory);74 returns (Tuple0 memory);
7575
76 // 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) 97418603
82 function hasSponsor(address contractAddress) external view returns (bool);82 function hasSponsor(address contractAddress) external view returns (bool);
8383
84 // 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) 39b9b242
90 function hasPendingSponsor(address contractAddress)90 function hasPendingSponsor(address contractAddress)
91 external91 external
92 view92 view
93 returns (bool);93 returns (bool);
9494
95 // Selector: sponsoringEnabled(address) 6027dc6195 /// Selector: sponsoringEnabled(address) 6027dc61
96 function sponsoringEnabled(address contractAddress)96 function sponsoringEnabled(address contractAddress)
97 external97 external
98 view98 view
99 returns (bool);99 returns (bool);
100100
101 // Selector: setSponsoringMode(address,uint8) fde8a560101 /// Selector: setSponsoringMode(address,uint8) fde8a560
102 function setSponsoringMode(address contractAddress, uint8 mode) external;102 function setSponsoringMode(address contractAddress, uint8 mode) external;
103103
104 // Selector: sponsoringMode(address) b70c7267104 /// Selector: sponsoringMode(address) b70c7267
105 function sponsoringMode(address contractAddress)105 function sponsoringMode(address contractAddress)
106 external106 external
107 view107 view
108 returns (uint8);108 returns (uint8);
109109
110 // Selector: setSponsoringRateLimit(address,uint32) 77b6c908110 /// Selector: setSponsoringRateLimit(address,uint32) 77b6c908
111 function setSponsoringRateLimit(address contractAddress, uint32 rateLimit)111 function setSponsoringRateLimit(address contractAddress, uint32 rateLimit)
112 external;112 external;
113113
114 // Selector: getSponsoringRateLimit(address) 610cfabd114 /// Selector: getSponsoringRateLimit(address) 610cfabd
115 function getSponsoringRateLimit(address contractAddress)115 function getSponsoringRateLimit(address contractAddress)
116 external116 external
117 view117 view
118 returns (uint32);118 returns (uint32);
119119
120 // Selector: allowed(address,address) 5c658165120 /// Selector: allowed(address,address) 5c658165
121 function allowed(address contractAddress, address user)121 function allowed(address contractAddress, address user)
122 external122 external
123 view123 view
124 returns (bool);124 returns (bool);
125125
126 // Selector: allowlistEnabled(address) c772ef6c126 /// Selector: allowlistEnabled(address) c772ef6c
127 function allowlistEnabled(address contractAddress)127 function allowlistEnabled(address contractAddress)
128 external128 external
129 view129 view
130 returns (bool);130 returns (bool);
131131
132 // Selector: toggleAllowlist(address,bool) 36de20f5132 /// Selector: toggleAllowlist(address,bool) 36de20f5
133 function toggleAllowlist(address contractAddress, bool enabled) external;133 function toggleAllowlist(address contractAddress, bool enabled) external;
134134
135 // Selector: toggleAllowed(address,address,bool) 4706cc1c135 /// Selector: toggleAllowed(address,address,bool) 4706cc1c
136 function toggleAllowed(136 function toggleAllowed(
137 address contractAddress,137 address contractAddress,
138 address user,138 address user,
139 bool allowed139 bool isAllowed
140 ) external;140 ) external;
141}141}
142142
modifiedtests/src/eth/api/UniqueFungible.soldiffbeforeafterboth
33
4pragma solidity >=0.8.0 <0.9.0;4pragma solidity >=0.8.0 <0.9.0;
55
6// Common stubs holder6/// @dev common stubs holder
7interface Dummy {7interface Dummy {
88
9}9}
12 function supportsInterface(bytes4 interfaceID) external view returns (bool);12 function supportsInterface(bytes4 interfaceID) external view returns (bool);
13}13}
1414
15// Inline15/// @title A contract that allows you to work with collections.
16/// @dev the ERC-165 identifier for this interface is 0xffe4da23
17interface 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;
26
27 /// 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;
33
34 /// 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 external
44 view
45 returns (bytes memory);
46
47 /// 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;
55
56 /// 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;
62
63 /// 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;
76
77 /// 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;
87
88 /// 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);
92
93 /// 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;
98
99 /// 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;
104
105 /// 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;
110
111 /// 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;
117
118 /// 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;
124
125 /// 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;
133
134 /// Set the collection access method.
135 /// @param mode Access mode
136 /// 0 for Normal
137 /// 1 for AllowList
138 /// @dev EVM selector for this function is: 0x41835d4c,
139 /// or in textual repr: setCollectionAccess(uint8)
140 function setCollectionAccess(uint8 mode) external;
141
142 /// 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;
148
149 /// 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;
155
156 /// 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;
162
163 /// Check that account is the owner or admin of the collection
164 ///
165 /// @param user account to verify
166 /// @return "true" if account is the owner or admin
167 /// @dev EVM selector for this function is: 0x9811b0c7,
168 /// or in textual repr: isOwnerOrAdmin(address)
169 function isOwnerOrAdmin(address user) external view returns (bool);
170
171 /// Check that substrate account is the owner or admin of the collection
172 ///
173 /// @param user account to verify
174 /// @return "true" if account is the owner or admin
175 /// @dev EVM selector for this function is: 0x68910e00,
176 /// or in textual repr: isOwnerOrAdminSubstrate(uint256)
177 function isOwnerOrAdminSubstrate(uint256 user) external view returns (bool);
178
179 /// Returns collection type
180 ///
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);
185
186 /// Changes collection owner to another account
187 ///
188 /// @dev Owner can be changed only by current owner
189 /// @param newOwner new owner account
190 /// @dev EVM selector for this function is: 0x13af4035,
191 /// or in textual repr: setOwner(address)
192 function setOwner(address newOwner) external;
193
194 /// Changes collection owner to another substrate account
195 ///
196 /// @dev Owner can be changed only by current owner
197 /// @param newOwner new owner substrate account
198 /// @dev EVM selector for this function is: 0xb212138f,
199 /// or in textual repr: setOwnerSubstrate(uint256)
200 function setOwnerSubstrate(uint256 newOwner) external;
201}
202
203/// @dev the ERC-165 identifier for this interface is 0x79cc6790
204interface 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}
209
210/// @dev inlined interface
16interface 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}
24219
25// Selector: 79cc6790220/// @dev the ERC-165 identifier for this interface is 0x942e8b22
26interface ERC20UniqueExtensions is Dummy, ERC165 {
27 // Selector: burnFrom(address,uint256) 79cc6790
28 function burnFrom(address from, uint256 amount) external returns (bool);
29}
30
31// Selector: 942e8b22
32interface 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);
35225
36 // 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);
38229
39 // 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);
41233
42 // 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);
44237
238 /// @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);
47241
242 /// @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);
50245
246 /// @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 amount
56 ) external returns (bool);252 ) external returns (bool);
57253
254 /// @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);
60257
258 /// @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 external
64 view262 view
65 returns (uint256);263 returns (uint256);
66}264}
67
68// Selector: ffe4da23
69interface Collection is Dummy, ERC165 {
70 // Set collection property.
71 //
72 // @param key Property key.
73 // @param value Propery value.
74 //
75 // Selector: setCollectionProperty(string,bytes) 2f073f66
76 function setCollectionProperty(string memory key, bytes memory value)
77 external;
78
79 // Delete collection property.
80 //
81 // @param key Property key.
82 //
83 // Selector: deleteCollectionProperty(string) 7b7debce
84 function deleteCollectionProperty(string memory key) external;
85
86 // Get collection property.
87 //
88 // @dev Throws error if key not found.
89 //
90 // @param key Property key.
91 // @return bytes The property corresponding to the key.
92 //
93 // Selector: collectionProperty(string) cf24fd6d
94 function collectionProperty(string memory key)
95 external
96 view
97 returns (bytes memory);
98
99 // Set the sponsor of the collection.
100 //
101 // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.
102 //
103 // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.
104 //
105 // Selector: setCollectionSponsor(address) 7623402e
106 function setCollectionSponsor(address sponsor) external;
107
108 // Collection sponsorship confirmation.
109 //
110 // @dev After setting the sponsor for the collection, it must be confirmed with this function.
111 //
112 // Selector: confirmCollectionSponsorship() 3c50e97a
113 function confirmCollectionSponsorship() external;
114
115 // Set limits for the collection.
116 // @dev Throws error if limit not found.
117 // @param limit Name of the limit. Valid names:
118 // "accountTokenOwnershipLimit",
119 // "sponsoredDataSize",
120 // "sponsoredDataRateLimit",
121 // "tokenLimit",
122 // "sponsorTransferTimeout",
123 // "sponsorApproveTimeout"
124 // @param value Value of the limit.
125 //
126 // Selector: setCollectionLimit(string,uint32) 6a3841db
127 function setCollectionLimit(string memory limit, uint32 value) external;
128
129 // Set limits for the collection.
130 // @dev Throws error if limit not found.
131 // @param limit Name of the limit. Valid names:
132 // "ownerCanTransfer",
133 // "ownerCanDestroy",
134 // "transfersEnabled"
135 // @param value Value of the limit.
136 //
137 // Selector: setCollectionLimit(string,bool) 993b7fba
138 function setCollectionLimit(string memory limit, bool value) external;
139
140 // Get contract address.
141 //
142 // Selector: contractAddress() f6b4dfb4
143 function contractAddress() external view returns (address);
144
145 // Add collection admin by substrate address.
146 // @param new_admin Substrate administrator address.
147 //
148 // Selector: addCollectionAdminSubstrate(uint256) 5730062b
149 function addCollectionAdminSubstrate(uint256 newAdmin) external;
150
151 // Remove collection admin by substrate address.
152 // @param admin Substrate administrator address.
153 //
154 // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9
155 function removeCollectionAdminSubstrate(uint256 admin) external;
156
157 // Add collection admin.
158 // @param new_admin Address of the added administrator.
159 //
160 // Selector: addCollectionAdmin(address) 92e462c7
161 function addCollectionAdmin(address newAdmin) external;
162
163 // Remove collection admin.
164 //
165 // @param new_admin Address of the removed administrator.
166 //
167 // Selector: removeCollectionAdmin(address) fafd7b42
168 function removeCollectionAdmin(address admin) external;
169
170 // Toggle accessibility of collection nesting.
171 //
172 // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
173 //
174 // Selector: setCollectionNesting(bool) 112d4586
175 function setCollectionNesting(bool enable) external;
176
177 // Toggle accessibility of collection nesting.
178 //
179 // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
180 // @param collections Addresses of collections that will be available for nesting.
181 //
182 // Selector: setCollectionNesting(bool,address[]) 64872396
183 function setCollectionNesting(bool enable, address[] memory collections)
184 external;
185
186 // Set the collection access method.
187 // @param mode Access mode
188 // 0 for Normal
189 // 1 for AllowList
190 //
191 // Selector: setCollectionAccess(uint8) 41835d4c
192 function setCollectionAccess(uint8 mode) external;
193
194 // Add the user to the allowed list.
195 //
196 // @param user Address of a trusted user.
197 //
198 // Selector: addToCollectionAllowList(address) 67844fe6
199 function addToCollectionAllowList(address user) external;
200
201 // Remove the user from the allowed list.
202 //
203 // @param user Address of a removed user.
204 //
205 // Selector: removeFromCollectionAllowList(address) 85c51acb
206 function removeFromCollectionAllowList(address user) external;
207
208 // Switch permission for minting.
209 //
210 // @param mode Enable if "true".
211 //
212 // Selector: setCollectionMintMode(bool) 00018e84
213 function setCollectionMintMode(bool mode) external;
214
215 // Check that account is the owner or admin of the collection
216 //
217 // @param user account to verify
218 // @return "true" if account is the owner or admin
219 //
220 // Selector: isOwnerOrAdmin(address) 9811b0c7
221 function isOwnerOrAdmin(address user) external view returns (bool);
222
223 // Check that substrate account is the owner or admin of the collection
224 //
225 // @param user account to verify
226 // @return "true" if account is the owner or admin
227 //
228 // Selector: isOwnerOrAdminSubstrate(uint256) 68910e00
229 function isOwnerOrAdminSubstrate(uint256 user) external view returns (bool);
230
231 // Returns collection type
232 //
233 // @return `Fungible` or `NFT` or `ReFungible`
234 //
235 // Selector: uniqueCollectionType() d34b55b8
236 function uniqueCollectionType() external returns (string memory);
237
238 // Changes collection owner to another account
239 //
240 // @dev Owner can be changed only by current owner
241 // @param newOwner new owner account
242 //
243 // Selector: setOwner(address) 13af4035
244 function setOwner(address newOwner) external;
245
246 // Changes collection owner to another substrate account
247 //
248 // @dev Owner can be changed only by current owner
249 // @param newOwner new owner substrate account
250 //
251 // Selector: setOwnerSubstrate(uint256) b212138f
252 function setOwnerSubstrate(uint256 newOwner) external;
253}
254265
255interface UniqueFungible is266interface UniqueFungible is
256 Dummy,267 Dummy,
modifiedtests/src/eth/api/UniqueNFT.soldiffbeforeafterboth
33
4pragma solidity >=0.8.0 <0.9.0;4pragma solidity >=0.8.0 <0.9.0;
5
6// Anonymous struct
7struct Tuple0 {
8 uint256 field_0;
9 string field_1;
10}
115
12// Common stubs holder6/// @dev common stubs holder
13interface Dummy {7interface Dummy {
148
15}9}
18 function supportsInterface(bytes4 interfaceID) external view returns (bool);12 function supportsInterface(bytes4 interfaceID) external view returns (bool);
19}13}
2014
21// 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 0x41369377
17interface 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 tokenOwner
31 ) external;
32
33 /// @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 value
44 ) external;
45
46 /// @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;
53
54 /// @notice Get token property value.
55 /// @dev Throws error if key not found
56 /// @param tokenId ID of the token.
57 /// @param key Property key.
58 /// @return Property value bytes
59 /// @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 external
63 view
64 returns (bytes memory);
65}
66
67/// @title A contract that allows you to work with collections.
68/// @dev the ERC-165 identifier for this interface is 0xffe4da23
69interface 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;
78
79 /// 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;
85
86 /// Get collection property.
87 ///
88 /// @dev Throws error if key not found.
89 ///
90 /// @param key Property key.
91 /// @return bytes The property corresponding to the key.
92 /// @dev EVM selector for this function is: 0xcf24fd6d,
93 /// or in textual repr: collectionProperty(string)
94 function collectionProperty(string memory key)
95 external
96 view
97 returns (bytes memory);
98
99 /// Set the sponsor of the collection.
100 ///
101 /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.
102 ///
103 /// @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.
104 /// @dev EVM selector for this function is: 0x7623402e,
105 /// or in textual repr: setCollectionSponsor(address)
106 function setCollectionSponsor(address sponsor) external;
107
108 /// Collection sponsorship confirmation.
109 ///
110 /// @dev After setting the sponsor for the collection, it must be confirmed with this function.
111 /// @dev EVM selector for this function is: 0x3c50e97a,
112 /// or in textual repr: confirmCollectionSponsorship()
113 function confirmCollectionSponsorship() external;
114
115 /// Set limits for the collection.
116 /// @dev Throws error if limit not found.
117 /// @param limit Name of the limit. Valid names:
118 /// "accountTokenOwnershipLimit",
119 /// "sponsoredDataSize",
120 /// "sponsoredDataRateLimit",
121 /// "tokenLimit",
122 /// "sponsorTransferTimeout",
123 /// "sponsorApproveTimeout"
124 /// @param value Value of the limit.
125 /// @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;
128
129 /// Set limits for the collection.
130 /// @dev Throws error if limit not found.
131 /// @param limit Name of the limit. Valid names:
132 /// "ownerCanTransfer",
133 /// "ownerCanDestroy",
134 /// "transfersEnabled"
135 /// @param value Value of the limit.
136 /// @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;
139
140 /// 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);
144
145 /// 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;
150
151 /// 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;
156
157 /// 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;
162
163 /// 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;
169
170 /// 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;
176
177 /// Toggle accessibility of collection nesting.
178 ///
179 /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
180 /// @param collections Addresses of collections that will be available for nesting.
181 /// @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;
185
186 /// Set the collection access method.
187 /// @param mode Access mode
188 /// 0 for Normal
189 /// 1 for AllowList
190 /// @dev EVM selector for this function is: 0x41835d4c,
191 /// or in textual repr: setCollectionAccess(uint8)
192 function setCollectionAccess(uint8 mode) external;
193
194 /// Add the user to the allowed list.
195 ///
196 /// @param user Address of a trusted user.
197 /// @dev EVM selector for this function is: 0x67844fe6,
198 /// or in textual repr: addToCollectionAllowList(address)
199 function addToCollectionAllowList(address user) external;
200
201 /// Remove the user from the allowed list.
202 ///
203 /// @param user Address of a removed user.
204 /// @dev EVM selector for this function is: 0x85c51acb,
205 /// or in textual repr: removeFromCollectionAllowList(address)
206 function removeFromCollectionAllowList(address user) external;
207
208 /// 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;
214
215 /// Check that account is the owner or admin of the collection
216 ///
217 /// @param user account to verify
218 /// @return "true" if account is the owner or admin
219 /// @dev EVM selector for this function is: 0x9811b0c7,
220 /// or in textual repr: isOwnerOrAdmin(address)
221 function isOwnerOrAdmin(address user) external view returns (bool);
222
223 /// Check that substrate account is the owner or admin of the collection
224 ///
225 /// @param user account to verify
226 /// @return "true" if account is the owner or admin
227 /// @dev EVM selector for this function is: 0x68910e00,
228 /// or in textual repr: isOwnerOrAdminSubstrate(uint256)
229 function isOwnerOrAdminSubstrate(uint256 user) external view returns (bool);
230
231 /// Returns collection type
232 ///
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);
237
238 /// Changes collection owner to another account
239 ///
240 /// @dev Owner can be changed only by current owner
241 /// @param newOwner new owner account
242 /// @dev EVM selector for this function is: 0x13af4035,
243 /// or in textual repr: setOwner(address)
244 function setOwner(address newOwner) external;
245
246 /// Changes collection owner to another substrate account
247 ///
248 /// @dev Owner can be changed only by current owner
249 /// @param newOwner new owner substrate account
250 /// @dev EVM selector for this function is: 0xb212138f,
251 /// or in textual repr: setOwnerSubstrate(uint256)
252 function setOwnerSubstrate(uint256 newOwner) external;
253}
254
255/// @title ERC721 Token that can be irreversibly burned (destroyed).
256/// @dev the ERC-165 identifier for this interface is 0x42966c68
257interface ERC721Burnable is Dummy, ERC165 {
258 /// @notice Burns a specific ERC721 token.
259 /// @dev Throws unless `msg.sender` is the current NFT owner, or an authorized
260 /// operator of the current owner.
261 /// @param tokenId The NFT to approve
262 /// @dev EVM selector for this function is: 0x42966c68,
263 /// or in textual repr: burn(uint256)
264 function burn(uint256 tokenId) external;
265}
266
267/// @dev inlined interface
268interface ERC721MintableEvents {
269 event MintingFinished();
270}
271
272/// @title ERC721 minting logic.
273/// @dev the ERC-165 identifier for this interface is 0x68ccfe89
274interface 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);
278
279 /// @notice Function to mint token.
280 /// @dev `tokenId` should be obtained with `nextTokenId` method,
281 /// unlike standard, you can't specify it manually
282 /// @param to The new owner
283 /// @param tokenId ID of the minted NFT
284 /// @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);
287
288 /// @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 manually
291 /// @param to The new owner
292 /// @param tokenId ID of the minted NFT
293 /// @param tokenUri Token URI that would be stored in the NFT properties
294 /// @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 tokenUri
300 ) external returns (bool);
301
302 /// @dev Not implemented
303 /// @dev EVM selector for this function is: 0x7d64bcb4,
304 /// or in textual repr: finishMinting()
305 function finishMinting() external returns (bool);
306}
307
308/// @title Unique extensions for ERC721.
309/// @dev the ERC-165 identifier for this interface is 0xd74d154f
310interface ERC721UniqueExtensions is Dummy, ERC165 {
311 /// @notice Transfer ownership of an NFT
312 /// @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 owner
315 /// @param tokenId The NFT to transfer
316 /// @dev EVM selector for this function is: 0xa9059cbb,
317 /// or in textual repr: transfer(address,uint256)
318 function transfer(address to, uint256 tokenId) external;
319
320 /// @notice Burns a specific ERC721 token.
321 /// @dev Throws unless `msg.sender` is the current owner or an authorized
322 /// operator for this NFT. Throws if `from` is not the current owner. Throws
323 /// if `to` is the zero address. Throws if `tokenId` is not a valid NFT.
324 /// @param from The current owner of the NFT
325 /// @param tokenId The NFT to transfer
326 /// @dev EVM selector for this function is: 0x79cc6790,
327 /// or in textual repr: burnFrom(address,uint256)
328 function burnFrom(address from, uint256 tokenId) external;
329
330 /// @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);
334
335 /// @notice Function to mint multiple tokens.
336 /// @dev `tokenIds` should be an array of consecutive numbers and first number
337 /// should be obtained with `nextTokenId` method
338 /// @param to The new owner
339 /// @param tokenIds IDs of the minted NFTs
340 /// @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 external
344 returns (bool);
345
346 /// @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 consecutive
348 /// numbers and first number should be obtained with `nextTokenId` method
349 /// @param to The new owner
350 /// @param tokens array of pairs of token ID and token URI for minted tokens
351 /// @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 external
355 returns (bool);
356}
357
358/// @dev anonymous struct
359struct Tuple8 {
360 uint256 field_0;
361 string field_1;
362}
363
364/// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
365/// @dev See https://eips.ethereum.org/EIPS/eip-721
366/// @dev the ERC-165 identifier for this interface is 0x780e9d63
367interface ERC721Enumerable is Dummy, ERC165 {
368 /// @notice Enumerate valid NFTs
369 /// @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);
375
376 /// @dev Not implemented
377 /// @dev EVM selector for this function is: 0x2f745c59,
378 /// or in textual repr: tokenOfOwnerByIndex(address,uint256)
379 function tokenOfOwnerByIndex(address owner, uint256 index)
380 external
381 view
382 returns (uint256);
383
384 /// @notice Count NFTs tracked by this contract
385 /// @return A count of valid NFTs tracked by this contract, where each one of
386 /// them has an assigned and queryable owner not equal to the zero address
387 /// @dev EVM selector for this function is: 0x18160ddd,
388 /// or in textual repr: totalSupply()
389 function totalSupply() external view returns (uint256);
390}
391
392/// @title ERC-721 Non-Fungible Token Standard, optional metadata extension
393/// @dev See https://eips.ethereum.org/EIPS/eip-721
394/// @dev the ERC-165 identifier for this interface is 0x5b5e139f
395interface ERC721Metadata is Dummy, ERC165 {
396 /// @notice A descriptive name for a collection of NFTs in this contract
397 /// @dev EVM selector for this function is: 0x06fdde03,
398 /// or in textual repr: name()
399 function name() external view returns (string memory);
400
401 /// @notice An abbreviated name for NFTs in this contract
402 /// @dev EVM selector for this function is: 0x95d89b41,
403 /// or in textual repr: symbol()
404 function symbol() external view returns (string memory);
405
406 /// @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 suffix
412 /// otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings).
413 ///
414 /// @return token's const_metadata
415 /// @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}
419
420/// @dev inlined interface
22interface ERC721Events {421interface ERC721Events {
23 event Transfer(422 event Transfer(
24 address indexed from,423 address indexed from,
37 );436 );
38}437}
39438
40// Inline439/// @title ERC-721 Non-Fungible Token Standard
41interface ERC721MintableEvents {440/// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
42 event MintingFinished();441/// @dev the ERC-165 identifier for this interface is 0x80ac58cd
43}
44
45// Selector: 41369377
46interface 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) 222d97fa
55 function setTokenPropertyPermission(
56 string memory key,
57 bool isMutable,
58 bool collectionAdmin,
59 bool tokenOwner
60 ) external;
61
62 // @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) 1752d67b
69 function setProperty(
70 uint256 tokenId,
71 string memory key,
72 bytes memory value
73 ) external;
74
75 // @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) 066111d1
81 function deleteProperty(uint256 tokenId, string memory key) external;
82
83 // @notice Get token property value.
84 // @dev Throws error if key not found
85 // @param tokenId ID of the token.
86 // @param key Property key.
87 // @return Property value bytes
88 //
89 // Selector: property(uint256,string) 7228c327
90 function property(uint256 tokenId, string memory key)
91 external
92 view
93 returns (bytes memory);
94}
95
96// Selector: 42966c68
97interface ERC721Burnable is Dummy, ERC165 {
98 // @notice Burns a specific ERC721 token.
99 // @dev Throws unless `msg.sender` is the current NFT owner, or an authorized
100 // operator of the current owner.
101 // @param tokenId The NFT to approve
102 //
103 // Selector: burn(uint256) 42966c68
104 function burn(uint256 tokenId) external;
105}
106
107// Selector: 58800161
108interface 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 owner
110 // @dev NFTs assigned to the zero address are considered invalid, and this444 /// @dev NFTs assigned to the zero address are considered invalid, and this
111 // 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 balance
113 // @return The number of NFTs owned by `owner`, possibly zero447 /// @return The number of NFTs owned by `owner`, possibly zero
114 //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);
117451
118 // @notice Find the owner of an NFT452 /// @notice Find the owner of an NFT
119 // @dev NFTs assigned to zero address are considered invalid, and queries453 /// @dev NFTs assigned to zero address are considered invalid, and queries
120 // about them do throw.454 /// about them do throw.
121 // @param tokenId The identifier for an NFT455 /// @param tokenId The identifier for an NFT
122 // @return The address of the owner of the NFT456 /// @return The address of the owner of the NFT
123 //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);
126460
127 // @dev Not implemented461 /// @dev Not implemented
128 //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 data
135 ) external;469 ) external;
136470
137 // @dev Not implemented471 /// @dev Not implemented
138 //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 tokenId
144 ) external;478 ) external;
145479
146 // @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE480 /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE
147 // TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE481 /// TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE
148 // THEY MAY BE PERMANENTLY LOST482 /// THEY MAY BE PERMANENTLY LOST
149 // @dev Throws unless `msg.sender` is the current owner or an authorized483 /// @dev Throws unless `msg.sender` is the current owner or an authorized
150 // 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. Throws
151 // 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 NFT
153 // @param to The new owner487 /// @param to The new owner
154 // @param tokenId The NFT to transfer488 /// @param tokenId The NFT to transfer
155 // @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 tokenId
162 ) external;495 ) external;
163496
164 // @notice Set or reaffirm the approved address for an NFT497 /// @notice Set or reaffirm the approved address for an NFT
165 // @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 authorized
167 // 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 controller
169 // @param tokenId The NFT to approve502 /// @param tokenId The NFT to approve
170 //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;
173506
174 // @dev Not implemented507 /// @dev Not implemented
175 //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;
178511
179 // @dev Not implemented512 /// @dev Not implemented
180 //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);
183516
184 // @dev Not implemented517 /// @dev Not implemented
185 //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 external
189 view522 view
190 returns (address);523 returns (address);
191}524}
192
193// Selector: 5b5e139f
194interface ERC721Metadata is Dummy, ERC165 {
195 // @notice A descriptive name for a collection of NFTs in this contract
196 //
197 // Selector: name() 06fdde03
198 function name() external view returns (string memory);
199
200 // @notice An abbreviated name for NFTs in this contract
201 //
202 // Selector: symbol() 95d89b41
203 function symbol() external view returns (string memory);
204
205 // @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 suffix
211 // otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings).
212 //
213 // @return token's const_metadata
214 //
215 // Selector: tokenURI(uint256) c87b56dd
216 function tokenURI(uint256 tokenId) external view returns (string memory);
217}
218
219// Selector: 68ccfe89
220interface ERC721Mintable is Dummy, ERC165, ERC721MintableEvents {
221 // Selector: mintingFinished() 05d2035b
222 function mintingFinished() external view returns (bool);
223
224 // @notice Function to mint token.
225 // @dev `tokenId` should be obtained with `nextTokenId` method,
226 // unlike standard, you can't specify it manually
227 // @param to The new owner
228 // @param tokenId ID of the minted NFT
229 //
230 // Selector: mint(address,uint256) 40c10f19
231 function mint(address to, uint256 tokenId) external returns (bool);
232
233 // @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 manually
236 // @param to The new owner
237 // @param tokenId ID of the minted NFT
238 // @param tokenUri Token URI that would be stored in the NFT properties
239 //
240 // Selector: mintWithTokenURI(address,uint256,string) 50bb4e7f
241 function mintWithTokenURI(
242 address to,
243 uint256 tokenId,
244 string memory tokenUri
245 ) external returns (bool);
246
247 // @dev Not implemented
248 //
249 // Selector: finishMinting() 7d64bcb4
250 function finishMinting() external returns (bool);
251}
252
253// Selector: 780e9d63
254interface ERC721Enumerable is Dummy, ERC165 {
255 // @notice Enumerate valid NFTs
256 // @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) 4f6ccce7
261 function tokenByIndex(uint256 index) external view returns (uint256);
262
263 // @dev Not implemented
264 //
265 // Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59
266 function tokenOfOwnerByIndex(address owner, uint256 index)
267 external
268 view
269 returns (uint256);
270
271 // @notice Count NFTs tracked by this contract
272 // @return A count of valid NFTs tracked by this contract, where each one of
273 // them has an assigned and queryable owner not equal to the zero address
274 //
275 // Selector: totalSupply() 18160ddd
276 function totalSupply() external view returns (uint256);
277}
278
279// Selector: d74d154f
280interface ERC721UniqueExtensions is Dummy, ERC165 {
281 // @notice Transfer ownership of an NFT
282 // @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 owner
285 // @param tokenId The NFT to transfer
286 // @param _value Not used for an NFT
287 //
288 // Selector: transfer(address,uint256) a9059cbb
289 function transfer(address to, uint256 tokenId) external;
290
291 // @notice Burns a specific ERC721 token.
292 // @dev Throws unless `msg.sender` is the current owner or an authorized
293 // operator for this NFT. Throws if `from` is not the current owner. Throws
294 // if `to` is the zero address. Throws if `tokenId` is not a valid NFT.
295 // @param from The current owner of the NFT
296 // @param tokenId The NFT to transfer
297 // @param _value Not used for an NFT
298 //
299 // Selector: burnFrom(address,uint256) 79cc6790
300 function burnFrom(address from, uint256 tokenId) external;
301
302 // @notice Returns next free NFT ID.
303 //
304 // Selector: nextTokenId() 75794a3c
305 function nextTokenId() external view returns (uint256);
306
307 // @notice Function to mint multiple tokens.
308 // @dev `tokenIds` should be an array of consecutive numbers and first number
309 // should be obtained with `nextTokenId` method
310 // @param to The new owner
311 // @param tokenIds IDs of the minted NFTs
312 //
313 // Selector: mintBulk(address,uint256[]) 44a9945e
314 function mintBulk(address to, uint256[] memory tokenIds)
315 external
316 returns (bool);
317
318 // @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 consecutive
320 // numbers and first number should be obtained with `nextTokenId` method
321 // @param to The new owner
322 // @param tokens array of pairs of token ID and token URI for minted tokens
323 //
324 // Selector: mintBulkWithTokenURI(address,(uint256,string)[]) 36543006
325 function mintBulkWithTokenURI(address to, Tuple0[] memory tokens)
326 external
327 returns (bool);
328}
329
330// Selector: ffe4da23
331interface Collection is Dummy, ERC165 {
332 // Set collection property.
333 //
334 // @param key Property key.
335 // @param value Propery value.
336 //
337 // Selector: setCollectionProperty(string,bytes) 2f073f66
338 function setCollectionProperty(string memory key, bytes memory value)
339 external;
340
341 // Delete collection property.
342 //
343 // @param key Property key.
344 //
345 // Selector: deleteCollectionProperty(string) 7b7debce
346 function deleteCollectionProperty(string memory key) external;
347
348 // Get collection property.
349 //
350 // @dev Throws error if key not found.
351 //
352 // @param key Property key.
353 // @return bytes The property corresponding to the key.
354 //
355 // Selector: collectionProperty(string) cf24fd6d
356 function collectionProperty(string memory key)
357 external
358 view
359 returns (bytes memory);
360
361 // Set the sponsor of the collection.
362 //
363 // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.
364 //
365 // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.
366 //
367 // Selector: setCollectionSponsor(address) 7623402e
368 function setCollectionSponsor(address sponsor) external;
369
370 // Collection sponsorship confirmation.
371 //
372 // @dev After setting the sponsor for the collection, it must be confirmed with this function.
373 //
374 // Selector: confirmCollectionSponsorship() 3c50e97a
375 function confirmCollectionSponsorship() external;
376
377 // Set limits for the collection.
378 // @dev Throws error if limit not found.
379 // @param limit Name of the limit. Valid names:
380 // "accountTokenOwnershipLimit",
381 // "sponsoredDataSize",
382 // "sponsoredDataRateLimit",
383 // "tokenLimit",
384 // "sponsorTransferTimeout",
385 // "sponsorApproveTimeout"
386 // @param value Value of the limit.
387 //
388 // Selector: setCollectionLimit(string,uint32) 6a3841db
389 function setCollectionLimit(string memory limit, uint32 value) external;
390
391 // Set limits for the collection.
392 // @dev Throws error if limit not found.
393 // @param limit Name of the limit. Valid names:
394 // "ownerCanTransfer",
395 // "ownerCanDestroy",
396 // "transfersEnabled"
397 // @param value Value of the limit.
398 //
399 // Selector: setCollectionLimit(string,bool) 993b7fba
400 function setCollectionLimit(string memory limit, bool value) external;
401
402 // Get contract address.
403 //
404 // Selector: contractAddress() f6b4dfb4
405 function contractAddress() external view returns (address);
406
407 // Add collection admin by substrate address.
408 // @param new_admin Substrate administrator address.
409 //
410 // Selector: addCollectionAdminSubstrate(uint256) 5730062b
411 function addCollectionAdminSubstrate(uint256 newAdmin) external;
412
413 // Remove collection admin by substrate address.
414 // @param admin Substrate administrator address.
415 //
416 // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9
417 function removeCollectionAdminSubstrate(uint256 admin) external;
418
419 // Add collection admin.
420 // @param new_admin Address of the added administrator.
421 //
422 // Selector: addCollectionAdmin(address) 92e462c7
423 function addCollectionAdmin(address newAdmin) external;
424
425 // Remove collection admin.
426 //
427 // @param new_admin Address of the removed administrator.
428 //
429 // Selector: removeCollectionAdmin(address) fafd7b42
430 function removeCollectionAdmin(address admin) external;
431
432 // Toggle accessibility of collection nesting.
433 //
434 // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
435 //
436 // Selector: setCollectionNesting(bool) 112d4586
437 function setCollectionNesting(bool enable) external;
438
439 // Toggle accessibility of collection nesting.
440 //
441 // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
442 // @param collections Addresses of collections that will be available for nesting.
443 //
444 // Selector: setCollectionNesting(bool,address[]) 64872396
445 function setCollectionNesting(bool enable, address[] memory collections)
446 external;
447
448 // Set the collection access method.
449 // @param mode Access mode
450 // 0 for Normal
451 // 1 for AllowList
452 //
453 // Selector: setCollectionAccess(uint8) 41835d4c
454 function setCollectionAccess(uint8 mode) external;
455
456 // Add the user to the allowed list.
457 //
458 // @param user Address of a trusted user.
459 //
460 // Selector: addToCollectionAllowList(address) 67844fe6
461 function addToCollectionAllowList(address user) external;
462
463 // Remove the user from the allowed list.
464 //
465 // @param user Address of a removed user.
466 //
467 // Selector: removeFromCollectionAllowList(address) 85c51acb
468 function removeFromCollectionAllowList(address user) external;
469
470 // Switch permission for minting.
471 //
472 // @param mode Enable if "true".
473 //
474 // Selector: setCollectionMintMode(bool) 00018e84
475 function setCollectionMintMode(bool mode) external;
476
477 // Check that account is the owner or admin of the collection
478 //
479 // @param user account to verify
480 // @return "true" if account is the owner or admin
481 //
482 // Selector: isOwnerOrAdmin(address) 9811b0c7
483 function isOwnerOrAdmin(address user) external view returns (bool);
484
485 // Check that substrate account is the owner or admin of the collection
486 //
487 // @param user account to verify
488 // @return "true" if account is the owner or admin
489 //
490 // Selector: isOwnerOrAdminSubstrate(uint256) 68910e00
491 function isOwnerOrAdminSubstrate(uint256 user) external view returns (bool);
492
493 // Returns collection type
494 //
495 // @return `Fungible` or `NFT` or `ReFungible`
496 //
497 // Selector: uniqueCollectionType() d34b55b8
498 function uniqueCollectionType() external returns (string memory);
499
500 // Changes collection owner to another account
501 //
502 // @dev Owner can be changed only by current owner
503 // @param newOwner new owner account
504 //
505 // Selector: setOwner(address) 13af4035
506 function setOwner(address newOwner) external;
507
508 // Changes collection owner to another substrate account
509 //
510 // @dev Owner can be changed only by current owner
511 // @param newOwner new owner substrate account
512 //
513 // Selector: setOwnerSubstrate(uint256) b212138f
514 function setOwnerSubstrate(uint256 newOwner) external;
515}
516525
517interface UniqueNFT is526interface UniqueNFT is
518 Dummy,527 Dummy,
modifiedtests/src/eth/api/UniqueRefungible.soldiffbeforeafterboth
33
4pragma solidity >=0.8.0 <0.9.0;4pragma solidity >=0.8.0 <0.9.0;
5
6// Anonymous struct
7struct Tuple0 {
8 uint256 field_0;
9 string field_1;
10}
115
12// Common stubs holder6/// @dev common stubs holder
13interface Dummy {7interface Dummy {
148
15}9}
18 function supportsInterface(bytes4 interfaceID) external view returns (bool);12 function supportsInterface(bytes4 interfaceID) external view returns (bool);
19}13}
2014
21// 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 0x41369377
17interface 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 tokenOwner
31 ) external;
32
33 /// @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 value
44 ) external;
45
46 /// @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;
53
54 /// @notice Get token property value.
55 /// @dev Throws error if key not found
56 /// @param tokenId ID of the token.
57 /// @param key Property key.
58 /// @return Property value bytes
59 /// @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 external
63 view
64 returns (bytes memory);
65}
66
67/// @title A contract that allows you to work with collections.
68/// @dev the ERC-165 identifier for this interface is 0xffe4da23
69interface 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;
78
79 /// 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;
85
86 /// Get collection property.
87 ///
88 /// @dev Throws error if key not found.
89 ///
90 /// @param key Property key.
91 /// @return bytes The property corresponding to the key.
92 /// @dev EVM selector for this function is: 0xcf24fd6d,
93 /// or in textual repr: collectionProperty(string)
94 function collectionProperty(string memory key)
95 external
96 view
97 returns (bytes memory);
98
99 /// Set the sponsor of the collection.
100 ///
101 /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.
102 ///
103 /// @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.
104 /// @dev EVM selector for this function is: 0x7623402e,
105 /// or in textual repr: setCollectionSponsor(address)
106 function setCollectionSponsor(address sponsor) external;
107
108 /// Collection sponsorship confirmation.
109 ///
110 /// @dev After setting the sponsor for the collection, it must be confirmed with this function.
111 /// @dev EVM selector for this function is: 0x3c50e97a,
112 /// or in textual repr: confirmCollectionSponsorship()
113 function confirmCollectionSponsorship() external;
114
115 /// Set limits for the collection.
116 /// @dev Throws error if limit not found.
117 /// @param limit Name of the limit. Valid names:
118 /// "accountTokenOwnershipLimit",
119 /// "sponsoredDataSize",
120 /// "sponsoredDataRateLimit",
121 /// "tokenLimit",
122 /// "sponsorTransferTimeout",
123 /// "sponsorApproveTimeout"
124 /// @param value Value of the limit.
125 /// @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;
128
129 /// Set limits for the collection.
130 /// @dev Throws error if limit not found.
131 /// @param limit Name of the limit. Valid names:
132 /// "ownerCanTransfer",
133 /// "ownerCanDestroy",
134 /// "transfersEnabled"
135 /// @param value Value of the limit.
136 /// @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;
139
140 /// 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);
144
145 /// 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;
150
151 /// 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;
156
157 /// 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;
162
163 /// 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;
169
170 /// 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;
176
177 /// Toggle accessibility of collection nesting.
178 ///
179 /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
180 /// @param collections Addresses of collections that will be available for nesting.
181 /// @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;
185
186 /// Set the collection access method.
187 /// @param mode Access mode
188 /// 0 for Normal
189 /// 1 for AllowList
190 /// @dev EVM selector for this function is: 0x41835d4c,
191 /// or in textual repr: setCollectionAccess(uint8)
192 function setCollectionAccess(uint8 mode) external;
193
194 /// Add the user to the allowed list.
195 ///
196 /// @param user Address of a trusted user.
197 /// @dev EVM selector for this function is: 0x67844fe6,
198 /// or in textual repr: addToCollectionAllowList(address)
199 function addToCollectionAllowList(address user) external;
200
201 /// Remove the user from the allowed list.
202 ///
203 /// @param user Address of a removed user.
204 /// @dev EVM selector for this function is: 0x85c51acb,
205 /// or in textual repr: removeFromCollectionAllowList(address)
206 function removeFromCollectionAllowList(address user) external;
207
208 /// 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;
214
215 /// Check that account is the owner or admin of the collection
216 ///
217 /// @param user account to verify
218 /// @return "true" if account is the owner or admin
219 /// @dev EVM selector for this function is: 0x9811b0c7,
220 /// or in textual repr: isOwnerOrAdmin(address)
221 function isOwnerOrAdmin(address user) external view returns (bool);
222
223 /// Check that substrate account is the owner or admin of the collection
224 ///
225 /// @param user account to verify
226 /// @return "true" if account is the owner or admin
227 /// @dev EVM selector for this function is: 0x68910e00,
228 /// or in textual repr: isOwnerOrAdminSubstrate(uint256)
229 function isOwnerOrAdminSubstrate(uint256 user) external view returns (bool);
230
231 /// Returns collection type
232 ///
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);
237
238 /// Changes collection owner to another account
239 ///
240 /// @dev Owner can be changed only by current owner
241 /// @param newOwner new owner account
242 /// @dev EVM selector for this function is: 0x13af4035,
243 /// or in textual repr: setOwner(address)
244 function setOwner(address newOwner) external;
245
246 /// Changes collection owner to another substrate account
247 ///
248 /// @dev Owner can be changed only by current owner
249 /// @param newOwner new owner substrate account
250 /// @dev EVM selector for this function is: 0xb212138f,
251 /// or in textual repr: setOwnerSubstrate(uint256)
252 function setOwnerSubstrate(uint256 newOwner) external;
253}
254
255/// @title ERC721 Token that can be irreversibly burned (destroyed).
256/// @dev the ERC-165 identifier for this interface is 0x42966c68
257interface ERC721Burnable is Dummy, ERC165 {
258 /// @notice Burns a specific ERC721 token.
259 /// @dev Throws unless `msg.sender` is the current RFT owner, or an authorized
260 /// operator of the current owner.
261 /// @param tokenId The RFT to approve
262 /// @dev EVM selector for this function is: 0x42966c68,
263 /// or in textual repr: burn(uint256)
264 function burn(uint256 tokenId) external;
265}
266
267/// @dev inlined interface
268interface ERC721MintableEvents {
269 event MintingFinished();
270}
271
272/// @title ERC721 minting logic.
273/// @dev the ERC-165 identifier for this interface is 0x68ccfe89
274interface 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);
278
279 /// @notice Function to mint token.
280 /// @dev `tokenId` should be obtained with `nextTokenId` method,
281 /// unlike standard, you can't specify it manually
282 /// @param to The new owner
283 /// @param tokenId ID of the minted RFT
284 /// @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);
287
288 /// @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 manually
291 /// @param to The new owner
292 /// @param tokenId ID of the minted RFT
293 /// @param tokenUri Token URI that would be stored in the RFT properties
294 /// @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 tokenUri
300 ) external returns (bool);
301
302 /// @dev Not implemented
303 /// @dev EVM selector for this function is: 0x7d64bcb4,
304 /// or in textual repr: finishMinting()
305 function finishMinting() external returns (bool);
306}
307
308/// @title Unique extensions for ERC721.
309/// @dev the ERC-165 identifier for this interface is 0x7c3bef89
310interface ERC721UniqueExtensions is Dummy, ERC165 {
311 /// @notice Transfer ownership of an RFT
312 /// @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 owner
316 /// @param tokenId The RFT to transfer
317 /// @dev EVM selector for this function is: 0xa9059cbb,
318 /// or in textual repr: transfer(address,uint256)
319 function transfer(address to, uint256 tokenId) external;
320
321 /// @notice Burns a specific ERC721 token.
322 /// @dev Throws unless `msg.sender` is the current owner or an authorized
323 /// operator for this RFT. Throws if `from` is not the current owner. Throws
324 /// 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 RFT
327 /// @param tokenId The RFT to transfer
328 /// @dev EVM selector for this function is: 0x79cc6790,
329 /// or in textual repr: burnFrom(address,uint256)
330 function burnFrom(address from, uint256 tokenId) external;
331
332 /// @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);
336
337 /// @notice Function to mint multiple tokens.
338 /// @dev `tokenIds` should be an array of consecutive numbers and first number
339 /// should be obtained with `nextTokenId` method
340 /// @param to The new owner
341 /// @param tokenIds IDs of the minted RFTs
342 /// @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 external
346 returns (bool);
347
348 /// @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 consecutive
350 /// numbers and first number should be obtained with `nextTokenId` method
351 /// @param to The new owner
352 /// @param tokens array of pairs of token ID and token URI for minted tokens
353 /// @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 external
357 returns (bool);
358
359 /// Returns EVM address for refungible token
360 ///
361 /// @param token ID of the token
362 /// @dev EVM selector for this function is: 0xab76fac6,
363 /// or in textual repr: tokenContractAddress(uint256)
364 function tokenContractAddress(uint256 token)
365 external
366 view
367 returns (address);
368}
369
370/// @dev anonymous struct
371struct Tuple8 {
372 uint256 field_0;
373 string field_1;
374}
375
376/// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
377/// @dev See https://eips.ethereum.org/EIPS/eip-721
378/// @dev the ERC-165 identifier for this interface is 0x780e9d63
379interface ERC721Enumerable is Dummy, ERC165 {
380 /// @notice Enumerate valid RFTs
381 /// @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);
387
388 /// Not implemented
389 /// @dev EVM selector for this function is: 0x2f745c59,
390 /// or in textual repr: tokenOfOwnerByIndex(address,uint256)
391 function tokenOfOwnerByIndex(address owner, uint256 index)
392 external
393 view
394 returns (uint256);
395
396 /// @notice Count RFTs tracked by this contract
397 /// @return A count of valid RFTs tracked by this contract, where each one of
398 /// them has an assigned and queryable owner not equal to the zero address
399 /// @dev EVM selector for this function is: 0x18160ddd,
400 /// or in textual repr: totalSupply()
401 function totalSupply() external view returns (uint256);
402}
403
404/// @dev the ERC-165 identifier for this interface is 0x5b5e139f
405interface ERC721Metadata is Dummy, ERC165 {
406 /// @notice A descriptive name for a collection of RFTs in this contract
407 /// @dev EVM selector for this function is: 0x06fdde03,
408 /// or in textual repr: name()
409 function name() external view returns (string memory);
410
411 /// @notice An abbreviated name for RFTs in this contract
412 /// @dev EVM selector for this function is: 0x95d89b41,
413 /// or in textual repr: symbol()
414 function symbol() external view returns (string memory);
415
416 /// @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 suffix
422 /// otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings).
423 ///
424 /// @return token's const_metadata
425 /// @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}
429
430/// @dev inlined interface
22interface ERC721Events {431interface ERC721Events {
23 event Transfer(432 event Transfer(
24 address indexed from,433 address indexed from,
37 );446 );
38}447}
39448
40// Inline449/// @title ERC-721 Non-Fungible Token Standard
41interface ERC721MintableEvents {450/// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
42 event MintingFinished();451/// @dev the ERC-165 identifier for this interface is 0x58800161
43}
44
45// Selector: 41369377
46interface 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) 222d97fa
55 function setTokenPropertyPermission(
56 string memory key,
57 bool isMutable,
58 bool collectionAdmin,
59 bool tokenOwner
60 ) external;
61
62 // @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) 1752d67b
69 function setProperty(
70 uint256 tokenId,
71 string memory key,
72 bytes memory value
73 ) external;
74
75 // @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) 066111d1
81 function deleteProperty(uint256 tokenId, string memory key) external;
82
83 // @notice Get token property value.
84 // @dev Throws error if key not found
85 // @param tokenId ID of the token.
86 // @param key Property key.
87 // @return Property value bytes
88 //
89 // Selector: property(uint256,string) 7228c327
90 function property(uint256 tokenId, string memory key)
91 external
92 view
93 returns (bytes memory);
94}
95
96// Selector: 42966c68
97interface ERC721Burnable is Dummy, ERC165 {
98 // @notice Burns a specific ERC721 token.
99 // @dev Throws unless `msg.sender` is the current RFT owner, or an authorized
100 // operator of the current owner.
101 // @param tokenId The RFT to approve
102 //
103 // Selector: burn(uint256) 42966c68
104 function burn(uint256 tokenId) external;
105}
106
107// Selector: 58800161
108interface 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 owner
110 // @dev RFTs assigned to the zero address are considered invalid, and this454 /// @dev RFTs assigned to the zero address are considered invalid, and this
111 // 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 balance
113 // @return The number of RFTs owned by `owner`, possibly zero457 /// @return The number of RFTs owned by `owner`, possibly zero
114 //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);
117461
118 // @notice Find the owner of an RFT462 /// @notice Find the owner of an RFT
119 // @dev RFTs assigned to zero address are considered invalid, and queries463 /// @dev RFTs assigned to zero address are considered invalid, and queries
120 // about them do throw.464 /// about them do throw.
121 // Returns special 0xffffffffffffffffffffffffffffffffffffffff address for465 /// Returns special 0xffffffffffffffffffffffffffffffffffffffff address for
122 // 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 RFT
124 // @return The address of the owner of the RFT468 /// @return The address of the owner of the RFT
125 //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);
128472
129 // @dev Not implemented473 /// @dev Not implemented
130 //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 data
137 ) external;481 ) external;
138482
139 // @dev Not implemented483 /// @dev Not implemented
140 //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 tokenId
146 ) external;490 ) external;
147491
148 // @notice Transfer ownership of an RFT -- THE CALLER IS RESPONSIBLE492 /// @notice Transfer ownership of an RFT -- THE CALLER IS RESPONSIBLE
149 // TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE493 /// TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE
150 // THEY MAY BE PERMANENTLY LOST494 /// THEY MAY BE PERMANENTLY LOST
151 // @dev Throws unless `msg.sender` is the current owner or an authorized495 /// @dev Throws unless `msg.sender` is the current owner or an authorized
152 // 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. Throws
153 // 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 NFT
156 // @param to The new owner500 /// @param to The new owner
157 // @param tokenId The NFT to transfer501 /// @param tokenId The NFT to transfer
158 // @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 tokenId
165 ) external;508 ) external;
166509
167 // @dev Not implemented510 /// @dev Not implemented
168 //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;
171514
172 // @dev Not implemented515 /// @dev Not implemented
173 //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;
176519
177 // @dev Not implemented520 /// @dev Not implemented
178 //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);
181524
182 // @dev Not implemented525 /// @dev Not implemented
183 //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 external
187 view530 view
188 returns (address);531 returns (address);
189}532}
190
191// Selector: 5b5e139f
192interface ERC721Metadata is Dummy, ERC165 {
193 // @notice A descriptive name for a collection of RFTs in this contract
194 //
195 // Selector: name() 06fdde03
196 function name() external view returns (string memory);
197
198 // @notice An abbreviated name for RFTs in this contract
199 //
200 // Selector: symbol() 95d89b41
201 function symbol() external view returns (string memory);
202
203 // @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 suffix
209 // otherwise, return concatenation of `baseURI` and stringified token id (decimal stringifying, without paddings).
210 //
211 // @return token's const_metadata
212 //
213 // Selector: tokenURI(uint256) c87b56dd
214 function tokenURI(uint256 tokenId) external view returns (string memory);
215}
216
217// Selector: 68ccfe89
218interface ERC721Mintable is Dummy, ERC165, ERC721MintableEvents {
219 // Selector: mintingFinished() 05d2035b
220 function mintingFinished() external view returns (bool);
221
222 // @notice Function to mint token.
223 // @dev `tokenId` should be obtained with `nextTokenId` method,
224 // unlike standard, you can't specify it manually
225 // @param to The new owner
226 // @param tokenId ID of the minted RFT
227 //
228 // Selector: mint(address,uint256) 40c10f19
229 function mint(address to, uint256 tokenId) external returns (bool);
230
231 // @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 manually
234 // @param to The new owner
235 // @param tokenId ID of the minted RFT
236 // @param tokenUri Token URI that would be stored in the RFT properties
237 //
238 // Selector: mintWithTokenURI(address,uint256,string) 50bb4e7f
239 function mintWithTokenURI(
240 address to,
241 uint256 tokenId,
242 string memory tokenUri
243 ) external returns (bool);
244
245 // @dev Not implemented
246 //
247 // Selector: finishMinting() 7d64bcb4
248 function finishMinting() external returns (bool);
249}
250
251// Selector: 780e9d63
252interface ERC721Enumerable is Dummy, ERC165 {
253 // @notice Enumerate valid RFTs
254 // @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) 4f6ccce7
259 function tokenByIndex(uint256 index) external view returns (uint256);
260
261 // Not implemented
262 //
263 // Selector: tokenOfOwnerByIndex(address,uint256) 2f745c59
264 function tokenOfOwnerByIndex(address owner, uint256 index)
265 external
266 view
267 returns (uint256);
268
269 // @notice Count RFTs tracked by this contract
270 // @return A count of valid RFTs tracked by this contract, where each one of
271 // them has an assigned and queryable owner not equal to the zero address
272 //
273 // Selector: totalSupply() 18160ddd
274 function totalSupply() external view returns (uint256);
275}
276
277// Selector: 7c3bef89
278interface ERC721UniqueExtensions is Dummy, ERC165 {
279 // @notice Transfer ownership of an RFT
280 // @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 owner
284 // @param tokenId The RFT to transfer
285 // @param _value Not used for an RFT
286 //
287 // Selector: transfer(address,uint256) a9059cbb
288 function transfer(address to, uint256 tokenId) external;
289
290 // @notice Burns a specific ERC721 token.
291 // @dev Throws unless `msg.sender` is the current owner or an authorized
292 // operator for this RFT. Throws if `from` is not the current owner. Throws
293 // 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 RFT
296 // @param tokenId The RFT to transfer
297 // @param _value Not used for an RFT
298 //
299 // Selector: burnFrom(address,uint256) 79cc6790
300 function burnFrom(address from, uint256 tokenId) external;
301
302 // @notice Returns next free RFT ID.
303 //
304 // Selector: nextTokenId() 75794a3c
305 function nextTokenId() external view returns (uint256);
306
307 // @notice Function to mint multiple tokens.
308 // @dev `tokenIds` should be an array of consecutive numbers and first number
309 // should be obtained with `nextTokenId` method
310 // @param to The new owner
311 // @param tokenIds IDs of the minted RFTs
312 //
313 // Selector: mintBulk(address,uint256[]) 44a9945e
314 function mintBulk(address to, uint256[] memory tokenIds)
315 external
316 returns (bool);
317
318 // @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 consecutive
320 // numbers and first number should be obtained with `nextTokenId` method
321 // @param to The new owner
322 // @param tokens array of pairs of token ID and token URI for minted tokens
323 //
324 // Selector: mintBulkWithTokenURI(address,(uint256,string)[]) 36543006
325 function mintBulkWithTokenURI(address to, Tuple0[] memory tokens)
326 external
327 returns (bool);
328
329 // Returns EVM address for refungible token
330 //
331 // @param token ID of the token
332 //
333 // Selector: tokenContractAddress(uint256) ab76fac6
334 function tokenContractAddress(uint256 token)
335 external
336 view
337 returns (address);
338}
339
340// Selector: ffe4da23
341interface Collection is Dummy, ERC165 {
342 // Set collection property.
343 //
344 // @param key Property key.
345 // @param value Propery value.
346 //
347 // Selector: setCollectionProperty(string,bytes) 2f073f66
348 function setCollectionProperty(string memory key, bytes memory value)
349 external;
350
351 // Delete collection property.
352 //
353 // @param key Property key.
354 //
355 // Selector: deleteCollectionProperty(string) 7b7debce
356 function deleteCollectionProperty(string memory key) external;
357
358 // Get collection property.
359 //
360 // @dev Throws error if key not found.
361 //
362 // @param key Property key.
363 // @return bytes The property corresponding to the key.
364 //
365 // Selector: collectionProperty(string) cf24fd6d
366 function collectionProperty(string memory key)
367 external
368 view
369 returns (bytes memory);
370
371 // Set the sponsor of the collection.
372 //
373 // @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.
374 //
375 // @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.
376 //
377 // Selector: setCollectionSponsor(address) 7623402e
378 function setCollectionSponsor(address sponsor) external;
379
380 // Collection sponsorship confirmation.
381 //
382 // @dev After setting the sponsor for the collection, it must be confirmed with this function.
383 //
384 // Selector: confirmCollectionSponsorship() 3c50e97a
385 function confirmCollectionSponsorship() external;
386
387 // Set limits for the collection.
388 // @dev Throws error if limit not found.
389 // @param limit Name of the limit. Valid names:
390 // "accountTokenOwnershipLimit",
391 // "sponsoredDataSize",
392 // "sponsoredDataRateLimit",
393 // "tokenLimit",
394 // "sponsorTransferTimeout",
395 // "sponsorApproveTimeout"
396 // @param value Value of the limit.
397 //
398 // Selector: setCollectionLimit(string,uint32) 6a3841db
399 function setCollectionLimit(string memory limit, uint32 value) external;
400
401 // Set limits for the collection.
402 // @dev Throws error if limit not found.
403 // @param limit Name of the limit. Valid names:
404 // "ownerCanTransfer",
405 // "ownerCanDestroy",
406 // "transfersEnabled"
407 // @param value Value of the limit.
408 //
409 // Selector: setCollectionLimit(string,bool) 993b7fba
410 function setCollectionLimit(string memory limit, bool value) external;
411
412 // Get contract address.
413 //
414 // Selector: contractAddress() f6b4dfb4
415 function contractAddress() external view returns (address);
416
417 // Add collection admin by substrate address.
418 // @param new_admin Substrate administrator address.
419 //
420 // Selector: addCollectionAdminSubstrate(uint256) 5730062b
421 function addCollectionAdminSubstrate(uint256 newAdmin) external;
422
423 // Remove collection admin by substrate address.
424 // @param admin Substrate administrator address.
425 //
426 // Selector: removeCollectionAdminSubstrate(uint256) 4048fcf9
427 function removeCollectionAdminSubstrate(uint256 admin) external;
428
429 // Add collection admin.
430 // @param new_admin Address of the added administrator.
431 //
432 // Selector: addCollectionAdmin(address) 92e462c7
433 function addCollectionAdmin(address newAdmin) external;
434
435 // Remove collection admin.
436 //
437 // @param new_admin Address of the removed administrator.
438 //
439 // Selector: removeCollectionAdmin(address) fafd7b42
440 function removeCollectionAdmin(address admin) external;
441
442 // Toggle accessibility of collection nesting.
443 //
444 // @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
445 //
446 // Selector: setCollectionNesting(bool) 112d4586
447 function setCollectionNesting(bool enable) external;
448
449 // Toggle accessibility of collection nesting.
450 //
451 // @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
452 // @param collections Addresses of collections that will be available for nesting.
453 //
454 // Selector: setCollectionNesting(bool,address[]) 64872396
455 function setCollectionNesting(bool enable, address[] memory collections)
456 external;
457
458 // Set the collection access method.
459 // @param mode Access mode
460 // 0 for Normal
461 // 1 for AllowList
462 //
463 // Selector: setCollectionAccess(uint8) 41835d4c
464 function setCollectionAccess(uint8 mode) external;
465
466 // Add the user to the allowed list.
467 //
468 // @param user Address of a trusted user.
469 //
470 // Selector: addToCollectionAllowList(address) 67844fe6
471 function addToCollectionAllowList(address user) external;
472
473 // Remove the user from the allowed list.
474 //
475 // @param user Address of a removed user.
476 //
477 // Selector: removeFromCollectionAllowList(address) 85c51acb
478 function removeFromCollectionAllowList(address user) external;
479
480 // Switch permission for minting.
481 //
482 // @param mode Enable if "true".
483 //
484 // Selector: setCollectionMintMode(bool) 00018e84
485 function setCollectionMintMode(bool mode) external;
486
487 // Check that account is the owner or admin of the collection
488 //
489 // @param user account to verify
490 // @return "true" if account is the owner or admin
491 //
492 // Selector: isOwnerOrAdmin(address) 9811b0c7
493 function isOwnerOrAdmin(address user) external view returns (bool);
494
495 // Check that substrate account is the owner or admin of the collection
496 //
497 // @param user account to verify
498 // @return "true" if account is the owner or admin
499 //
500 // Selector: isOwnerOrAdminSubstrate(uint256) 68910e00
501 function isOwnerOrAdminSubstrate(uint256 user) external view returns (bool);
502
503 // Returns collection type
504 //
505 // @return `Fungible` or `NFT` or `ReFungible`
506 //
507 // Selector: uniqueCollectionType() d34b55b8
508 function uniqueCollectionType() external returns (string memory);
509
510 // Changes collection owner to another account
511 //
512 // @dev Owner can be changed only by current owner
513 // @param newOwner new owner account
514 //
515 // Selector: setOwner(address) 13af4035
516 function setOwner(address newOwner) external;
517
518 // Changes collection owner to another substrate account
519 //
520 // @dev Owner can be changed only by current owner
521 // @param newOwner new owner substrate account
522 //
523 // Selector: setOwnerSubstrate(uint256) b212138f
524 function setOwnerSubstrate(uint256 newOwner) external;
525}
526533
527interface UniqueRefungible is534interface UniqueRefungible is
528 Dummy,535 Dummy,
modifiedtests/src/eth/api/UniqueRefungibleToken.soldiffbeforeafterboth
33
4pragma solidity >=0.8.0 <0.9.0;4pragma solidity >=0.8.0 <0.9.0;
55
6// Common stubs holder6/// @dev common stubs holder
7interface Dummy {7interface Dummy {
88
9}9}
12 function supportsInterface(bytes4 interfaceID) external view returns (bool);12 function supportsInterface(bytes4 interfaceID) external view returns (bool);
13}13}
1414
15// Inline15/// @dev the ERC-165 identifier for this interface is 0x042f1106
16interface 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 external
21 returns (bool);
22}
23
24/// @dev the ERC-165 identifier for this interface is 0x5755c3f2
25interface 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);
29
30 /// @dev EVM selector for this function is: 0xd7f083f3,
31 /// or in textual repr: parentTokenId()
32 function parentTokenId() external view returns (uint256);
33}
34
35/// @dev the ERC-165 identifier for this interface is 0xab8deb37
36interface 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);
44
45 /// @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}
52
53/// @dev inlined interface
16interface 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}
2462
25// Selector: 042f110663/// @title Standard ERC20 token
26interface 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.md
29 external67/// @dev the ERC-165 identifier for this interface is 0x942e8b22
30 returns (bool);
31}
32
33// Selector: 5755c3f2
34interface ERC1633 is Dummy, ERC165 {
35 // Selector: parentToken() 80a54001
36 function parentToken() external view returns (address);
37
38 // Selector: parentTokenId() d7f083f3
39 function parentTokenId() external view returns (uint256);
40}
41
42// Selector: 942e8b22
43interface 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);
4873
49 // @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);
5378
54 // @dev Total number of tokens in existence79 /// @dev Total number of tokens in existence
55 //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);
5883
59 // @dev Not supported84 /// @dev Not supported
60 //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);
6388
64 // @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);
7095
71 // @dev Transfer token for a specified address96 /// @dev Transfer token for a specified address
72 // @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);
77102
78 // @dev Transfer tokens from one address to another103 /// @dev Transfer tokens from one address to another
79 // @param from address The address which you want to send tokens from104 /// @param from address The address which you want to send tokens from
80 // @param to address The address which you want to transfer to105 /// @param to address The address which you want to transfer to
81 // @param amount uint256 the amount of tokens to be transferred106 /// @param amount uint256 the amount of tokens to be transferred
82 //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 amount
88 ) external returns (bool);113 ) external returns (bool);
89114
90 // @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 old
92 // 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 this
93 // 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-263524729
95 // @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);
100125
101 // @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 external
109 view134 view
110 returns (uint256);135 returns (uint256);
111}136}
112
113// Selector: ab8deb37
114interface 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) 79cc6790
121 function burnFrom(address from, uint256 amount) external returns (bool);
122
123 // @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) d2418ca7
128 function repartition(uint256 amount) external returns (bool);
129}
130137
131interface UniqueRefungibleToken is138interface UniqueRefungibleToken is
132 Dummy,139 Dummy,
modifiedtests/src/eth/nonFungibleAbi.jsondiffbeforeafterboth
255 { "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"
modifiedtests/src/eth/reFungibleAbi.jsondiffbeforeafterboth
255 { "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 }
modifiedtests/src/eth/util/contractHelpersAbi.jsondiffbeforeafterboth
225 "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": [],