git.delta.rocks / unique-network / refs/commits / 20ac01d2fe7c

difftreelog

feat eth all-in-one create_collection (#971)

Gregory Simonov2023-08-16parent: #950d276.patch.diff
in: master
* feat: setNesting api change

* fix: change restricted collections to addresses instead of ids

* feat: all in one create collection method

* fix: code review requests

* feat: use struct for create_collection flags

* fix: update evm-coder dependency

* fix: code review requests

* fix: change pending_sponsor to optional cross address

* feat: forbid user from using flags

* refactor: deduplicate CollectionFlags struct

* fix: eth CollectionMode should be NFT

* style: fix clippy warning

* fix: disable eth create_collection

---------

67 files changed

modifiedCargo.lockdiffbeforeafterboth
26462646
2647[[package]]2647[[package]]
2648name = "evm-coder"2648name = "evm-coder"
2649version = "0.3.1"2649version = "0.3.6"
2650source = "git+https://github.com/uniquenetwork/evm-coder?tag=v0.3.1#21e61c627f71337d6b8a03899fe8de14bfbf67aa"2650source = "git+https://github.com/uniquenetwork/evm-coder?tag=v0.3.6#be59ae41a5d2ec9389bae22d54f81122b6ba55a4"
2651dependencies = [2651dependencies = [
2652 "ethereum",2652 "ethereum",
2653 "evm-coder-procedural",2653 "evm-coder-procedural",
26582658
2659[[package]]2659[[package]]
2660name = "evm-coder-procedural"2660name = "evm-coder-procedural"
2661version = "0.3.1"2661version = "0.3.6"
2662source = "git+https://github.com/uniquenetwork/evm-coder?tag=v0.3.1#21e61c627f71337d6b8a03899fe8de14bfbf67aa"2662source = "git+https://github.com/uniquenetwork/evm-coder?tag=v0.3.6#be59ae41a5d2ec9389bae22d54f81122b6ba55a4"
2663dependencies = [2663dependencies = [
2664 "Inflector",2664 "Inflector",
2665 "hex",2665 "hex",
6489name = "pallet-common"6489name = "pallet-common"
6490version = "0.1.14"6490version = "0.1.14"
6491dependencies = [6491dependencies = [
6492 "bondrewd",
6492 "ethereum",6493 "ethereum",
6493 "evm-coder",6494 "evm-coder",
6494 "frame-benchmarking",6495 "frame-benchmarking",
7530 "frame-benchmarking",7531 "frame-benchmarking",
7531 "frame-support",7532 "frame-support",
7532 "frame-system",7533 "frame-system",
7534 "log",
7533 "pallet-balances-adapter",7535 "pallet-balances-adapter",
7534 "pallet-common",7536 "pallet-common",
7535 "pallet-evm",7537 "pallet-evm",
14097dependencies = [14099dependencies = [
14098 "bondrewd",14100 "bondrewd",
14099 "derivative",14101 "derivative",
14102 "evm-coder",
14100 "frame-support",14103 "frame-support",
14101 "pallet-evm",14104 "pallet-evm",
14102 "parity-scale-codec",14105 "parity-scale-codec",
modifiedCargo.tomldiffbeforeafterboth
27[workspace.dependencies]27[workspace.dependencies]
28# Unique28# Unique
29app-promotion-rpc = { path = "primitives/app_promotion_rpc", default-features = false }29app-promotion-rpc = { path = "primitives/app_promotion_rpc", default-features = false }
30evm-coder = { git = "https://github.com/uniquenetwork/evm-coder", tag = "v0.3.1", default-features = false }30evm-coder = { git = "https://github.com/uniquenetwork/evm-coder", tag = "v0.3.6", default-features = false, features = ['bondrewd'] }
31pallet-app-promotion = { path = "pallets/app-promotion", default-features = false }31pallet-app-promotion = { path = "pallets/app-promotion", default-features = false }
32pallet-balances-adapter = { default-features = false, path = "pallets/balances-adapter" }32pallet-balances-adapter = { default-features = false, path = "pallets/balances-adapter" }
33pallet-charge-transaction = { package = "pallet-template-transaction-payment", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.43" }33pallet-charge-transaction = { package = "pallet-template-transaction-payment", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.43" }
modifiedpallets/common/Cargo.tomldiffbeforeafterboth
1010
11scale-info = { workspace = true }11scale-info = { workspace = true }
1212
13bondrewd = { version = "0.1.14", features = ["derive"], default-features = false }
13ethereum = { workspace = true }14ethereum = { workspace = true }
14evm-coder = { workspace = true }15evm-coder = { workspace = true }
15frame-benchmarking = { workspace = true, optional = true }16frame-benchmarking = { workspace = true, optional = true }
modifiedpallets/common/src/benchmarking.rsdiffbeforeafterboth
21use pallet_evm::account::CrossAccountId;21use pallet_evm::account::CrossAccountId;
22use frame_benchmarking::{benchmarks, account};22use frame_benchmarking::{benchmarks, account};
23use up_data_structs::{23use up_data_structs::{
24 CollectionMode, CollectionFlags, CreateCollectionData, CollectionId, Property, PropertyKey,24 CollectionMode, CreateCollectionData, CollectionId, Property, PropertyKey, PropertyValue,
25 PropertyValue, CollectionPermissions, NestingPermissions, AccessMode,25 CollectionPermissions, NestingPermissions, AccessMode, MAX_COLLECTION_NAME_LENGTH,
26 MAX_COLLECTION_NAME_LENGTH, MAX_COLLECTION_DESCRIPTION_LENGTH, MAX_TOKEN_PREFIX_LENGTH,26 MAX_COLLECTION_DESCRIPTION_LENGTH, MAX_TOKEN_PREFIX_LENGTH, MAX_PROPERTIES_PER_ITEM,
27 MAX_PROPERTIES_PER_ITEM,
47 .unwrap()46 .unwrap()
48}47}
49pub fn create_var_data<const S: u32>(size: u32) -> BoundedVec<u8, ConstU32<S>> {48pub fn create_var_data<const S: u32>(size: u32) -> BoundedVec<u8, ConstU32<S>> {
50 assert!(49 assert!(size <= S, "size ({size}) should be less within bound ({S})",);
51 size <= S,
52 "size ({}) should be less within bound ({})",
53 size,
54 S
55 );
56 (0..size)50 (0..size)
57 .map(|v| (v & 0xff) as u8)51 .map(|v| (v & 0xff) as u8)
81 mode: CollectionMode,75 mode: CollectionMode,
82 handler: impl FnOnce(76 handler: impl FnOnce(
83 T::CrossAccountId,77 T::CrossAccountId,
84 CreateCollectionData<T::AccountId>,78 CreateCollectionData<T::CrossAccountId>,
85 ) -> Result<CollectionId, DispatchError>,79 ) -> Result<CollectionId, DispatchError>,
86 cast: impl FnOnce(CollectionHandle<T>) -> R,80 cast: impl FnOnce(CollectionHandle<T>) -> R,
87) -> Result<R, DispatchError> {81) -> Result<R, DispatchError> {
124 create_collection_raw(118 create_collection_raw(
125 owner,119 owner,
126 CollectionMode::NFT,120 CollectionMode::NFT,
127 |owner: T::CrossAccountId, data| {121 |owner: T::CrossAccountId, data| <Pallet<T>>::init_collection(owner.clone(), owner, data),
128 <Pallet<T>>::init_collection(owner.clone(), owner, data, CollectionFlags::default())
129 },
130 |h| h,122 |h| h,
131 )123 )
132}124}
modifiedpallets/common/src/dispatch.rsdiffbeforeafterboth
9 traits::Get,9 traits::Get,
10};10};
11use sp_runtime::DispatchError;11use sp_runtime::DispatchError;
12use up_data_structs::{CollectionId, CreateCollectionData, CollectionFlags};12use up_data_structs::{CollectionId, CreateCollectionData};
1313
14use crate::{pallet::Config, CommonCollectionOperations};14use crate::{pallet::Config, CommonCollectionOperations};
1515
76 fn create(76 fn create(
77 sender: T::CrossAccountId,77 sender: T::CrossAccountId,
78 payer: T::CrossAccountId,78 payer: T::CrossAccountId,
79 data: CreateCollectionData<T::AccountId>,79 data: CreateCollectionData<T::CrossAccountId>,
80 flags: CollectionFlags,
81 ) -> Result<CollectionId, DispatchError>;80 ) -> Result<CollectionId, DispatchError>;
8281
83 /// Delete the collection.82 /// Delete the collection.
modifiedpallets/common/src/erc.rsdiffbeforeafterboth
402 Ok(())402 Ok(())
403 }403 }
404
405 #[solidity(rename_selector = "setCollectionNesting")]
406 fn set_nesting(
407 &mut self,
408 caller: Caller,
409 collection_nesting_and_permissions: eth::CollectionNestingAndPermission,
410 ) -> Result<()> {
411 self.consume_store_reads_and_writes(1, 1)?;
412
413 let caller = T::CrossAccountId::from_eth(caller);
414
415 let mut permissions = self.collection.permissions.clone();
416 let mut nesting = permissions.nesting().clone();
417
418 let bv = if !collection_nesting_and_permissions.restricted.is_empty() {
419 let mut bv = OwnerRestrictedSet::new();
420 for address in collection_nesting_and_permissions.restricted.iter() {
421 bv.try_insert(crate::eth::map_eth_to_id(address).ok_or_else(|| {
422 Error::Revert("Can't convert address into collection id".into())
423 })?)
424 .map_err(|_| "too many collections")?;
425 }
426 Some(bv)
427 } else {
428 None
429 };
430
431 nesting.token_owner = collection_nesting_and_permissions.token_owner;
432 nesting.collection_admin = collection_nesting_and_permissions.collection_admin;
433 nesting.restricted = bv;
434 permissions.nesting = Some(nesting);
435
436 <Pallet<T>>::update_permissions(&caller, self, permissions).map_err(dispatch_to_evm::<T>)
437 }
404438
405 /// Toggle accessibility of collection nesting.439 /// Toggle accessibility of collection nesting.
406 ///440 ///
407 /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'441 /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
408 #[solidity(rename_selector = "setCollectionNesting")]442 #[solidity(hide, rename_selector = "setCollectionNesting")]
409 fn set_nesting_bool(&mut self, caller: Caller, enable: bool) -> Result<()> {443 fn set_nesting_bool(&mut self, caller: Caller, enable: bool) -> Result<()> {
410 self.consume_store_reads_and_writes(1, 1)?;444 self.consume_store_reads_and_writes(1, 1)?;
411445
424 ///458 ///
425 /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'459 /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
426 /// @param collections Addresses of collections that will be available for nesting.460 /// @param collections Addresses of collections that will be available for nesting.
427 #[solidity(rename_selector = "setCollectionNesting")]461 #[solidity(hide, rename_selector = "setCollectionNesting")]
428 fn set_nesting(462 fn set_nesting_collection_ids(
429 &mut self,463 &mut self,
430 caller: Caller,464 caller: Caller,
431 enable: bool,465 enable: bool,
464 <Pallet<T>>::update_permissions(&caller, self, permissions).map_err(dispatch_to_evm::<T>)498 <Pallet<T>>::update_permissions(&caller, self, permissions).map_err(dispatch_to_evm::<T>)
465 }499 }
500
501 #[solidity(rename_selector = "collectionNesting")]
502 fn collection_nesting(&self) -> Result<eth::CollectionNestingAndPermission> {
503 let nesting = self.collection.permissions.nesting();
504
505 Ok(eth::CollectionNestingAndPermission::new(
506 nesting.token_owner,
507 nesting.collection_admin,
508 nesting
509 .restricted
510 .clone()
511 .map(|b| {
512 b.0.into_inner()
513 .iter()
514 .map(|id| crate::eth::collection_id_to_address(id.0.into()))
515 .collect()
516 })
517 .unwrap_or_default(),
518 ))
519 }
466520
467 /// Returns nesting for a collection521 /// Returns nesting for a collection
468 #[solidity(rename_selector = "collectionNestingRestrictedCollectionIds")]522 #[solidity(hide, rename_selector = "collectionNestingRestrictedCollectionIds")]
469 fn collection_nesting_restricted_ids(&self) -> Result<eth::CollectionNesting> {523 fn collection_nesting_restricted_ids(&self) -> Result<eth::CollectionNesting> {
470 let nesting = self.collection.permissions.nesting();524 let nesting = self.collection.permissions.nesting();
471525
480 }534 }
481535
482 /// Returns permissions for a collection536 /// Returns permissions for a collection
537 #[solidity(hide)]
483 fn collection_nesting_permissions(&self) -> Result<Vec<eth::CollectionNestingPermission>> {538 fn collection_nesting_permissions(&self) -> Result<Vec<eth::CollectionNestingPermission>> {
484 let nesting = self.collection.permissions.nesting();539 let nesting = self.collection.permissions.nesting();
485 Ok(vec![540 Ok(vec![
modifiedpallets/common/src/eth.rsdiffbeforeafterboth
24};24};
25pub use pallet_evm::{Config, account::CrossAccountId};25pub use pallet_evm::{Config, account::CrossAccountId};
26use sp_core::{H160, U256};26use sp_core::{H160, U256};
27use up_data_structs::CollectionId;27use up_data_structs::{CollectionId, CollectionFlags};
28use pallet_evm_coder_substrate::execution::Error;
2829
29// 0x17c4e6453Cc49AAAaEACA894e6D9683e00000001 - collection 130// 0x17c4e6453Cc49AAAaEACA894e6D9683e00000001 - collection 1
30// TODO: Unhardcode prefix31// TODO: Unhardcode prefix
105 }106 }
106 }107 }
108
109 /// Converts [`CrossAddress`] to `Option<CrossAccountId>`.
110 pub fn into_option_sub_cross_account<T>(&self) -> Result<Option<T::CrossAccountId>, Error>
111 where
112 T: pallet_evm::Config,
113 T::AccountId: From<[u8; 32]>,
114 {
115 if self.eth == Default::default() && self.sub == Default::default() {
116 Ok(None)
117 } else if self.eth == Default::default() {
118 Ok(Some(convert_uint256_to_cross_account::<T>(self.sub)))
119 } else if self.sub == Default::default() {
120 Ok(Some(T::CrossAccountId::from_eth(self.eth)))
121 } else {
122 Err(format!("All fields of cross account is non zeroed {:?}", self).into())
123 }
124 }
125
107 /// Converts [`CrossAddress`] to `CrossAccountId`.126 /// Converts [`CrossAddress`] to `CrossAccountId`.
108 pub fn into_sub_cross_account<T>(127 pub fn into_sub_cross_account<T>(&self) -> Result<T::CrossAccountId, Error>
109 &self,
110 ) -> pallet_evm_coder_substrate::execution::Result<T::CrossAccountId>
111 where128 where
112 T: pallet_evm::Config,129 T: pallet_evm::Config,
113 T::AccountId: From<[u8; 32]>,130 T::AccountId: From<[u8; 32]>,
124 }141 }
125}142}
143
144/// Type of tokens in collection
145#[derive(AbiCoder, Copy, Clone, Default, Debug, PartialEq)]
146#[repr(u8)]
147pub enum CollectionMode {
148 /// Nonfungible
149 #[default]
150 Nonfungible,
151 /// Fungible
152 Fungible,
153 /// Refungible
154 Refungible,
155}
126156
127/// Ethereum representation of collection [`PropertyKey`](up_data_structs::PropertyKey) and [`PropertyValue`](up_data_structs::PropertyValue).157/// Ethereum representation of collection [`PropertyKey`](up_data_structs::PropertyKey) and [`PropertyValue`](up_data_structs::PropertyValue).
128#[derive(Debug, Default, AbiCoder)]158#[derive(Debug, Default, AbiCoder)]
144}174}
145175
146impl TryFrom<up_data_structs::Property> for Property {176impl TryFrom<up_data_structs::Property> for Property {
147 type Error = pallet_evm_coder_substrate::execution::Error;177 type Error = Error;
148178
149 fn try_from(from: up_data_structs::Property) -> Result<Self, Self::Error> {179 fn try_from(from: up_data_structs::Property) -> Result<Self, Self::Error> {
150 let key = evm_coder::types::String::from_utf8(from.key.into())180 let key = evm_coder::types::String::from_utf8(from.key.into())
155}185}
156186
157impl TryInto<up_data_structs::Property> for Property {187impl TryInto<up_data_structs::Property> for Property {
158 type Error = pallet_evm_coder_substrate::execution::Error;188 type Error = Error;
159189
160 fn try_into(self) -> Result<up_data_structs::Property, Self::Error> {190 fn try_into(self) -> Result<up_data_structs::Property, Self::Error> {
161 let key = <Vec<u8>>::from(self.key)191 let key = <Vec<u8>>::from(self.key)
208 value: Option<U256>,238 value: Option<U256>,
209}239}
210240
211impl CollectionLimit {241impl CollectionLimit {
212 /// Create [`CollectionLimit`] from field and value.242 /// Create [`CollectionLimit`] from field and value.
213 pub fn new(field: CollectionLimitField, value: Option<u32>) -> Self {243 pub fn new(field: CollectionLimitField, value: Option<u32>) -> Self {
214 Self {244 Self {
220 pub fn has_value(&self) -> bool {250 pub fn has_value(&self) -> bool {
221 self.value.is_some()251 self.value.is_some()
222 }252 }
223}253
224254 /// Set corresponding property in CollectionLimits struct
225impl TryInto<up_data_structs::CollectionLimits> for CollectionLimit {255 pub fn apply_limit(&self, limits: &mut up_data_structs::CollectionLimits) -> Result<(), Error> {
226 type Error = pallet_evm_coder_substrate::execution::Error;
227
228 fn try_into(self) -> Result<up_data_structs::CollectionLimits, Self::Error> {
229 let value = self256 let value = self
230 .value257 .value
231 .ok_or::<Self::Error>("can't convert `None` value to boolean".into())?;258 .ok_or::<Error>("can't convert `None` value to boolean".into())?;
232 let value = Some(value.try_into().map_err(|error| {259 let value = Some(value.try_into().map_err(|error| {
233 Self::Error::Revert(format!(260 Error::Revert(format!(
234 "can't convert value to u32 \"{value}\" because: \"{error}\""261 "can't convert value to u32 \"{value}\" because: \"{error}\""
235 ))262 ))
236 })?);263 })?);
239 Some(value) => match value {266 Some(value) => match value {
240 0 => Ok(Some(false)),267 0 => Ok(Some(false)),
241 1 => Ok(Some(true)),268 1 => Ok(Some(true)),
242 _ => Err(Self::Error::Revert(format!(269 _ => Err(Error::Revert(format!(
243 "can't convert value to boolean \"{value}\""270 "can't convert value to boolean \"{value}\""
244 ))),271 ))),
245 },272 },
246 None => Ok(None),273 None => Ok(None),
247 };274 };
248275
249 let mut limits = up_data_structs::CollectionLimits::default();
250 match self.field {276 match self.field {
251 CollectionLimitField::AccountTokenOwnership => {277 CollectionLimitField::AccountTokenOwnership => {
252 limits.account_token_ownership_limit = value;278 limits.account_token_ownership_limit = value;
277 limits.transfers_enabled = convert_value_to_bool()?;303 limits.transfers_enabled = convert_value_to_bool()?;
278 }304 }
279 };305 };
280 Ok(limits)306 Ok(())
281 }307 }
282}308}
309
310/// [`CollectionLimits`](up_data_structs::CollectionLimits) field representation for EVM.
311#[derive(Debug, Default, AbiCoder)]
312pub struct CollectionLimitValue {
313 field: CollectionLimitField,
314 value: U256,
315}
316
317impl CollectionLimitValue {
318 /// Create [`CollectionLimitValue`] from field and value.
319 pub fn new(field: CollectionLimitField, value: u32) -> Self {
320 Self {
321 field,
322 value: value.into(),
323 }
324 }
325
326 /// Set corresponding property in CollectionLimits struct
327 pub fn apply_limit(&self, limits: &mut up_data_structs::CollectionLimits) -> Result<(), Error> {
328 let value = self.value;
329 let value: u32 = value.try_into().map_err(|error| {
330 Error::Revert(format!(
331 "can't convert value to u32 \"{value}\" because: \"{error}\""
332 ))
333 })?;
334
335 let convert_value_to_bool = || match value {
336 0 => Ok(Some(false)),
337 1 => Ok(Some(true)),
338 _ => Err(Error::Revert(format!(
339 "can't convert value to boolean \"{value}\""
340 ))),
341 };
342
343 match self.field {
344 CollectionLimitField::AccountTokenOwnership => {
345 limits.account_token_ownership_limit = Some(value);
346 }
347 CollectionLimitField::SponsoredDataSize => {
348 limits.sponsored_data_size = Some(value);
349 }
350 CollectionLimitField::SponsoredDataRateLimit => {
351 limits.sponsored_data_rate_limit =
352 Some(up_data_structs::SponsoringRateLimit::Blocks(value));
353 }
354 CollectionLimitField::TokenLimit => {
355 limits.token_limit = Some(value);
356 }
357 CollectionLimitField::SponsorTransferTimeout => {
358 limits.sponsor_transfer_timeout = Some(value);
359 }
360 CollectionLimitField::SponsorApproveTimeout => {
361 limits.sponsor_approve_timeout = Some(value);
362 }
363 CollectionLimitField::OwnerCanTransfer => {
364 limits.owner_can_transfer = convert_value_to_bool()?;
365 }
366 CollectionLimitField::OwnerCanDestroy => {
367 limits.owner_can_destroy = convert_value_to_bool()?;
368 }
369 CollectionLimitField::TransferEnabled => {
370 limits.transfers_enabled = convert_value_to_bool()?;
371 }
372 };
373 Ok(())
374 }
375}
376
377impl TryInto<up_data_structs::CollectionLimits> for CollectionLimit {
378 type Error = Error;
379
380 fn try_into(self) -> Result<up_data_structs::CollectionLimits, Self::Error> {
381 let mut limits = up_data_structs::CollectionLimits::default();
382 self.apply_limit(&mut limits)?;
383 Ok(limits)
384 }
385}
386
387impl FromIterator<CollectionLimitValue> for Result<up_data_structs::CollectionLimits, Error> {
388 fn from_iter<T: IntoIterator<Item = CollectionLimitValue>>(
389 iter: T,
390 ) -> Result<up_data_structs::CollectionLimits, Error> {
391 let mut limits = up_data_structs::CollectionLimits::default();
392 for value in iter.into_iter() {
393 value.apply_limit(&mut limits)?;
394 }
395 Ok(limits)
396 }
397}
283398
284/// Ethereum representation of `NestingPermissions` (see [`up_data_structs::NestingPermissions`]) fields as an enumeration.399/// Ethereum representation of `NestingPermissions` (see [`up_data_structs::NestingPermissions`]) fields as an enumeration.
285#[derive(Default, Debug, Clone, Copy, AbiCoder)]400#[derive(Default, Debug, Clone, Copy, AbiCoder)]
384 /// Convert vector of [`TokenPropertyPermission`] into vector of [`up_data_structs::PropertyKeyPermission`].499 /// Convert vector of [`TokenPropertyPermission`] into vector of [`up_data_structs::PropertyKeyPermission`].
385 pub fn into_property_key_permissions(500 pub fn into_property_key_permissions(
386 permissions: Vec<TokenPropertyPermission>,501 permissions: Vec<TokenPropertyPermission>,
387 ) -> pallet_evm_coder_substrate::execution::Result<Vec<up_data_structs::PropertyKeyPermission>>502 ) -> Result<Vec<up_data_structs::PropertyKeyPermission>, Error> {
388 {
389 let mut perms = Vec::new();503 let mut perms = Vec::new();
390504
410 pub uri: String,524 pub uri: String,
411}525}
526
527/// Nested collections and permissions
528#[derive(Debug, Default, AbiCoder)]
529pub struct CollectionNestingAndPermission {
530 /// Owner of token can nest tokens under it.
531 pub token_owner: bool,
532 /// Admin of token collection can nest tokens under token.
533 pub collection_admin: bool,
534 /// If set - only tokens from specified collections can be nested.
535 pub restricted: Vec<Address>,
536}
537
538impl CollectionNestingAndPermission {
539 /// Create [`CollectionNesting`].
540 pub fn new(token_owner: bool, collection_admin: bool, restricted: Vec<Address>) -> Self {
541 Self {
542 token_owner,
543 collection_admin,
544 restricted,
545 }
546 }
547}
548
549/// Collection properties
550#[derive(Debug, Default, AbiCoder)]
551pub struct CreateCollectionData {
552 /// Collection sponsor
553 pub pending_sponsor: CrossAddress,
554 /// Collection name
555 pub name: String,
556 /// Collection description
557 pub description: String,
558 /// Token prefix
559 pub token_prefix: String,
560 /// Token type (NFT, FT or RFT)
561 pub mode: CollectionMode,
562 /// Fungible token precision
563 pub decimals: u8,
564 /// Custom Properties
565 pub properties: Vec<Property>,
566 /// Permissions for token properties
567 pub token_property_permissions: Vec<TokenPropertyPermission>,
568 /// Collection admins
569 pub admin_list: Vec<CrossAddress>,
570 /// Nesting settings
571 pub nesting_settings: CollectionNestingAndPermission,
572 /// Collection limits
573 pub limits: Vec<CollectionLimitValue>,
574 /// Extra collection flags
575 pub flags: CollectionFlags,
576}
412577
413/// Nested collections.578/// Nested collections.
414#[derive(Debug, Default, AbiCoder)]579#[derive(Debug, Default, AbiCoder)]
modifiedpallets/common/src/lib.rsdiffbeforeafterboth
73 transactional, fail,73 transactional, fail,
74};74};
75use up_data_structs::{75use up_data_structs::{
76 AccessMode, COLLECTION_NUMBER_LIMIT, Collection, RpcCollection, CollectionFlags,76 AccessMode, COLLECTION_NUMBER_LIMIT, Collection, RpcCollection, RpcCollectionFlags,
77 RpcCollectionFlags, CollectionId, CreateItemData, MAX_TOKEN_PREFIX_LENGTH,77 CollectionId, CreateItemData, MAX_TOKEN_PREFIX_LENGTH, COLLECTION_ADMINS_LIMIT, TokenId,
78 COLLECTION_ADMINS_LIMIT, TokenId, TokenChild, CollectionStats, MAX_TOKEN_OWNERSHIP,78 TokenChild, CollectionStats, MAX_TOKEN_OWNERSHIP, CollectionMode, NFT_SPONSOR_TRANSFER_TIMEOUT,
79 CollectionMode, NFT_SPONSOR_TRANSFER_TIMEOUT, FUNGIBLE_SPONSOR_TRANSFER_TIMEOUT,79 FUNGIBLE_SPONSOR_TRANSFER_TIMEOUT, REFUNGIBLE_SPONSOR_TRANSFER_TIMEOUT, MAX_SPONSOR_TIMEOUT,
1091 /// * `owner` - The owner of the collection.1090 /// * `owner` - The owner of the collection.
1092 /// * `data` - Description of the created collection.1091 /// * `data` - Description of the created collection.
1093 /// * `flags` - Extra flags to store.1092 /// * `flags` - Extra flags to store.
1094 pub fn init_collection(1093 pub fn init_collection(
1094 owner: T::CrossAccountId,
1095 payer: T::CrossAccountId,
1096 data: CreateCollectionData<T::CrossAccountId>,
1097 ) -> Result<CollectionId, DispatchError> {
1098 ensure!(data.flags.is_allowed_for_user(), <Error<T>>::NoPermission);
1099 Self::init_collection_internal(owner, payer, data)
1100 }
1101
1102 /// Initializes the collection with ForeignCollection flag. Returns [CollectionId] on success, [DispatchError] otherwise.
1103 pub fn init_foreign_collection(
1095 owner: T::CrossAccountId,1104 owner: T::CrossAccountId,
1096 payer: T::CrossAccountId,1105 payer: T::CrossAccountId,
1097 data: CreateCollectionData<T::AccountId>,1106 mut data: CreateCollectionData<T::CrossAccountId>,
1098 flags: CollectionFlags,
1099 ) -> Result<CollectionId, DispatchError> {1107 ) -> Result<CollectionId, DispatchError> {
1108 data.flags.foreign = true;
1109 let id = Self::init_collection_internal(owner, payer, data)?;
1110 Ok(id)
1111 }
1112
1113 fn init_collection_internal(
1114 owner: T::CrossAccountId,
1115 payer: T::CrossAccountId,
1116 data: CreateCollectionData<T::CrossAccountId>,
1117 ) -> Result<CollectionId, DispatchError> {
1100 {1118 {
1101 ensure!(1119 ensure!(
1102 data.token_prefix.len() <= MAX_TOKEN_PREFIX_LENGTH as usize,1120 data.token_prefix.len() <= MAX_TOKEN_PREFIX_LENGTH as usize,
1127 token_prefix: data.token_prefix,1145 token_prefix: data.token_prefix,
1128 sponsorship: data1146 sponsorship: data
1129 .pending_sponsor1147 .pending_sponsor
1130 .map(SponsorshipState::Unconfirmed)1148 .map(|sponsor| SponsorshipState::Unconfirmed(sponsor.as_sub().clone()))
1131 .unwrap_or_default(),1149 .unwrap_or_default(),
1132 limits: data1150 limits: data
1133 .limits1151 .limits
1139 Self::clamp_permissions(data.mode.clone(), &Default::default(), permissions)1157 Self::clamp_permissions(data.mode.clone(), &Default::default(), permissions)
1140 })1158 })
1141 .unwrap_or_else(|| Ok(CollectionPermissions::default()))?,1159 .unwrap_or_else(|| Ok(CollectionPermissions::default()))?,
1142 flags,1160 flags: data.flags,
1143 };1161 };
11441162
1145 let mut collection_properties = CollectionPropertiesT::new();1163 let mut collection_properties = CollectionPropertiesT::new();
11561174
1157 CollectionPropertyPermissions::<T>::insert(id, token_props_permissions);1175 CollectionPropertyPermissions::<T>::insert(id, token_props_permissions);
1176
1177 let mut admin_amount = 0u32;
1178 for admin in data.admin_list.iter() {
1179 if !<IsAdmin<T>>::get((id, admin)) {
1180 <IsAdmin<T>>::insert((id, admin), true);
1181 admin_amount = admin_amount
1182 .checked_add(1)
1183 .ok_or(<Error<T>>::CollectionAdminCountExceeded)?;
1184 }
1185 }
1186 ensure!(
1187 admin_amount <= Self::collection_admins_limit(),
1188 <Error<T>>::CollectionAdminCountExceeded,
1189 );
1190 <AdminAmount<T>>::insert(id, admin_amount);
11581191
1159 // Take a (non-refundable) deposit of collection creation1192 // Take a (non-refundable) deposit of collection creation
1160 {1193 {
modifiedpallets/foreign-assets/src/lib.rsdiffbeforeafterboth
42 RuntimeDebug,42 RuntimeDebug,
43};43};
44use frame_system::pallet_prelude::*;44use frame_system::pallet_prelude::*;
45use up_data_structs::{CollectionMode};45use up_data_structs::CollectionMode;
46use pallet_fungible::{Pallet as PalletFungible};46use pallet_fungible::Pallet as PalletFungible;
47use scale_info::{TypeInfo};47use scale_info::TypeInfo;
48use sp_runtime::{48use sp_runtime::{
49 traits::{One, Zero},49 traits::{One, Zero},
50 ArithmeticError,50 ArithmeticError,
304 .collect::<Vec<u16>>();304 .collect::<Vec<u16>>();
305 description.append(&mut name.clone());305 description.append(&mut name.clone());
306306
307 let data: CreateCollectionData<T::AccountId> = CreateCollectionData {307 let data: CreateCollectionData<T::CrossAccountId> = CreateCollectionData {
308 name: name.try_into().unwrap(),308 name: name.try_into().unwrap(),
309 description: description.try_into().unwrap(),309 description: description.try_into().unwrap(),
310 mode: CollectionMode::Fungible(md.decimals),310 mode: CollectionMode::Fungible(md.decimals),
modifiedpallets/fungible/src/benchmarking.rsdiffbeforeafterboth
31 create_collection_raw(31 create_collection_raw(
32 owner,32 owner,
33 CollectionMode::Fungible(0),33 CollectionMode::Fungible(0),
34 |owner: T::CrossAccountId, data| {34 |owner: T::CrossAccountId, data| <Pallet<T>>::init_collection(owner.clone(), owner, data),
35 <Pallet<T>>::init_collection(owner.clone(), owner, data, Default::default())
36 },
37 FungibleHandle::cast,35 FungibleHandle::cast,
38 )36 )
39}37}
modifiedpallets/fungible/src/lib.rsdiffbeforeafterboth
87};87};
88use pallet_evm::account::CrossAccountId;88use pallet_evm::account::CrossAccountId;
89use up_data_structs::{89use up_data_structs::{
90 AccessMode, CollectionId, CollectionFlags, TokenId, CreateCollectionData,90 AccessMode, CollectionId, TokenId, CreateCollectionData, mapping::TokenAddressMapping,
91 mapping::TokenAddressMapping, budget::Budget, PropertyKey, Property,91 budget::Budget, PropertyKey, Property,
92};92};
93use pallet_common::{93use pallet_common::{
219 pub fn init_collection(219 pub fn init_collection(
220 owner: T::CrossAccountId,220 owner: T::CrossAccountId,
221 payer: T::CrossAccountId,221 payer: T::CrossAccountId,
222 data: CreateCollectionData<T::AccountId>,222 data: CreateCollectionData<T::CrossAccountId>,
223 flags: CollectionFlags,
224 ) -> Result<CollectionId, DispatchError> {223 ) -> Result<CollectionId, DispatchError> {
225 <PalletCommon<T>>::init_collection(owner, payer, data, flags)224 <PalletCommon<T>>::init_collection(owner, payer, data)
226 }225 }
227226
228 /// Initializes the collection with ForeignCollection flag. Returns [CollectionId] on success, [DispatchError] otherwise.227 /// Initializes the collection with ForeignCollection flag. Returns [CollectionId] on success, [DispatchError] otherwise.
229 pub fn init_foreign_collection(228 pub fn init_foreign_collection(
230 owner: T::CrossAccountId,229 owner: T::CrossAccountId,
231 payer: T::CrossAccountId,230 payer: T::CrossAccountId,
232 data: CreateCollectionData<T::AccountId>,231 data: CreateCollectionData<T::CrossAccountId>,
233 ) -> Result<CollectionId, DispatchError> {232 ) -> Result<CollectionId, DispatchError> {
234 let id = <PalletCommon<T>>::init_collection(233 <PalletCommon<T>>::init_foreign_collection(owner, payer, data)
235 owner,
236 payer,
237 data,
238 CollectionFlags {
239 foreign: true,
240 ..Default::default()
241 },
242 )?;
243 Ok(id)
244 }234 }
245235
246 /// Destroys a collection.236 /// Destroys a collection.
modifiedpallets/fungible/src/stubs/UniqueFungible.rawdiffbeforeafterboth

binary blob — no preview

modifiedpallets/fungible/src/stubs/UniqueFungible.soldiffbeforeafterboth
18}18}
1919
20/// @title A contract that allows you to work with collections.20/// @title A contract that allows you to work with collections.
21/// @dev the ERC-165 identifier for this interface is 0x2a14cfd121/// @dev the ERC-165 identifier for this interface is 0xb34d97e9
22contract Collection is Dummy, ERC165 {22contract Collection is Dummy, ERC165 {
23 // /// Set collection property.23 // /// Set collection property.
24 // ///24 // ///
230 // dummy = 0;230 // dummy = 0;
231 // }231 // }
232232
233 /// Toggle accessibility of collection nesting.
234 ///
235 /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
236 /// @dev EVM selector for this function is: 0x112d4586,
237 /// or in textual repr: setCollectionNesting(bool)
238 function setCollectionNesting(bool enable) public {
239 require(false, stub_error);
240 enable;
241 dummy = 0;
242 }
243
244 /// Toggle accessibility of collection nesting.
245 ///
246 /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
247 /// @param collections Addresses of collections that will be available for nesting.
248 /// @dev EVM selector for this function is: 0x64872396,233 /// @dev EVM selector for this function is: 0x0b9f3890,
249 /// or in textual repr: setCollectionNesting(bool,address[])234 /// or in textual repr: setCollectionNesting((bool,bool,address[]))
250 function setCollectionNesting(bool enable, address[] memory collections) public {235 function setCollectionNesting(CollectionNestingAndPermission memory collectionNestingAndPermissions) public {
251 require(false, stub_error);236 require(false, stub_error);
252 enable;237 collectionNestingAndPermissions;
253 collections;
254 dummy = 0;238 dummy = 0;
255 }239 }
256240
257 /// Returns nesting for a collection241 // /// Toggle accessibility of collection nesting.
242 // ///
243 // /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
244 // /// @dev EVM selector for this function is: 0x112d4586,
245 // /// or in textual repr: setCollectionNesting(bool)
246 // function setCollectionNesting(bool enable) public {
247 // require(false, stub_error);
248 // enable;
249 // dummy = 0;
250 // }
251
252 // /// Toggle accessibility of collection nesting.
253 // ///
254 // /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
255 // /// @param collections Addresses of collections that will be available for nesting.
256 // /// @dev EVM selector for this function is: 0x64872396,
257 // /// or in textual repr: setCollectionNesting(bool,address[])
258 // function setCollectionNesting(bool enable, address[] memory collections) public {
259 // require(false, stub_error);
260 // enable;
261 // collections;
262 // dummy = 0;
263 // }
264
258 /// @dev EVM selector for this function is: 0x22d25bfe,265 /// @dev EVM selector for this function is: 0x92c660a8,
259 /// or in textual repr: collectionNestingRestrictedCollectionIds()266 /// or in textual repr: collectionNesting()
260 function collectionNestingRestrictedCollectionIds() public view returns (CollectionNesting memory) {267 function collectionNesting() public view returns (CollectionNestingAndPermission memory) {
261 require(false, stub_error);268 require(false, stub_error);
262 dummy;269 dummy;
263 return CollectionNesting(false, new uint256[](0));270 return CollectionNestingAndPermission(false, false, new address[](0));
264 }271 }
272
273 // /// Returns nesting for a collection
274 // /// @dev EVM selector for this function is: 0x22d25bfe,
275 // /// or in textual repr: collectionNestingRestrictedCollectionIds()
276 // function collectionNestingRestrictedCollectionIds() public view returns (CollectionNesting memory) {
277 // require(false, stub_error);
278 // dummy;
279 // return CollectionNesting(false,new uint256[](0));
280 // }
265281
266 /// Returns permissions for a collection282 // /// Returns permissions for a collection
267 /// @dev EVM selector for this function is: 0x5b2eaf4b,283 // /// @dev EVM selector for this function is: 0x5b2eaf4b,
268 /// or in textual repr: collectionNestingPermissions()284 // /// or in textual repr: collectionNestingPermissions()
269 function collectionNestingPermissions() public view returns (CollectionNestingPermission[] memory) {285 // function collectionNestingPermissions() public view returns (CollectionNestingPermission[] memory) {
270 require(false, stub_error);286 // require(false, stub_error);
271 dummy;287 // dummy;
272 return new CollectionNestingPermission[](0);288 // return new CollectionNestingPermission[](0);
273 }289 // }
274290
275 /// Set the collection access method.291 /// Set the collection access method.
276 /// @param mode Access mode292 /// @param mode Access mode
469 uint256[] ids;485 uint256[] ids;
470}486}
487
488/// Nested collections and permissions
489struct CollectionNestingAndPermission {
490 /// Owner of token can nest tokens under it.
491 bool token_owner;
492 /// Admin of token collection can nest tokens under token.
493 bool collection_admin;
494 /// If set - only tokens from specified collections can be nested.
495 address[] restricted;
496}
471497
472/// [`CollectionLimits`](up_data_structs::CollectionLimits) field representation for EVM.498/// [`CollectionLimits`](up_data_structs::CollectionLimits) field representation for EVM.
473struct CollectionLimit {499struct CollectionLimit {
modifiedpallets/nonfungible/src/benchmarking.rsdiffbeforeafterboth
57 create_collection_raw(57 create_collection_raw(
58 owner,58 owner,
59 CollectionMode::NFT,59 CollectionMode::NFT,
60 |owner: T::CrossAccountId, data| {60 |owner: T::CrossAccountId, data| <Pallet<T>>::init_collection(owner.clone(), owner, data),
61 <Pallet<T>>::init_collection(owner.clone(), owner, data, Default::default())
62 },
63 NonfungibleHandle::cast,61 NonfungibleHandle::cast,
64 )62 )
65}63}
modifiedpallets/nonfungible/src/lib.rsdiffbeforeafterboth
100 dispatch::{PostDispatchInfo, Pays},100 dispatch::{PostDispatchInfo, Pays},
101};101};
102use up_data_structs::{102use up_data_structs::{
103 AccessMode, CollectionId, CollectionFlags, CustomDataLimit, TokenId, CreateCollectionData,103 AccessMode, CollectionId, CustomDataLimit, TokenId, CreateCollectionData, CreateNftExData,
104 CreateNftExData, mapping::TokenAddressMapping, budget::Budget, Property, PropertyKey,104 mapping::TokenAddressMapping, budget::Budget, Property, PropertyKey, PropertyValue,
105 PropertyValue, PropertyKeyPermission, PropertyScope, TrySetProperty, TokenChild,105 PropertyKeyPermission, PropertyScope, TrySetProperty, TokenChild, AuxPropertyValue,
106 AuxPropertyValue, PropertiesPermissionMap, TokenProperties as TokenPropertiesT,106 PropertiesPermissionMap, TokenProperties as TokenPropertiesT,
424 pub fn init_collection(424 pub fn init_collection(
425 owner: T::CrossAccountId,425 owner: T::CrossAccountId,
426 payer: T::CrossAccountId,426 payer: T::CrossAccountId,
427 data: CreateCollectionData<T::AccountId>,427 data: CreateCollectionData<T::CrossAccountId>,
428 flags: CollectionFlags,
429 ) -> Result<CollectionId, DispatchError> {428 ) -> Result<CollectionId, DispatchError> {
430 <PalletCommon<T>>::init_collection(owner, payer, data, flags)429 <PalletCommon<T>>::init_collection(owner, payer, data)
431 }430 }
432431
433 /// Destroy NFT collection432 /// Destroy NFT collection
modifiedpallets/nonfungible/src/stubs/UniqueNFT.rawdiffbeforeafterboth

binary blob — no preview

modifiedpallets/nonfungible/src/stubs/UniqueNFT.soldiffbeforeafterboth
165}165}
166166
167/// @title A contract that allows you to work with collections.167/// @title A contract that allows you to work with collections.
168/// @dev the ERC-165 identifier for this interface is 0x2a14cfd1168/// @dev the ERC-165 identifier for this interface is 0xb34d97e9
169contract Collection is Dummy, ERC165 {169contract Collection is Dummy, ERC165 {
170 // /// Set collection property.170 // /// Set collection property.
171 // ///171 // ///
377 // dummy = 0;377 // dummy = 0;
378 // }378 // }
379379
380 /// Toggle accessibility of collection nesting.
381 ///
382 /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
383 /// @dev EVM selector for this function is: 0x112d4586,
384 /// or in textual repr: setCollectionNesting(bool)
385 function setCollectionNesting(bool enable) public {
386 require(false, stub_error);
387 enable;
388 dummy = 0;
389 }
390
391 /// Toggle accessibility of collection nesting.
392 ///
393 /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
394 /// @param collections Addresses of collections that will be available for nesting.
395 /// @dev EVM selector for this function is: 0x64872396,380 /// @dev EVM selector for this function is: 0x0b9f3890,
396 /// or in textual repr: setCollectionNesting(bool,address[])381 /// or in textual repr: setCollectionNesting((bool,bool,address[]))
397 function setCollectionNesting(bool enable, address[] memory collections) public {382 function setCollectionNesting(CollectionNestingAndPermission memory collectionNestingAndPermissions) public {
398 require(false, stub_error);383 require(false, stub_error);
399 enable;384 collectionNestingAndPermissions;
400 collections;
401 dummy = 0;385 dummy = 0;
402 }386 }
403387
404 /// Returns nesting for a collection388 // /// Toggle accessibility of collection nesting.
389 // ///
390 // /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
391 // /// @dev EVM selector for this function is: 0x112d4586,
392 // /// or in textual repr: setCollectionNesting(bool)
393 // function setCollectionNesting(bool enable) public {
394 // require(false, stub_error);
395 // enable;
396 // dummy = 0;
397 // }
398
399 // /// Toggle accessibility of collection nesting.
400 // ///
401 // /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
402 // /// @param collections Addresses of collections that will be available for nesting.
403 // /// @dev EVM selector for this function is: 0x64872396,
404 // /// or in textual repr: setCollectionNesting(bool,address[])
405 // function setCollectionNesting(bool enable, address[] memory collections) public {
406 // require(false, stub_error);
407 // enable;
408 // collections;
409 // dummy = 0;
410 // }
411
405 /// @dev EVM selector for this function is: 0x22d25bfe,412 /// @dev EVM selector for this function is: 0x92c660a8,
406 /// or in textual repr: collectionNestingRestrictedCollectionIds()413 /// or in textual repr: collectionNesting()
407 function collectionNestingRestrictedCollectionIds() public view returns (CollectionNesting memory) {414 function collectionNesting() public view returns (CollectionNestingAndPermission memory) {
408 require(false, stub_error);415 require(false, stub_error);
409 dummy;416 dummy;
410 return CollectionNesting(false, new uint256[](0));417 return CollectionNestingAndPermission(false, false, new address[](0));
411 }418 }
419
420 // /// Returns nesting for a collection
421 // /// @dev EVM selector for this function is: 0x22d25bfe,
422 // /// or in textual repr: collectionNestingRestrictedCollectionIds()
423 // function collectionNestingRestrictedCollectionIds() public view returns (CollectionNesting memory) {
424 // require(false, stub_error);
425 // dummy;
426 // return CollectionNesting(false,new uint256[](0));
427 // }
412428
413 /// Returns permissions for a collection429 // /// Returns permissions for a collection
414 /// @dev EVM selector for this function is: 0x5b2eaf4b,430 // /// @dev EVM selector for this function is: 0x5b2eaf4b,
415 /// or in textual repr: collectionNestingPermissions()431 // /// or in textual repr: collectionNestingPermissions()
416 function collectionNestingPermissions() public view returns (CollectionNestingPermission[] memory) {432 // function collectionNestingPermissions() public view returns (CollectionNestingPermission[] memory) {
417 require(false, stub_error);433 // require(false, stub_error);
418 dummy;434 // dummy;
419 return new CollectionNestingPermission[](0);435 // return new CollectionNestingPermission[](0);
420 }436 // }
421437
422 /// Set the collection access method.438 /// Set the collection access method.
423 /// @param mode Access mode439 /// @param mode Access mode
616 uint256[] ids;632 uint256[] ids;
617}633}
634
635/// Nested collections and permissions
636struct CollectionNestingAndPermission {
637 /// Owner of token can nest tokens under it.
638 bool token_owner;
639 /// Admin of token collection can nest tokens under token.
640 bool collection_admin;
641 /// If set - only tokens from specified collections can be nested.
642 address[] restricted;
643}
618644
619/// [`CollectionLimits`](up_data_structs::CollectionLimits) field representation for EVM.645/// [`CollectionLimits`](up_data_structs::CollectionLimits) field representation for EVM.
620struct CollectionLimit {646struct CollectionLimit {
modifiedpallets/refungible/src/benchmarking.rsdiffbeforeafterboth
61 create_collection_raw(61 create_collection_raw(
62 owner,62 owner,
63 CollectionMode::ReFungible,63 CollectionMode::ReFungible,
64 |owner: T::CrossAccountId, data| {64 |owner: T::CrossAccountId, data| <Pallet<T>>::init_collection(owner.clone(), owner, data),
65 <Pallet<T>>::init_collection(owner.clone(), owner, data, Default::default())
66 },
67 RefungibleHandle::cast,65 RefungibleHandle::cast,
68 )66 )
69}67}
modifiedpallets/refungible/src/lib.rsdiffbeforeafterboth
104use sp_runtime::{ArithmeticError, DispatchError, DispatchResult, TransactionOutcome};104use sp_runtime::{ArithmeticError, DispatchError, DispatchResult, TransactionOutcome};
105use sp_std::{vec::Vec, vec, collections::btree_map::BTreeMap};105use sp_std::{vec::Vec, vec, collections::btree_map::BTreeMap};
106use up_data_structs::{106use up_data_structs::{
107 AccessMode, budget::Budget, CollectionId, CollectionFlags, CreateCollectionData,107 AccessMode, budget::Budget, CollectionId, CreateCollectionData, mapping::TokenAddressMapping,
108 mapping::TokenAddressMapping, MAX_REFUNGIBLE_PIECES, Property, PropertyKey,108 MAX_REFUNGIBLE_PIECES, Property, PropertyKey, PropertyKeyPermission, PropertyScope,
109 PropertyKeyPermission, PropertyScope, PropertyValue, TokenId, TrySetProperty,109 PropertyValue, TokenId, TrySetProperty, PropertiesPermissionMap,
110 PropertiesPermissionMap, CreateRefungibleExMultipleOwners, TokenOwnerError,110 CreateRefungibleExMultipleOwners, TokenOwnerError, TokenProperties as TokenPropertiesT,
334 pub fn init_collection(333 pub fn init_collection(
335 owner: T::CrossAccountId,334 owner: T::CrossAccountId,
336 payer: T::CrossAccountId,335 payer: T::CrossAccountId,
337 data: CreateCollectionData<T::AccountId>,336 data: CreateCollectionData<T::CrossAccountId>,
338 flags: CollectionFlags,
339 ) -> Result<CollectionId, DispatchError> {337 ) -> Result<CollectionId, DispatchError> {
340 <PalletCommon<T>>::init_collection(owner, payer, data, flags)338 <PalletCommon<T>>::init_collection(owner, payer, data)
341 }339 }
342340
343 /// Destroy RFT collection341 /// Destroy RFT collection
modifiedpallets/refungible/src/stubs/UniqueRefungible.rawdiffbeforeafterboth

binary blob — no preview

modifiedpallets/refungible/src/stubs/UniqueRefungible.soldiffbeforeafterboth
165}165}
166166
167/// @title A contract that allows you to work with collections.167/// @title A contract that allows you to work with collections.
168/// @dev the ERC-165 identifier for this interface is 0x2a14cfd1168/// @dev the ERC-165 identifier for this interface is 0xb34d97e9
169contract Collection is Dummy, ERC165 {169contract Collection is Dummy, ERC165 {
170 // /// Set collection property.170 // /// Set collection property.
171 // ///171 // ///
377 // dummy = 0;377 // dummy = 0;
378 // }378 // }
379379
380 /// Toggle accessibility of collection nesting.
381 ///
382 /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
383 /// @dev EVM selector for this function is: 0x112d4586,
384 /// or in textual repr: setCollectionNesting(bool)
385 function setCollectionNesting(bool enable) public {
386 require(false, stub_error);
387 enable;
388 dummy = 0;
389 }
390
391 /// Toggle accessibility of collection nesting.
392 ///
393 /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
394 /// @param collections Addresses of collections that will be available for nesting.
395 /// @dev EVM selector for this function is: 0x64872396,380 /// @dev EVM selector for this function is: 0x0b9f3890,
396 /// or in textual repr: setCollectionNesting(bool,address[])381 /// or in textual repr: setCollectionNesting((bool,bool,address[]))
397 function setCollectionNesting(bool enable, address[] memory collections) public {382 function setCollectionNesting(CollectionNestingAndPermission memory collectionNestingAndPermissions) public {
398 require(false, stub_error);383 require(false, stub_error);
399 enable;384 collectionNestingAndPermissions;
400 collections;
401 dummy = 0;385 dummy = 0;
402 }386 }
403387
404 /// Returns nesting for a collection388 // /// Toggle accessibility of collection nesting.
389 // ///
390 // /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
391 // /// @dev EVM selector for this function is: 0x112d4586,
392 // /// or in textual repr: setCollectionNesting(bool)
393 // function setCollectionNesting(bool enable) public {
394 // require(false, stub_error);
395 // enable;
396 // dummy = 0;
397 // }
398
399 // /// Toggle accessibility of collection nesting.
400 // ///
401 // /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
402 // /// @param collections Addresses of collections that will be available for nesting.
403 // /// @dev EVM selector for this function is: 0x64872396,
404 // /// or in textual repr: setCollectionNesting(bool,address[])
405 // function setCollectionNesting(bool enable, address[] memory collections) public {
406 // require(false, stub_error);
407 // enable;
408 // collections;
409 // dummy = 0;
410 // }
411
405 /// @dev EVM selector for this function is: 0x22d25bfe,412 /// @dev EVM selector for this function is: 0x92c660a8,
406 /// or in textual repr: collectionNestingRestrictedCollectionIds()413 /// or in textual repr: collectionNesting()
407 function collectionNestingRestrictedCollectionIds() public view returns (CollectionNesting memory) {414 function collectionNesting() public view returns (CollectionNestingAndPermission memory) {
408 require(false, stub_error);415 require(false, stub_error);
409 dummy;416 dummy;
410 return CollectionNesting(false, new uint256[](0));417 return CollectionNestingAndPermission(false, false, new address[](0));
411 }418 }
419
420 // /// Returns nesting for a collection
421 // /// @dev EVM selector for this function is: 0x22d25bfe,
422 // /// or in textual repr: collectionNestingRestrictedCollectionIds()
423 // function collectionNestingRestrictedCollectionIds() public view returns (CollectionNesting memory) {
424 // require(false, stub_error);
425 // dummy;
426 // return CollectionNesting(false,new uint256[](0));
427 // }
412428
413 /// Returns permissions for a collection429 // /// Returns permissions for a collection
414 /// @dev EVM selector for this function is: 0x5b2eaf4b,430 // /// @dev EVM selector for this function is: 0x5b2eaf4b,
415 /// or in textual repr: collectionNestingPermissions()431 // /// or in textual repr: collectionNestingPermissions()
416 function collectionNestingPermissions() public view returns (CollectionNestingPermission[] memory) {432 // function collectionNestingPermissions() public view returns (CollectionNestingPermission[] memory) {
417 require(false, stub_error);433 // require(false, stub_error);
418 dummy;434 // dummy;
419 return new CollectionNestingPermission[](0);435 // return new CollectionNestingPermission[](0);
420 }436 // }
421437
422 /// Set the collection access method.438 /// Set the collection access method.
423 /// @param mode Access mode439 /// @param mode Access mode
616 uint256[] ids;632 uint256[] ids;
617}633}
634
635/// Nested collections and permissions
636struct CollectionNestingAndPermission {
637 /// Owner of token can nest tokens under it.
638 bool token_owner;
639 /// Admin of token collection can nest tokens under token.
640 bool collection_admin;
641 /// If set - only tokens from specified collections can be nested.
642 address[] restricted;
643}
618644
619/// [`CollectionLimits`](up_data_structs::CollectionLimits) field representation for EVM.645/// [`CollectionLimits`](up_data_structs::CollectionLimits) field representation for EVM.
620struct CollectionLimit {646struct CollectionLimit {
modifiedpallets/structure/src/benchmarking.rsdiffbeforeafterboth
40 mode: CollectionMode::NFT,40 mode: CollectionMode::NFT,
41 ..Default::default()41 ..Default::default()
42 },42 },
43 CollectionFlags::default(),
44 )?;43 )?;
45 let dispatch = T::CollectionDispatch::dispatch(CollectionId(1))?;44 let dispatch = T::CollectionDispatch::dispatch(CollectionId(1))?;
46 let dispatch = dispatch.as_dyn();45 let dispatch = dispatch.as_dyn();
modifiedpallets/unique/Cargo.tomldiffbeforeafterboth
47frame-benchmarking = { workspace = true, optional = true }47frame-benchmarking = { workspace = true, optional = true }
48frame-support = { workspace = true }48frame-support = { workspace = true }
49frame-system = { workspace = true }49frame-system = { workspace = true }
50log = { workspace = true }
50pallet-balances-adapter = { workspace = true }51pallet-balances-adapter = { workspace = true }
51pallet-common = { workspace = true }52pallet-common = { workspace = true }
52pallet-evm = { workspace = true }53pallet-evm = { workspace = true }
modifiedpallets/unique/src/eth/mod.rsdiffbeforeafterboth
15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
1616
17//! Implementation of CollectionHelpers contract.17//! Implementation of CollectionHelpers contract.
1818//!
19use core::marker::PhantomData;19use core::marker::PhantomData;
20use ethereum as _;20use ethereum as _;
21use evm_coder::{abi::AbiType, generate_stubgen, solidity_interface, types::*};21use evm_coder::{abi::AbiType, generate_stubgen, solidity_interface, types::*};
22use frame_support::traits::Get;22use frame_support::{BoundedVec, traits::Get};
23use crate::Pallet;
24
25use pallet_common::{23use pallet_common::{
26 CollectionById,24 CollectionById,
27 dispatch::CollectionDispatch,25 dispatch::CollectionDispatch,
28 erc::{CollectionHelpersEvents, static_property::key},26 erc::{CollectionHelpersEvents, static_property::key},
29 eth::{map_eth_to_id, collection_id_to_address},27 eth::{self, map_eth_to_id, collection_id_to_address},
30 Pallet as PalletCommon, CollectionHandle,28 Pallet as PalletCommon, CollectionHandle,
31};29};
32use pallet_evm::{account::CrossAccountId, OnMethodCall, PrecompileHandle, PrecompileResult};30use pallet_evm::{account::CrossAccountId, OnMethodCall, PrecompileHandle, PrecompileResult};
36 frontier_contract,34 frontier_contract,
37};35};
38use up_data_structs::{36use up_data_structs::{
39 CollectionDescription, CollectionMode, CollectionName, CollectionTokenPrefix,37 CollectionDescription, CollectionMode, CollectionName, CollectionPermissions,
40 CreateCollectionData,38 CollectionTokenPrefix, CreateCollectionData, NestingPermissions,
41};39};
4240
43use crate::{weights::WeightInfo, Config, SelfWeightOf};41use crate::{weights::WeightInfo, Config, Pallet, SelfWeightOf};
4442
45use alloc::format;43use alloc::{format, collections::BTreeSet};
46use sp_std::vec::Vec;44use sp_std::vec::Vec;
4745
48frontier_contract! {46frontier_contract! {
114 T::CrossAccountId::from_eth(<T as pallet_common::Config>::ContractAddress::get());112 T::CrossAccountId::from_eth(<T as pallet_common::Config>::ContractAddress::get());
115113
116 let collection_id =114 let collection_id = T::CollectionDispatch::create(caller, collection_helpers_address, data)
117 T::CollectionDispatch::create(caller, collection_helpers_address, data, Default::default())
118 .map_err(pallet_evm_coder_substrate::dispatch_to_evm::<T>)?;115 .map_err(pallet_evm_coder_substrate::dispatch_to_evm::<T>)?;
119 let address = pallet_common::eth::collection_id_to_address(collection_id);116 let address = pallet_common::eth::collection_id_to_address(collection_id);
120 Ok(address)117 Ok(address)
140impl<T> EvmCollectionHelpers<T>137impl<T> EvmCollectionHelpers<T>
141where138where
142 T: Config + pallet_common::Config + pallet_nonfungible::Config + pallet_refungible::Config,139 T: Config + pallet_common::Config + pallet_nonfungible::Config + pallet_refungible::Config,
140 T::AccountId: From<[u8; 32]>,
143{141{
142/*
143 /// Create a collection
144 /// @return address Address of the newly created collection
145 #[weight(<SelfWeightOf<T>>::create_collection())]
146 #[solidity(rename_selector = "createCollection")]
147 fn create_collection(
148 &mut self,
149 caller: Caller,
150 value: Value,
151 data: eth::CreateCollectionData,
152 ) -> Result<Address> {
153 let (caller, name, description, token_prefix) =
154 convert_data::<T>(caller, data.name, data.description, data.token_prefix)?;
155 if data.mode != eth::CollectionMode::Fungible && data.decimals != 0 {
156 return Err("decimals are only supported for NFT and RFT collections".into());
157 }
158 let mode = match data.mode {
159 eth::CollectionMode::Fungible => CollectionMode::Fungible(data.decimals),
160 eth::CollectionMode::Nonfungible => CollectionMode::NFT,
161 eth::CollectionMode::Refungible => CollectionMode::ReFungible,
162 };
163
164 let properties: BoundedVec<_, _> = data
165 .properties
166 .into_iter()
167 .map(eth::Property::try_into)
168 .collect::<Result<Vec<_>>>()?
169 .try_into()
170 .map_err(|_| "too many properties")?;
171
172 let token_property_permissions =
173 eth::TokenPropertyPermission::into_property_key_permissions(
174 data.token_property_permissions,
175 )?
176 .try_into()
177 .map_err(|_| "too many property permissions")?;
178
179 let limits = if !data.limits.is_empty() {
180 Some(
181 data.limits
182 .into_iter()
183 .collect::<Result<up_data_structs::CollectionLimits>>()?,
184 )
185 } else {
186 None
187 };
188
189 let pending_sponsor = data.pending_sponsor.into_option_sub_cross_account::<T>()?;
190
191 let restricted = if !data.nesting_settings.restricted.is_empty() {
192 Some(
193 data.nesting_settings
194 .restricted
195 .iter()
196 .map(map_eth_to_id)
197 .collect::<Option<BTreeSet<_>>>()
198 .ok_or("can't convert address into collection id")?
199 .try_into()
200 .map_err(|_| "too many collections")?,
201 )
202 } else {
203 None
204 };
205
206 let admin_list = data
207 .admin_list
208 .into_iter()
209 .map(|admin| admin.into_sub_cross_account::<T>())
210 .collect::<Result<Vec<_>>>()?;
211
212 let flags = data.flags;
213 if !flags.is_allowed_for_user() {
214 return Err("internal flags were used".into());
215 }
216
217 let data = CreateCollectionData {
218 name,
219 mode,
220 description,
221 token_prefix,
222 properties,
223 token_property_permissions,
224 limits,
225 pending_sponsor,
226 access: None,
227 permissions: Some(CollectionPermissions {
228 access: None,
229 mint_mode: None,
230 nesting: Some(NestingPermissions {
231 token_owner: data.nesting_settings.token_owner,
232 collection_admin: data.nesting_settings.collection_admin,
233 restricted,
234 #[cfg(feature = "runtime-benchmarks")]
235 permissive: true,
236 }),
237 }),
238 admin_list,
239 flags,
240 };
241 check_sent_amount_equals_collection_creation_price::<T>(value)?;
242 let collection_helpers_address =
243 T::CrossAccountId::from_eth(<T as pallet_common::Config>::ContractAddress::get());
244
245 let collection_id = T::CollectionDispatch::create(caller, collection_helpers_address, data)
246 .map_err(dispatch_to_evm::<T>)?;
247
248 let address = pallet_common::eth::collection_id_to_address(collection_id);
249 Ok(address)
250 }
251*/
252
144 /// Create an NFT collection253 /// Create an NFT collection
145 /// @param name Name of the collection254 /// @param name Name of the collection
171 let collection_id = T::CollectionDispatch::create(280 let collection_id = T::CollectionDispatch::create(caller, collection_helpers_address, data)
172 caller,
173 collection_helpers_address,
174 data,
175 Default::default(),
176 )
177 .map_err(dispatch_to_evm::<T>)?;281 .map_err(dispatch_to_evm::<T>)?;
178282
387pub struct CollectionHelpersOnMethodCall<T: Config>(PhantomData<*const T>);491pub struct CollectionHelpersOnMethodCall<T: Config>(PhantomData<*const T>);
388impl<T: Config + pallet_nonfungible::Config + pallet_refungible::Config> OnMethodCall<T>492impl<T: Config + pallet_nonfungible::Config + pallet_refungible::Config> OnMethodCall<T>
389 for CollectionHelpersOnMethodCall<T>493 for CollectionHelpersOnMethodCall<T>
494where
495 T::AccountId: From<[u8; 32]>,
390{496{
391 fn is_reserved(contract: &sp_core::H160) -> bool {497 fn is_reserved(contract: &sp_core::H160) -> bool {
392 contract == &T::ContractAddress::get()498 contract == &T::ContractAddress::get()
modifiedpallets/unique/src/eth/stubs/CollectionHelpers.rawdiffbeforeafterboth

binary blob — no preview

modifiedpallets/unique/src/eth/stubs/CollectionHelpers.soldiffbeforeafterboth
25}25}
2626
27/// @title Contract, which allows users to operate with collections27/// @title Contract, which allows users to operate with collections
28/// @dev the ERC-165 identifier for this interface is 0xe65011aa28/// @dev the ERC-165 identifier for this interface is 0x4135fff1
29contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents {29contract CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents {
30 /// Create a collection
31 /// @return address Address of the newly created collection
32 /// @dev EVM selector for this function is: 0xa765ee5b,
33 /// or in textual repr: createCollection(((address,uint256),string,string,string,uint8,uint8,(string,bytes)[],(string,(uint8,bool)[])[],(address,uint256)[],(bool,bool,address[]),(uint8,uint256)[],uint8))
34 function createCollection(CreateCollectionData memory data) public payable returns (address) {
35 require(false, stub_error);
36 data;
37 dummy = 0;
38 return 0x0000000000000000000000000000000000000000;
39 }
40
30 /// Create an NFT collection41 /// Create an NFT collection
31 /// @param name Name of the collection42 /// @param name Name of the collection
157 }168 }
158}169}
170
171/// Collection properties
172struct CreateCollectionData {
173 /// Collection sponsor
174 CrossAddress pending_sponsor;
175 /// Collection name
176 string name;
177 /// Collection description
178 string description;
179 /// Token prefix
180 string token_prefix;
181 /// Token type (NFT, FT or RFT)
182 CollectionMode mode;
183 /// Fungible token precision
184 uint8 decimals;
185 /// Custom Properties
186 Property[] properties;
187 /// Permissions for token properties
188 TokenPropertyPermission[] token_property_permissions;
189 /// Collection admins
190 CrossAddress[] admin_list;
191 /// Nesting settings
192 CollectionNestingAndPermission nesting_settings;
193 /// Collection limits
194 CollectionLimitValue[] limits;
195 /// Extra collection flags
196 CollectionFlags flags;
197}
198
199/// Cross account struct
200type CollectionFlags is uint8;
201
202library CollectionFlagsLib {
203 /// Tokens in foreign collections can be transferred, but not burnt
204 CollectionFlags constant foreignField = CollectionFlags.wrap(128);
205 /// Supports ERC721Metadata
206 CollectionFlags constant erc721metadataField = CollectionFlags.wrap(64);
207 /// External collections can't be managed using `unique` api
208 CollectionFlags constant externalField = CollectionFlags.wrap(1);
209
210 /// Reserved bits
211 function reservedField(uint8 value) public pure returns (CollectionFlags) {
212 require(value < 1 << 5, "out of bound value");
213 return CollectionFlags.wrap(value << 1);
214 }
215}
216
217/// [`CollectionLimits`](up_data_structs::CollectionLimits) field representation for EVM.
218struct CollectionLimitValue {
219 CollectionLimitField field;
220 uint256 value;
221}
222
223/// [`CollectionLimits`](up_data_structs::CollectionLimits) fields representation for EVM.
224enum CollectionLimitField {
225 /// How many tokens can a user have on one account.
226 AccountTokenOwnership,
227 /// How many bytes of data are available for sponsorship.
228 SponsoredDataSize,
229 /// In any case, chain default: [`SponsoringRateLimit::SponsoringDisabled`]
230 SponsoredDataRateLimit,
231 /// How many tokens can be mined into this collection.
232 TokenLimit,
233 /// Timeouts for transfer sponsoring.
234 SponsorTransferTimeout,
235 /// Timeout for sponsoring an approval in passed blocks.
236 SponsorApproveTimeout,
237 /// Whether the collection owner of the collection can send tokens (which belong to other users).
238 OwnerCanTransfer,
239 /// Can the collection owner burn other people's tokens.
240 OwnerCanDestroy,
241 /// Is it possible to send tokens from this collection between users.
242 TransferEnabled
243}
244
245/// Nested collections and permissions
246struct CollectionNestingAndPermission {
247 /// Owner of token can nest tokens under it.
248 bool token_owner;
249 /// Admin of token collection can nest tokens under token.
250 bool collection_admin;
251 /// If set - only tokens from specified collections can be nested.
252 address[] restricted;
253}
254
255/// Cross account struct
256struct CrossAddress {
257 address eth;
258 uint256 sub;
259}
260
261/// Ethereum representation of Token Property Permissions.
262struct TokenPropertyPermission {
263 /// Token property key.
264 string key;
265 /// Token property permissions.
266 PropertyPermission[] permissions;
267}
268
269/// Ethereum representation of TokenPermissions (see [`up_data_structs::PropertyPermission`]) as an key and value.
270struct PropertyPermission {
271 /// TokenPermission field.
272 TokenPermissionField code;
273 /// TokenPermission value.
274 bool value;
275}
276
277/// Ethereum representation of TokenPermissions (see [`up_data_structs::PropertyPermission`]) fields as an enumeration.
278enum TokenPermissionField {
279 /// Permission to change the property and property permission. See [`up_data_structs::PropertyPermission::mutable`]
280 Mutable,
281 /// Change permission for the collection administrator. See [`up_data_structs::PropertyPermission::token_owner`]
282 TokenOwner,
283 /// Permission to change the property for the owner of the token. See [`up_data_structs::PropertyPermission::collection_admin`]
284 CollectionAdmin
285}
286
287/// Ethereum representation of collection [`PropertyKey`](up_data_structs::PropertyKey) and [`PropertyValue`](up_data_structs::PropertyValue).
288struct Property {
289 string key;
290 bytes value;
291}
292
293/// Type of tokens in collection
294enum CollectionMode {
295 /// Fungible
296 Fungible,
297 /// Nonfungible
298 Nonfungible,
299 /// Refungible
300 Refungible
301}
159302
modifiedpallets/unique/src/lib.rsdiffbeforeafterboth
365 token_prefix: BoundedVec<u8, ConstU32<MAX_TOKEN_PREFIX_LENGTH>>,365 token_prefix: BoundedVec<u8, ConstU32<MAX_TOKEN_PREFIX_LENGTH>>,
366 mode: CollectionMode,366 mode: CollectionMode,
367 ) -> DispatchResult {367 ) -> DispatchResult {
368 let data: CreateCollectionData<T::AccountId> = CreateCollectionData {368 let data: CreateCollectionData<T::CrossAccountId> = CreateCollectionData {
369 name: collection_name,369 name: collection_name,
370 description: collection_description,370 description: collection_description,
371 token_prefix,371 token_prefix,
390 #[pallet::weight(<SelfWeightOf<T>>::create_collection())]390 #[pallet::weight(<SelfWeightOf<T>>::create_collection())]
391 pub fn create_collection_ex(391 pub fn create_collection_ex(
392 origin: OriginFor<T>,392 origin: OriginFor<T>,
393 data: CreateCollectionData<T::AccountId>,393 data: CreateCollectionData<T::CrossAccountId>,
394 ) -> DispatchResult {394 ) -> DispatchResult {
395 let sender = ensure_signed(origin)?;395 let sender = ensure_signed(origin)?;
396396
397 // =========397 // =========
398 let sender = T::CrossAccountId::from_sub(sender);398 let sender = T::CrossAccountId::from_sub(sender);
399 let _id =399 let _id = T::CollectionDispatch::create(sender.clone(), sender, data)?;
400 T::CollectionDispatch::create(sender.clone(), sender, data, Default::default())?;
401400
402 Ok(())401 Ok(())
403 }402 }
modifiedprimitives/data-structs/Cargo.tomldiffbeforeafterboth
22sp-std = { workspace = true }22sp-std = { workspace = true }
23bondrewd = { version = "0.1.14", features = ["derive"], default-features = false }23bondrewd = { version = "0.1.14", features = ["derive"], default-features = false }
24struct-versioning = { workspace = true }24struct-versioning = { workspace = true }
25evm-coder = { workspace = true }
2526
26[features]27[features]
27default = ["std"]28default = ["std"]
modifiedprimitives/data-structs/src/lib.rsdiffbeforeafterboth
3232
33use sp_core::U256;33use sp_core::U256;
34use sp_runtime::{ArithmeticError, sp_std::prelude::Vec};34use sp_runtime::{ArithmeticError, sp_std::prelude::Vec};
35use sp_std::collections::btree_set::BTreeSet;
35use codec::{Decode, Encode, EncodeLike, MaxEncodedLen};36use codec::{Decode, Encode, EncodeLike, MaxEncodedLen};
36use bondrewd::Bitfields;
37use frame_support::{BoundedVec, traits::ConstU32};37use frame_support::{BoundedVec, traits::ConstU32};
38use derivative::Derivative;38use derivative::Derivative;
39use scale_info::TypeInfo;39use scale_info::TypeInfo;
40use evm_coder::AbiCoderFlags;
41use bondrewd::Bitfields;
4042
41mod bondrewd_codec;43mod bondrewd_codec;
42mod bounded;44mod bounded;
163 }165 }
164}166}
167
168impl Deref for CollectionId {
169 type Target = u32;
170
171 fn deref(&self) -> &Self::Target {
172 &self.0
173 }
174}
165175
166/// Token id.176/// Token id.
167#[derive(177#[derive(
350pub type CollectionDescription = BoundedVec<u16, ConstU32<MAX_COLLECTION_DESCRIPTION_LENGTH>>;360pub type CollectionDescription = BoundedVec<u16, ConstU32<MAX_COLLECTION_DESCRIPTION_LENGTH>>;
351pub type CollectionTokenPrefix = BoundedVec<u8, ConstU32<MAX_TOKEN_PREFIX_LENGTH>>;361pub type CollectionTokenPrefix = BoundedVec<u8, ConstU32<MAX_TOKEN_PREFIX_LENGTH>>;
352362
353#[derive(Bitfields, Clone, Copy, PartialEq, Eq, Debug, Default)]363#[derive(AbiCoderFlags, Bitfields, Clone, Copy, PartialEq, Eq, Debug, Default)]
354#[bondrewd(enforce_bytes = 1)]364#[bondrewd(enforce_bytes = 1)]
355pub struct CollectionFlags {365pub struct CollectionFlags {
356 /// Tokens in foreign collections can be transferred, but not burnt366 /// Tokens in foreign collections can be transferred, but not burnt
362 /// External collections can't be managed using `unique` api372 /// External collections can't be managed using `unique` api
363 #[bondrewd(bits = "7..8")]373 #[bondrewd(bits = "7..8")]
364 pub external: bool,374 pub external: bool,
365375 /// Reserved flags
366 #[bondrewd(reserve, bits = "2..7")]376 #[bondrewd(bits = "2..7")]
367 pub reserved: u8,377 pub reserved: u8,
368}378}
369bondrewd_codec!(CollectionFlags);379bondrewd_codec!(CollectionFlags);
380
381impl CollectionFlags {
382 pub fn is_allowed_for_user(self) -> bool {
383 !self.foreign && !self.external && self.reserved == 0
384 }
385}
370386
371/// Base structure for represent collection.387/// Base structure for represent collection.
372///388///
545/// All fields are wrapped in [`Option`], where `None` means chain default.561/// All fields are wrapped in [`Option`], where `None` means chain default.
546#[derive(Encode, Decode, Clone, PartialEq, TypeInfo, Derivative, MaxEncodedLen)]562#[derive(Encode, Decode, Clone, PartialEq, TypeInfo, Derivative, MaxEncodedLen)]
547#[derivative(Debug, Default(bound = ""))]563#[derivative(Debug, Default(bound = ""))]
548pub struct CreateCollectionData<AccountId> {564pub struct CreateCollectionData<CrossAccountId> {
549 /// Collection mode.565 /// Collection mode.
550 #[derivative(Default(value = "CollectionMode::NFT"))]566 #[derivative(Default(value = "CollectionMode::NFT"))]
551 pub mode: CollectionMode,567 pub mode: CollectionMode,
562 /// Token prefix.578 /// Token prefix.
563 pub token_prefix: CollectionTokenPrefix,579 pub token_prefix: CollectionTokenPrefix,
564
565 /// Pending collection sponsor.
566 pub pending_sponsor: Option<AccountId>,
567580
568 /// Collection limits.581 /// Collection limits.
569 pub limits: Option<CollectionLimits>,582 pub limits: Option<CollectionLimits>,
577 /// Collection properties.590 /// Collection properties.
578 pub properties: CollectionPropertiesVec,591 pub properties: CollectionPropertiesVec,
592
593 pub admin_list: Vec<CrossAccountId>,
594
595 /// Pending collection sponsor.
596 pub pending_sponsor: Option<CrossAccountId>,
597
598 pub flags: CollectionFlags,
579}599}
580600
581/// Bounded vector of properties permissions. Max length is [`MAX_PROPERTIES_PER_ITEM`].601/// Bounded vector of properties permissions. Max length is [`MAX_PROPERTIES_PER_ITEM`].
833 }853 }
834}854}
855
856impl TryFrom<BTreeSet<CollectionId>> for OwnerRestrictedSet {
857 type Error = ();
858
859 fn try_from(value: BTreeSet<CollectionId>) -> Result<Self, Self::Error> {
860 Ok(Self(value.try_into()?))
861 }
862}
835863
836/// Part of collection permissions, if set, defines who is able to nest tokens into other tokens.864/// Part of collection permissions, if set, defines who is able to nest tokens into other tokens.
837#[derive(Encode, Decode, Clone, PartialEq, TypeInfo, MaxEncodedLen, Derivative)]865#[derive(Encode, Decode, Clone, PartialEq, TypeInfo, MaxEncodedLen, Derivative)]
modifiedruntime/common/dispatch.rsdiffbeforeafterboth
25};25};
26pub use pallet_common::dispatch::CollectionDispatch;26pub use pallet_common::dispatch::CollectionDispatch;
27use pallet_fungible::{Pallet as PalletFungible, FungibleHandle};27use pallet_fungible::{Pallet as PalletFungible, FungibleHandle};
28use pallet_balances_adapter::{NativeFungibleHandle};28use pallet_balances_adapter::NativeFungibleHandle;
29use pallet_nonfungible::{Pallet as PalletNonfungible, NonfungibleHandle};29use pallet_nonfungible::{Pallet as PalletNonfungible, NonfungibleHandle};
30use pallet_refungible::{30use pallet_refungible::{
31 Pallet as PalletRefungible, RefungibleHandle, erc_token::RefungibleTokenHandle,31 Pallet as PalletRefungible, RefungibleHandle, erc_token::RefungibleTokenHandle,
32};32};
33use up_data_structs::{33use up_data_structs::{
34 CollectionMode, CreateCollectionData, MAX_DECIMAL_POINTS, mapping::TokenAddressMapping,34 CollectionMode, CreateCollectionData, MAX_DECIMAL_POINTS, mapping::TokenAddressMapping,
35 CollectionId, CollectionFlags,35 CollectionId,
36};36};
3737
38#[cfg(not(feature = "refungible"))]38#[cfg(not(feature = "refungible"))]
72 fn create(72 fn create(
73 sender: T::CrossAccountId,73 sender: T::CrossAccountId,
74 payer: T::CrossAccountId,74 payer: T::CrossAccountId,
75 data: CreateCollectionData<T::AccountId>,75 data: CreateCollectionData<T::CrossAccountId>,
76 flags: CollectionFlags,
77 ) -> Result<CollectionId, DispatchError> {76 ) -> Result<CollectionId, DispatchError> {
78 let id = match data.mode {77 let id = match data.mode {
79 CollectionMode::NFT => {78 CollectionMode::NFT => <PalletNonfungible<T>>::init_collection(sender, payer, data)?,
80 <PalletNonfungible<T>>::init_collection(sender, payer, data, flags)?
81 }
82 CollectionMode::Fungible(decimal_points) => {79 CollectionMode::Fungible(decimal_points) => {
83 // check params80 // check params
84 ensure!(81 ensure!(
85 decimal_points <= MAX_DECIMAL_POINTS,82 decimal_points <= MAX_DECIMAL_POINTS,
86 pallet_unique::Error::<T>::CollectionDecimalPointLimitExceeded83 pallet_unique::Error::<T>::CollectionDecimalPointLimitExceeded
87 );84 );
88 <PalletFungible<T>>::init_collection(sender, payer, data, flags)?85 <PalletFungible<T>>::init_collection(sender, payer, data)?
89 }86 }
9087
91 #[cfg(feature = "refungible")]88 #[cfg(feature = "refungible")]
92 CollectionMode::ReFungible => {89 CollectionMode::ReFungible => <PalletRefungible<T>>::init_collection(sender, payer, data)?,
93 <PalletRefungible<T>>::init_collection(sender, payer, data, flags)?
94 }
9590
96 #[cfg(not(feature = "refungible"))]91 #[cfg(not(feature = "refungible"))]
97 CollectionMode::ReFungible => return unsupported!(T),92 CollectionMode::ReFungible => return unsupported!(T),
modifiedruntime/common/ethereum/sponsoring.rsdiffbeforeafterboth
234 | CollectionOwner234 | CollectionOwner
235 | CollectionAdmins235 | CollectionAdmins
236 | CollectionLimits236 | CollectionLimits
237 | CollectionNesting
237 | CollectionNestingRestrictedIds238 | CollectionNestingRestrictedIds
238 | CollectionNestingPermissions239 | CollectionNestingPermissions
239 | UniqueCollectionType => None,240 | UniqueCollectionType => None,
249 | RemoveCollectionAdmin { .. }250 | RemoveCollectionAdmin { .. }
250 | SetNestingBool { .. }251 | SetNestingBool { .. }
251 | SetNesting { .. }252 | SetNesting { .. }
253 | SetNestingCollectionIds { .. }
252 | SetCollectionAccess { .. }254 | SetCollectionAccess { .. }
253 | SetCollectionMintMode { .. }255 | SetCollectionMintMode { .. }
254 | SetOwner { .. }256 | SetOwner { .. }
modifiedtests/src/benchmarks/opsFee/index.tsdiffbeforeafterboth
1import {EthUniqueHelper, usingEthPlaygrounds} from '../../eth/util';1import {EthUniqueHelper, usingEthPlaygrounds} from '../../eth/util';
2import {readFile} from 'fs/promises';2import {readFile} from 'fs/promises';
3import {CollectionLimitField, TokenPermissionField} from '../../eth/util/playgrounds/types';3import {CollectionLimitField, CreateCollectionData, TokenPermissionField} from '../../eth/util/playgrounds/types';
4import {IKeyringPair} from '@polkadot/types/types';4import {IKeyringPair} from '@polkadot/types/types';
5import {UniqueFTCollection, UniqueNFTCollection} from '../../util/playgrounds/unique';5import {UniqueFTCollection, UniqueNFTCollection} from '../../util/playgrounds/unique';
6import {Contract} from 'web3-eth-contract';6import {Contract} from 'web3-eth-contract';
399 () => collection.setLimits(donor, {accountTokenOwnershipLimit: 1000}),399 () => collection.setLimits(donor, {accountTokenOwnershipLimit: 1000}),
400 )));400 )));
401401
402 const {collectionAddress} = await helper.eth.createCollection('nft', ethSigner, 'A', 'B', 'C');402 const {collectionAddress} = await helper.eth.createCollection(ethSigner, new CreateCollectionData('A', 'B', 'C', 'nft')).send();
403 const collectionWithEthOwner = await helper.ethNativeContract.collection(collectionAddress, 'nft', ethSigner, true);403 const collectionWithEthOwner = await helper.ethNativeContract.collection(collectionAddress, 'nft', ethSigner, true);
404404
405405
775 () => collection.setLimits(donor, {accountTokenOwnershipLimit: 1000}),775 () => collection.setLimits(donor, {accountTokenOwnershipLimit: 1000}),
776 )));776 )));
777777
778 const {collectionAddress} = await helper.eth.createCollection('nft', ethSigner, 'A', 'B', 'C');778 const {collectionAddress} = await helper.eth.createCollection(ethSigner, new CreateCollectionData('A', 'B', 'C', 'nft')).send();
779 const collectionWithEthOwner = await helper.ethNativeContract.collection(collectionAddress, 'nft', ethSigner, true);779 const collectionWithEthOwner = await helper.ethNativeContract.collection(collectionAddress, 'nft', ethSigner, true);
780780
781781
modifiedtests/src/createCollection.test.tsdiffbeforeafterboth
1616
17import {IKeyringPair} from '@polkadot/types/types';17import {IKeyringPair} from '@polkadot/types/types';
18import {usingPlaygrounds, expect, itSub, Pallets} from './util';18import {usingPlaygrounds, expect, itSub, Pallets} from './util';
19import {ICollectionCreationOptions, IProperty} from './util/playgrounds/types';19import {CollectionFlag, ICollectionCreationOptions, IProperty} from './util/playgrounds/types';
20import {UniqueHelper} from './util/playgrounds/unique';20import {UniqueHelper} from './util/playgrounds/unique';
2121
22async function mintCollectionHelper(helper: UniqueHelper, signer: IKeyringPair, options: ICollectionCreationOptions, type?: 'nft' | 'fungible' | 'refungible') {22async function mintCollectionHelper(helper: UniqueHelper, signer: IKeyringPair, options: ICollectionCreationOptions, type?: 'nft' | 'fungible' | 'refungible') {
36 if(options.properties) {36 if(options.properties) {
37 expect(data?.raw.properties).to.be.deep.equal(options.properties);37 expect(data?.raw.properties).to.be.deep.equal(options.properties);
38 }38 }
39 if(options.adminList) {
40 expect(data?.admins).to.be.deep.equal(options.adminList);
41 }
42
43 if(options.flags) {
44 if((options.flags[0] & 64) != 0)
45 expect(data?.raw.flags.erc721metadata).to.be.true;
46 if((options.flags[0] & 128) != 0)
47 expect(data?.raw.flags.foreign).to.be.false;
48 }
3949
40 if(options.tokenPropertyPermissions) {50 if(options.tokenPropertyPermissions) {
41 expect(data?.raw.tokenPropertyPermissions).to.be.deep.equal(options.tokenPropertyPermissions);51 expect(data?.raw.tokenPropertyPermissions).to.be.deep.equal(options.tokenPropertyPermissions);
4656
47describe('integration test: ext. createCollection():', () => {57describe('integration test: ext. createCollection():', () => {
48 let alice: IKeyringPair;58 let alice: IKeyringPair;
59 let bob: IKeyringPair;
4960
50 before(async () => {61 before(async () => {
51 await usingPlaygrounds(async (helper, privateKey) => {62 await usingPlaygrounds(async (helper, privateKey) => {
52 const donor = await privateKey({url: import.meta.url});63 const donor = await privateKey({url: import.meta.url});
53 [alice] = await helper.arrange.createAccounts([100n], donor);64 [alice, bob] = await helper.arrange.createAccounts([100n, 100n], donor);
54 });65 });
55 });66 });
56 itSub('Create new NFT collection', async ({helper}) => {67 itSub('Create new NFT collection', async ({helper}) => {
82 }, 'nft');93 }, 'nft');
83 });94 });
95
96 itSub('create new collection with admin', async ({helper}) => {
97 await mintCollectionHelper(helper, alice, {
98 name: 'name', description: 'descr', tokenPrefix: 'COL',
99 adminList: [{Substrate: bob.address}],
100 }, 'nft');
101 });
102
103 itSub('create new collection with flags', async ({helper}) => {
104 await mintCollectionHelper(helper, alice, {
105 name: 'name', description: 'descr', tokenPrefix: 'COL',
106 flags: [CollectionFlag.Erc721metadata],
107 }, 'nft');
108
109 await mintCollectionHelper(helper, alice, {
110 name: 'name', description: 'descr', tokenPrefix: 'COL',
111 flags: [CollectionFlag.Foreign],
112 }, 'nft');
113
114 await mintCollectionHelper(helper, alice, {
115 name: 'name', description: 'descr', tokenPrefix: 'COL',
116 flags: [CollectionFlag.Erc721metadata, CollectionFlag.Foreign],
117 }, 'nft');
118 });
84119
85 itSub('Create new collection with extra fields', async ({helper}) => {120 itSub('Create new collection with extra fields', async ({helper}) => {
86 const collection = await mintCollectionHelper(helper, alice, {name: 'name', description: 'descr', tokenPrefix: 'COL'}, 'fungible');121 const collection = await mintCollectionHelper(helper, alice, {name: 'name', description: 'descr', tokenPrefix: 'COL'}, 'fungible');
modifiedtests/src/eth/abi/collectionHelpers.jsondiffbeforeafterboth
73 "stateMutability": "view",73 "stateMutability": "view",
74 "type": "function"74 "type": "function"
75 },75 },
76 {
77 "inputs": [
78 {
79 "components": [
80 {
81 "components": [
82 { "internalType": "address", "name": "eth", "type": "address" },
83 { "internalType": "uint256", "name": "sub", "type": "uint256" }
84 ],
85 "internalType": "struct CrossAddress",
86 "name": "pending_sponsor",
87 "type": "tuple"
88 },
89 { "internalType": "string", "name": "name", "type": "string" },
90 { "internalType": "string", "name": "description", "type": "string" },
91 {
92 "internalType": "string",
93 "name": "token_prefix",
94 "type": "string"
95 },
96 {
97 "internalType": "enum CollectionMode",
98 "name": "mode",
99 "type": "uint8"
100 },
101 { "internalType": "uint8", "name": "decimals", "type": "uint8" },
102 {
103 "components": [
104 { "internalType": "string", "name": "key", "type": "string" },
105 { "internalType": "bytes", "name": "value", "type": "bytes" }
106 ],
107 "internalType": "struct Property[]",
108 "name": "properties",
109 "type": "tuple[]"
110 },
111 {
112 "components": [
113 { "internalType": "string", "name": "key", "type": "string" },
114 {
115 "components": [
116 {
117 "internalType": "enum TokenPermissionField",
118 "name": "code",
119 "type": "uint8"
120 },
121 { "internalType": "bool", "name": "value", "type": "bool" }
122 ],
123 "internalType": "struct PropertyPermission[]",
124 "name": "permissions",
125 "type": "tuple[]"
126 }
127 ],
128 "internalType": "struct TokenPropertyPermission[]",
129 "name": "token_property_permissions",
130 "type": "tuple[]"
131 },
132 {
133 "components": [
134 { "internalType": "address", "name": "eth", "type": "address" },
135 { "internalType": "uint256", "name": "sub", "type": "uint256" }
136 ],
137 "internalType": "struct CrossAddress[]",
138 "name": "admin_list",
139 "type": "tuple[]"
140 },
141 {
142 "components": [
143 { "internalType": "bool", "name": "token_owner", "type": "bool" },
144 {
145 "internalType": "bool",
146 "name": "collection_admin",
147 "type": "bool"
148 },
149 {
150 "internalType": "address[]",
151 "name": "restricted",
152 "type": "address[]"
153 }
154 ],
155 "internalType": "struct CollectionNestingAndPermission",
156 "name": "nesting_settings",
157 "type": "tuple"
158 },
159 {
160 "components": [
161 {
162 "internalType": "enum CollectionLimitField",
163 "name": "field",
164 "type": "uint8"
165 },
166 { "internalType": "uint256", "name": "value", "type": "uint256" }
167 ],
168 "internalType": "struct CollectionLimitValue[]",
169 "name": "limits",
170 "type": "tuple[]"
171 },
172 {
173 "internalType": "CollectionFlags",
174 "name": "flags",
175 "type": "uint8"
176 }
177 ],
178 "internalType": "struct CreateCollectionData",
179 "name": "data",
180 "type": "tuple"
181 }
182 ],
183 "name": "createCollection",
184 "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
185 "stateMutability": "payable",
186 "type": "function"
187 },
76 {188 {
77 "inputs": [189 "inputs": [
78 { "internalType": "string", "name": "name", "type": "string" },190 { "internalType": "string", "name": "name", "type": "string" },
modifiedtests/src/eth/abi/fungible.jsondiffbeforeafterboth
278 "stateMutability": "view",278 "stateMutability": "view",
279 "type": "function"279 "type": "function"
280 },280 },
281 {
282 "inputs": [],
283 "name": "collectionNestingPermissions",
284 "outputs": [
285 {
286 "components": [
287 {
288 "internalType": "enum CollectionPermissionField",
289 "name": "field",
290 "type": "uint8"
291 },
292 { "internalType": "bool", "name": "value", "type": "bool" }
293 ],
294 "internalType": "struct CollectionNestingPermission[]",
295 "name": "",
296 "type": "tuple[]"
297 }
298 ],
299 "stateMutability": "view",
300 "type": "function"
301 },
302 {281 {
303 "inputs": [],282 "inputs": [],
304 "name": "collectionNestingRestrictedCollectionIds",283 "name": "collectionNesting",
305 "outputs": [284 "outputs": [
306 {285 {
307 "components": [286 "components": [
308 { "internalType": "bool", "name": "token_owner", "type": "bool" },287 { "internalType": "bool", "name": "token_owner", "type": "bool" },
288 {
289 "internalType": "bool",
290 "name": "collection_admin",
291 "type": "bool"
292 },
309 { "internalType": "uint256[]", "name": "ids", "type": "uint256[]" }293 {
294 "internalType": "address[]",
295 "name": "restricted",
296 "type": "address[]"
297 }
310 ],298 ],
311 "internalType": "struct CollectionNesting",299 "internalType": "struct CollectionNestingAndPermission",
312 "name": "",300 "name": "",
313 "type": "tuple"301 "type": "tuple"
314 }302 }
575 "stateMutability": "nonpayable",563 "stateMutability": "nonpayable",
576 "type": "function"564 "type": "function"
577 },565 },
578 {566 {
579 "inputs": [{ "internalType": "bool", "name": "enable", "type": "bool" }],
580 "name": "setCollectionNesting",
581 "outputs": [],567 "inputs": [
568 {
569 "components": [
582 "stateMutability": "nonpayable",570 { "internalType": "bool", "name": "token_owner", "type": "bool" },
583 "type": "function"
584 },
585 {
586 "inputs": [
587 { "internalType": "bool", "name": "enable", "type": "bool" },571 {
572 "internalType": "bool",
573 "name": "collection_admin",
574 "type": "bool"
575 },
588 {576 {
589 "internalType": "address[]",577 "internalType": "address[]",
590 "name": "collections",578 "name": "restricted",
591 "type": "address[]"579 "type": "address[]"
592 }580 }
581 ],
582 "internalType": "struct CollectionNestingAndPermission",
583 "name": "collectionNestingAndPermissions",
584 "type": "tuple"
585 }
593 ],586 ],
594 "name": "setCollectionNesting",587 "name": "setCollectionNesting",
595 "outputs": [],588 "outputs": [],
596 "stateMutability": "nonpayable",589 "stateMutability": "nonpayable",
597 "type": "function"590 "type": "function"
598 },591 },
599 {592 {
600 "inputs": [593 "inputs": [
601 {594 {
modifiedtests/src/eth/abi/fungibleDeprecated.jsondiffbeforeafterboth
88 "outputs": [],88 "outputs": [],
89 "stateMutability": "nonpayable",89 "stateMutability": "nonpayable",
90 "type": "function"90 "type": "function"
91 }91 },
92 {
93 "inputs": [],
94 "name": "collectionNestingPermissions",
95 "outputs": [
96 {
97 "components": [
98 {
99 "internalType": "enum CollectionPermissionField",
100 "name": "field",
101 "type": "uint8"
102 },
103 { "internalType": "bool", "name": "value", "type": "bool" }
104 ],
105 "internalType": "struct CollectionNestingPermission[]",
106 "name": "",
107 "type": "tuple[]"
108 }
109 ],
110 "stateMutability": "view",
111 "type": "function"
112 },
113 {
114 "inputs": [],
115 "name": "collectionNestingRestrictedCollectionIds",
116 "outputs": [
117 {
118 "components": [
119 { "internalType": "bool", "name": "token_owner", "type": "bool" },
120 { "internalType": "uint256[]", "name": "ids", "type": "uint256[]" }
121 ],
122 "internalType": "struct CollectionNesting",
123 "name": "",
124 "type": "tuple"
125 }
126 ],
127 "stateMutability": "view",
128 "type": "function"
129 },
130 {
131 "inputs": [{ "internalType": "bool", "name": "enable", "type": "bool" }],
132 "name": "setCollectionNesting",
133 "outputs": [],
134 "stateMutability": "nonpayable",
135 "type": "function"
136 },
137 {
138 "inputs": [
139 { "internalType": "bool", "name": "enable", "type": "bool" },
140 {
141 "internalType": "address[]",
142 "name": "collections",
143 "type": "address[]"
144 }
145 ],
146 "name": "setCollectionNesting",
147 "outputs": [],
148 "stateMutability": "nonpayable",
149 "type": "function"
150 }
92]151]
93152
modifiedtests/src/eth/abi/nonFungible.jsondiffbeforeafterboth
289 "stateMutability": "view",289 "stateMutability": "view",
290 "type": "function"290 "type": "function"
291 },291 },
292 {
293 "inputs": [],
294 "name": "collectionNestingPermissions",
295 "outputs": [
296 {
297 "components": [
298 {
299 "internalType": "enum CollectionPermissionField",
300 "name": "field",
301 "type": "uint8"
302 },
303 { "internalType": "bool", "name": "value", "type": "bool" }
304 ],
305 "internalType": "struct CollectionNestingPermission[]",
306 "name": "",
307 "type": "tuple[]"
308 }
309 ],
310 "stateMutability": "view",
311 "type": "function"
312 },
313 {292 {
314 "inputs": [],293 "inputs": [],
315 "name": "collectionNestingRestrictedCollectionIds",294 "name": "collectionNesting",
316 "outputs": [295 "outputs": [
317 {296 {
318 "components": [297 "components": [
319 { "internalType": "bool", "name": "token_owner", "type": "bool" },298 { "internalType": "bool", "name": "token_owner", "type": "bool" },
299 {
300 "internalType": "bool",
301 "name": "collection_admin",
302 "type": "bool"
303 },
320 { "internalType": "uint256[]", "name": "ids", "type": "uint256[]" }304 {
305 "internalType": "address[]",
306 "name": "restricted",
307 "type": "address[]"
308 }
321 ],309 ],
322 "internalType": "struct CollectionNesting",310 "internalType": "struct CollectionNestingAndPermission",
323 "name": "",311 "name": "",
324 "type": "tuple"312 "type": "tuple"
325 }313 }
704 "stateMutability": "nonpayable",692 "stateMutability": "nonpayable",
705 "type": "function"693 "type": "function"
706 },694 },
707 {695 {
708 "inputs": [{ "internalType": "bool", "name": "enable", "type": "bool" }],
709 "name": "setCollectionNesting",
710 "outputs": [],696 "inputs": [
697 {
698 "components": [
711 "stateMutability": "nonpayable",699 { "internalType": "bool", "name": "token_owner", "type": "bool" },
712 "type": "function"
713 },
714 {
715 "inputs": [
716 { "internalType": "bool", "name": "enable", "type": "bool" },700 {
701 "internalType": "bool",
702 "name": "collection_admin",
703 "type": "bool"
704 },
717 {705 {
718 "internalType": "address[]",706 "internalType": "address[]",
719 "name": "collections",707 "name": "restricted",
720 "type": "address[]"708 "type": "address[]"
721 }709 }
710 ],
711 "internalType": "struct CollectionNestingAndPermission",
712 "name": "collectionNestingAndPermissions",
713 "type": "tuple"
714 }
722 ],715 ],
723 "name": "setCollectionNesting",716 "name": "setCollectionNesting",
724 "outputs": [],717 "outputs": [],
725 "stateMutability": "nonpayable",718 "stateMutability": "nonpayable",
726 "type": "function"719 "type": "function"
727 },720 },
728 {721 {
729 "inputs": [722 "inputs": [
730 {723 {
modifiedtests/src/eth/abi/nonFungibleDeprecated.jsondiffbeforeafterboth
109 "outputs": [],109 "outputs": [],
110 "stateMutability": "nonpayable",110 "stateMutability": "nonpayable",
111 "type": "function"111 "type": "function"
112 }112 },
113 {
114 "inputs": [],
115 "name": "collectionNestingPermissions",
116 "outputs": [
117 {
118 "components": [
119 {
120 "internalType": "enum CollectionPermissionField",
121 "name": "field",
122 "type": "uint8"
123 },
124 { "internalType": "bool", "name": "value", "type": "bool" }
125 ],
126 "internalType": "struct CollectionNestingPermission[]",
127 "name": "",
128 "type": "tuple[]"
129 }
130 ],
131 "stateMutability": "view",
132 "type": "function"
133 },
134 {
135 "inputs": [],
136 "name": "collectionNestingRestrictedCollectionIds",
137 "outputs": [
138 {
139 "components": [
140 { "internalType": "bool", "name": "token_owner", "type": "bool" },
141 { "internalType": "uint256[]", "name": "ids", "type": "uint256[]" }
142 ],
143 "internalType": "struct CollectionNesting",
144 "name": "",
145 "type": "tuple"
146 }
147 ],
148 "stateMutability": "view",
149 "type": "function"
150 },
151 {
152 "inputs": [{ "internalType": "bool", "name": "enable", "type": "bool" }],
153 "name": "setCollectionNesting",
154 "outputs": [],
155 "stateMutability": "nonpayable",
156 "type": "function"
157 },
158 {
159 "inputs": [
160 { "internalType": "bool", "name": "enable", "type": "bool" },
161 {
162 "internalType": "address[]",
163 "name": "collections",
164 "type": "address[]"
165 }
166 ],
167 "name": "setCollectionNesting",
168 "outputs": [],
169 "stateMutability": "nonpayable",
170 "type": "function"
171 }
113]172]
114173
modifiedtests/src/eth/abi/reFungible.jsondiffbeforeafterboth
271 "stateMutability": "view",271 "stateMutability": "view",
272 "type": "function"272 "type": "function"
273 },273 },
274 {
275 "inputs": [],
276 "name": "collectionNestingPermissions",
277 "outputs": [
278 {
279 "components": [
280 {
281 "internalType": "enum CollectionPermissionField",
282 "name": "field",
283 "type": "uint8"
284 },
285 { "internalType": "bool", "name": "value", "type": "bool" }
286 ],
287 "internalType": "struct CollectionNestingPermission[]",
288 "name": "",
289 "type": "tuple[]"
290 }
291 ],
292 "stateMutability": "view",
293 "type": "function"
294 },
295 {274 {
296 "inputs": [],275 "inputs": [],
297 "name": "collectionNestingRestrictedCollectionIds",276 "name": "collectionNesting",
298 "outputs": [277 "outputs": [
299 {278 {
300 "components": [279 "components": [
301 { "internalType": "bool", "name": "token_owner", "type": "bool" },280 { "internalType": "bool", "name": "token_owner", "type": "bool" },
281 {
282 "internalType": "bool",
283 "name": "collection_admin",
284 "type": "bool"
285 },
302 { "internalType": "uint256[]", "name": "ids", "type": "uint256[]" }286 {
287 "internalType": "address[]",
288 "name": "restricted",
289 "type": "address[]"
290 }
303 ],291 ],
304 "internalType": "struct CollectionNesting",292 "internalType": "struct CollectionNestingAndPermission",
305 "name": "",293 "name": "",
306 "type": "tuple"294 "type": "tuple"
307 }295 }
686 "stateMutability": "nonpayable",674 "stateMutability": "nonpayable",
687 "type": "function"675 "type": "function"
688 },676 },
689 {677 {
690 "inputs": [{ "internalType": "bool", "name": "enable", "type": "bool" }],
691 "name": "setCollectionNesting",
692 "outputs": [],678 "inputs": [
679 {
680 "components": [
693 "stateMutability": "nonpayable",681 { "internalType": "bool", "name": "token_owner", "type": "bool" },
694 "type": "function"
695 },
696 {
697 "inputs": [
698 { "internalType": "bool", "name": "enable", "type": "bool" },682 {
683 "internalType": "bool",
684 "name": "collection_admin",
685 "type": "bool"
686 },
699 {687 {
700 "internalType": "address[]",688 "internalType": "address[]",
701 "name": "collections",689 "name": "restricted",
702 "type": "address[]"690 "type": "address[]"
703 }691 }
692 ],
693 "internalType": "struct CollectionNestingAndPermission",
694 "name": "collectionNestingAndPermissions",
695 "type": "tuple"
696 }
704 ],697 ],
705 "name": "setCollectionNesting",698 "name": "setCollectionNesting",
706 "outputs": [],699 "outputs": [],
707 "stateMutability": "nonpayable",700 "stateMutability": "nonpayable",
708 "type": "function"701 "type": "function"
709 },702 },
710 {703 {
711 "inputs": [704 "inputs": [
712 {705 {
modifiedtests/src/eth/abi/reFungibleDeprecated.jsondiffbeforeafterboth
137 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],137 "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
138 "stateMutability": "nonpayable",138 "stateMutability": "nonpayable",
139 "type": "function"139 "type": "function"
140 }140 },
141 {
142 "inputs": [],
143 "name": "collectionNestingPermissions",
144 "outputs": [
145 {
146 "components": [
147 {
148 "internalType": "enum CollectionPermissionField",
149 "name": "field",
150 "type": "uint8"
151 },
152 { "internalType": "bool", "name": "value", "type": "bool" }
153 ],
154 "internalType": "struct CollectionNestingPermission[]",
155 "name": "",
156 "type": "tuple[]"
157 }
158 ],
159 "stateMutability": "view",
160 "type": "function"
161 },
162 {
163 "inputs": [],
164 "name": "collectionNestingRestrictedCollectionIds",
165 "outputs": [
166 {
167 "components": [
168 { "internalType": "bool", "name": "token_owner", "type": "bool" },
169 { "internalType": "uint256[]", "name": "ids", "type": "uint256[]" }
170 ],
171 "internalType": "struct CollectionNesting",
172 "name": "",
173 "type": "tuple"
174 }
175 ],
176 "stateMutability": "view",
177 "type": "function"
178 },
179 {
180 "inputs": [{ "internalType": "bool", "name": "enable", "type": "bool" }],
181 "name": "setCollectionNesting",
182 "outputs": [],
183 "stateMutability": "nonpayable",
184 "type": "function"
185 },
186 {
187 "inputs": [
188 { "internalType": "bool", "name": "enable", "type": "bool" },
189 {
190 "internalType": "address[]",
191 "name": "collections",
192 "type": "address[]"
193 }
194 ],
195 "name": "setCollectionNesting",
196 "outputs": [],
197 "stateMutability": "nonpayable",
198 "type": "function"
199 }
141]200]
142201
modifiedtests/src/eth/allowlist.test.tsdiffbeforeafterboth
17import {IKeyringPair} from '@polkadot/types/types';17import {IKeyringPair} from '@polkadot/types/types';
18import {Pallets} from '../util';18import {Pallets} from '../util';
19import {itEth, usingEthPlaygrounds, expect, SponsoringMode} from './util';19import {itEth, usingEthPlaygrounds, expect, SponsoringMode} from './util';
20import {CreateCollectionData} from './util/playgrounds/types';
2021
21describe('EVM contract allowlist', () => {22describe('EVM contract allowlist', () => {
22 let donor: IKeyringPair;23 let donor: IKeyringPair;
104 const userEth = await helper.eth.createAccountWithBalance(donor);105 const userEth = await helper.eth.createAccountWithBalance(donor);
105 const mintParams = testCase.mode === 'ft' ? [userEth, 100] : [userEth];106 const mintParams = testCase.mode === 'ft' ? [userEth, 100] : [userEth];
106107
107 const {collectionAddress, collectionId} = await helper.eth.createCollection(testCase.mode, owner, 'A', 'B', 'C');108 const {collectionAddress, collectionId} = await helper.eth.createCollection(owner, new CreateCollectionData('A', 'B', 'C', testCase.mode)).send();
108 const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner);109 const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner);
109 const userCrossSub = helper.ethCrossAccount.fromKeyringPair(userSub);110 const userCrossSub = helper.ethCrossAccount.fromKeyringPair(userSub);
110 const userCrossEth = helper.ethCrossAccount.fromAddress(userEth);111 const userCrossEth = helper.ethCrossAccount.fromAddress(userEth);
178 const userEth = helper.eth.createAccount();179 const userEth = helper.eth.createAccount();
179 const userCrossEth = helper.ethCrossAccount.fromAddress(userEth);180 const userCrossEth = helper.ethCrossAccount.fromAddress(userEth);
180181
181 const {collectionAddress, collectionId} = await helper.eth.createCollection(testCase.mode, owner, 'A', 'B', 'C');182 const {collectionAddress, collectionId} = await helper.eth.createCollection(owner, new CreateCollectionData('A', 'B', 'C', testCase.mode)).send();
182 const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner, !testCase.cross);183 const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner, !testCase.cross);
183184
184 expect(await helper.collection.allowed(collectionId, {Substrate: userSub.address})).to.be.false;185 expect(await helper.collection.allowed(collectionId, {Substrate: userSub.address})).to.be.false;
modifiedtests/src/eth/api/CollectionHelpers.soldiffbeforeafterboth
20}20}
2121
22/// @title Contract, which allows users to operate with collections22/// @title Contract, which allows users to operate with collections
23/// @dev the ERC-165 identifier for this interface is 0xe65011aa23/// @dev the ERC-165 identifier for this interface is 0x4135fff1
24interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents {24interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents {
25 /// Create a collection
26 /// @return address Address of the newly created collection
27 /// @dev EVM selector for this function is: 0xa765ee5b,
28 /// or in textual repr: createCollection(((address,uint256),string,string,string,uint8,uint8,(string,bytes)[],(string,(uint8,bool)[])[],(address,uint256)[],(bool,bool,address[]),(uint8,uint256)[],uint8))
29 function createCollection(CreateCollectionData memory data) external payable returns (address);
30
25 /// Create an NFT collection31 /// Create an NFT collection
26 /// @param name Name of the collection32 /// @param name Name of the collection
95 function collectionId(address collectionAddress) external view returns (uint32);101 function collectionId(address collectionAddress) external view returns (uint32);
96}102}
103
104/// Collection properties
105struct CreateCollectionData {
106 /// Collection sponsor
107 CrossAddress pending_sponsor;
108 /// Collection name
109 string name;
110 /// Collection description
111 string description;
112 /// Token prefix
113 string token_prefix;
114 /// Token type (NFT, FT or RFT)
115 CollectionMode mode;
116 /// Fungible token precision
117 uint8 decimals;
118 /// Custom Properties
119 Property[] properties;
120 /// Permissions for token properties
121 TokenPropertyPermission[] token_property_permissions;
122 /// Collection admins
123 CrossAddress[] admin_list;
124 /// Nesting settings
125 CollectionNestingAndPermission nesting_settings;
126 /// Collection limits
127 CollectionLimitValue[] limits;
128 /// Extra collection flags
129 CollectionFlags flags;
130}
131
132/// Cross account struct
133type CollectionFlags is uint8;
134
135library CollectionFlagsLib {
136 /// Tokens in foreign collections can be transferred, but not burnt
137 CollectionFlags constant foreignField = CollectionFlags.wrap(128);
138 /// Supports ERC721Metadata
139 CollectionFlags constant erc721metadataField = CollectionFlags.wrap(64);
140 /// External collections can't be managed using `unique` api
141 CollectionFlags constant externalField = CollectionFlags.wrap(1);
142
143 /// Reserved bits
144 function reservedField(uint8 value) public pure returns (CollectionFlags) {
145 require(value < 1 << 5, "out of bound value");
146 return CollectionFlags.wrap(value << 1);
147 }
148}
149
150/// [`CollectionLimits`](up_data_structs::CollectionLimits) field representation for EVM.
151struct CollectionLimitValue {
152 CollectionLimitField field;
153 uint256 value;
154}
155
156/// [`CollectionLimits`](up_data_structs::CollectionLimits) fields representation for EVM.
157enum CollectionLimitField {
158 /// How many tokens can a user have on one account.
159 AccountTokenOwnership,
160 /// How many bytes of data are available for sponsorship.
161 SponsoredDataSize,
162 /// In any case, chain default: [`SponsoringRateLimit::SponsoringDisabled`]
163 SponsoredDataRateLimit,
164 /// How many tokens can be mined into this collection.
165 TokenLimit,
166 /// Timeouts for transfer sponsoring.
167 SponsorTransferTimeout,
168 /// Timeout for sponsoring an approval in passed blocks.
169 SponsorApproveTimeout,
170 /// Whether the collection owner of the collection can send tokens (which belong to other users).
171 OwnerCanTransfer,
172 /// Can the collection owner burn other people's tokens.
173 OwnerCanDestroy,
174 /// Is it possible to send tokens from this collection between users.
175 TransferEnabled
176}
177
178/// Nested collections and permissions
179struct CollectionNestingAndPermission {
180 /// Owner of token can nest tokens under it.
181 bool token_owner;
182 /// Admin of token collection can nest tokens under token.
183 bool collection_admin;
184 /// If set - only tokens from specified collections can be nested.
185 address[] restricted;
186}
187
188/// Cross account struct
189struct CrossAddress {
190 address eth;
191 uint256 sub;
192}
193
194/// Ethereum representation of Token Property Permissions.
195struct TokenPropertyPermission {
196 /// Token property key.
197 string key;
198 /// Token property permissions.
199 PropertyPermission[] permissions;
200}
201
202/// Ethereum representation of TokenPermissions (see [`up_data_structs::PropertyPermission`]) as an key and value.
203struct PropertyPermission {
204 /// TokenPermission field.
205 TokenPermissionField code;
206 /// TokenPermission value.
207 bool value;
208}
209
210/// Ethereum representation of TokenPermissions (see [`up_data_structs::PropertyPermission`]) fields as an enumeration.
211enum TokenPermissionField {
212 /// Permission to change the property and property permission. See [`up_data_structs::PropertyPermission::mutable`]
213 Mutable,
214 /// Change permission for the collection administrator. See [`up_data_structs::PropertyPermission::token_owner`]
215 TokenOwner,
216 /// Permission to change the property for the owner of the token. See [`up_data_structs::PropertyPermission::collection_admin`]
217 CollectionAdmin
218}
219
220/// Ethereum representation of collection [`PropertyKey`](up_data_structs::PropertyKey) and [`PropertyValue`](up_data_structs::PropertyValue).
221struct Property {
222 string key;
223 bytes value;
224}
225
226/// Type of tokens in collection
227enum CollectionMode {
228 /// Fungible
229 Fungible,
230 /// Nonfungible
231 Nonfungible,
232 /// Refungible
233 Refungible
234}
97235
modifiedtests/src/eth/api/UniqueFungible.soldiffbeforeafterboth
13}13}
1414
15/// @title A contract that allows you to work with collections.15/// @title A contract that allows you to work with collections.
16/// @dev the ERC-165 identifier for this interface is 0x2a14cfd116/// @dev the ERC-165 identifier for this interface is 0xb34d97e9
17interface Collection is Dummy, ERC165 {17interface Collection is Dummy, ERC165 {
18 // /// Set collection property.18 // /// Set collection property.
19 // ///19 // ///
148 // /// or in textual repr: removeCollectionAdmin(address)148 // /// or in textual repr: removeCollectionAdmin(address)
149 // function removeCollectionAdmin(address admin) external;149 // function removeCollectionAdmin(address admin) external;
150150
151 /// Toggle accessibility of collection nesting.
152 ///
153 /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
154 /// @dev EVM selector for this function is: 0x112d4586,
155 /// or in textual repr: setCollectionNesting(bool)
156 function setCollectionNesting(bool enable) external;
157
158 /// Toggle accessibility of collection nesting.
159 ///
160 /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
161 /// @param collections Addresses of collections that will be available for nesting.
162 /// @dev EVM selector for this function is: 0x64872396,151 /// @dev EVM selector for this function is: 0x0b9f3890,
163 /// or in textual repr: setCollectionNesting(bool,address[])152 /// or in textual repr: setCollectionNesting((bool,bool,address[]))
164 function setCollectionNesting(bool enable, address[] memory collections) external;153 function setCollectionNesting(CollectionNestingAndPermission memory collectionNestingAndPermissions) external;
165154
166 /// Returns nesting for a collection155 // /// Toggle accessibility of collection nesting.
156 // ///
157 // /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
158 // /// @dev EVM selector for this function is: 0x112d4586,
159 // /// or in textual repr: setCollectionNesting(bool)
160 // function setCollectionNesting(bool enable) external;
161
162 // /// Toggle accessibility of collection nesting.
163 // ///
164 // /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
165 // /// @param collections Addresses of collections that will be available for nesting.
166 // /// @dev EVM selector for this function is: 0x64872396,
167 // /// or in textual repr: setCollectionNesting(bool,address[])
168 // function setCollectionNesting(bool enable, address[] memory collections) external;
169
167 /// @dev EVM selector for this function is: 0x22d25bfe,170 /// @dev EVM selector for this function is: 0x92c660a8,
168 /// or in textual repr: collectionNestingRestrictedCollectionIds()171 /// or in textual repr: collectionNesting()
169 function collectionNestingRestrictedCollectionIds() external view returns (CollectionNesting memory);172 function collectionNesting() external view returns (CollectionNestingAndPermission memory);
173
174 // /// Returns nesting for a collection
175 // /// @dev EVM selector for this function is: 0x22d25bfe,
176 // /// or in textual repr: collectionNestingRestrictedCollectionIds()
177 // function collectionNestingRestrictedCollectionIds() external view returns (CollectionNesting memory);
170178
171 /// Returns permissions for a collection179 // /// Returns permissions for a collection
172 /// @dev EVM selector for this function is: 0x5b2eaf4b,180 // /// @dev EVM selector for this function is: 0x5b2eaf4b,
173 /// or in textual repr: collectionNestingPermissions()181 // /// or in textual repr: collectionNestingPermissions()
174 function collectionNestingPermissions() external view returns (CollectionNestingPermission[] memory);182 // function collectionNestingPermissions() external view returns (CollectionNestingPermission[] memory);
175183
176 /// Set the collection access method.184 /// Set the collection access method.
177 /// @param mode Access mode185 /// @param mode Access mode
311 uint256[] ids;319 uint256[] ids;
312}320}
321
322/// Nested collections and permissions
323struct CollectionNestingAndPermission {
324 /// Owner of token can nest tokens under it.
325 bool token_owner;
326 /// Admin of token collection can nest tokens under token.
327 bool collection_admin;
328 /// If set - only tokens from specified collections can be nested.
329 address[] restricted;
330}
313331
314/// [`CollectionLimits`](up_data_structs::CollectionLimits) field representation for EVM.332/// [`CollectionLimits`](up_data_structs::CollectionLimits) field representation for EVM.
315struct CollectionLimit {333struct CollectionLimit {
modifiedtests/src/eth/api/UniqueNFT.soldiffbeforeafterboth
118}118}
119119
120/// @title A contract that allows you to work with collections.120/// @title A contract that allows you to work with collections.
121/// @dev the ERC-165 identifier for this interface is 0x2a14cfd1121/// @dev the ERC-165 identifier for this interface is 0xb34d97e9
122interface Collection is Dummy, ERC165 {122interface Collection is Dummy, ERC165 {
123 // /// Set collection property.123 // /// Set collection property.
124 // ///124 // ///
253 // /// or in textual repr: removeCollectionAdmin(address)253 // /// or in textual repr: removeCollectionAdmin(address)
254 // function removeCollectionAdmin(address admin) external;254 // function removeCollectionAdmin(address admin) external;
255255
256 /// Toggle accessibility of collection nesting.
257 ///
258 /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
259 /// @dev EVM selector for this function is: 0x112d4586,
260 /// or in textual repr: setCollectionNesting(bool)
261 function setCollectionNesting(bool enable) external;
262
263 /// Toggle accessibility of collection nesting.
264 ///
265 /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
266 /// @param collections Addresses of collections that will be available for nesting.
267 /// @dev EVM selector for this function is: 0x64872396,256 /// @dev EVM selector for this function is: 0x0b9f3890,
268 /// or in textual repr: setCollectionNesting(bool,address[])257 /// or in textual repr: setCollectionNesting((bool,bool,address[]))
269 function setCollectionNesting(bool enable, address[] memory collections) external;258 function setCollectionNesting(CollectionNestingAndPermission memory collectionNestingAndPermissions) external;
270259
271 /// Returns nesting for a collection260 // /// Toggle accessibility of collection nesting.
261 // ///
262 // /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
263 // /// @dev EVM selector for this function is: 0x112d4586,
264 // /// or in textual repr: setCollectionNesting(bool)
265 // function setCollectionNesting(bool enable) external;
266
267 // /// Toggle accessibility of collection nesting.
268 // ///
269 // /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
270 // /// @param collections Addresses of collections that will be available for nesting.
271 // /// @dev EVM selector for this function is: 0x64872396,
272 // /// or in textual repr: setCollectionNesting(bool,address[])
273 // function setCollectionNesting(bool enable, address[] memory collections) external;
274
272 /// @dev EVM selector for this function is: 0x22d25bfe,275 /// @dev EVM selector for this function is: 0x92c660a8,
273 /// or in textual repr: collectionNestingRestrictedCollectionIds()276 /// or in textual repr: collectionNesting()
274 function collectionNestingRestrictedCollectionIds() external view returns (CollectionNesting memory);277 function collectionNesting() external view returns (CollectionNestingAndPermission memory);
278
279 // /// Returns nesting for a collection
280 // /// @dev EVM selector for this function is: 0x22d25bfe,
281 // /// or in textual repr: collectionNestingRestrictedCollectionIds()
282 // function collectionNestingRestrictedCollectionIds() external view returns (CollectionNesting memory);
275283
276 /// Returns permissions for a collection284 // /// Returns permissions for a collection
277 /// @dev EVM selector for this function is: 0x5b2eaf4b,285 // /// @dev EVM selector for this function is: 0x5b2eaf4b,
278 /// or in textual repr: collectionNestingPermissions()286 // /// or in textual repr: collectionNestingPermissions()
279 function collectionNestingPermissions() external view returns (CollectionNestingPermission[] memory);287 // function collectionNestingPermissions() external view returns (CollectionNestingPermission[] memory);
280288
281 /// Set the collection access method.289 /// Set the collection access method.
282 /// @param mode Access mode290 /// @param mode Access mode
416 uint256[] ids;424 uint256[] ids;
417}425}
426
427/// Nested collections and permissions
428struct CollectionNestingAndPermission {
429 /// Owner of token can nest tokens under it.
430 bool token_owner;
431 /// Admin of token collection can nest tokens under token.
432 bool collection_admin;
433 /// If set - only tokens from specified collections can be nested.
434 address[] restricted;
435}
418436
419/// [`CollectionLimits`](up_data_structs::CollectionLimits) field representation for EVM.437/// [`CollectionLimits`](up_data_structs::CollectionLimits) field representation for EVM.
420struct CollectionLimit {438struct CollectionLimit {
modifiedtests/src/eth/api/UniqueRefungible.soldiffbeforeafterboth
118}118}
119119
120/// @title A contract that allows you to work with collections.120/// @title A contract that allows you to work with collections.
121/// @dev the ERC-165 identifier for this interface is 0x2a14cfd1121/// @dev the ERC-165 identifier for this interface is 0xb34d97e9
122interface Collection is Dummy, ERC165 {122interface Collection is Dummy, ERC165 {
123 // /// Set collection property.123 // /// Set collection property.
124 // ///124 // ///
253 // /// or in textual repr: removeCollectionAdmin(address)253 // /// or in textual repr: removeCollectionAdmin(address)
254 // function removeCollectionAdmin(address admin) external;254 // function removeCollectionAdmin(address admin) external;
255255
256 /// Toggle accessibility of collection nesting.
257 ///
258 /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
259 /// @dev EVM selector for this function is: 0x112d4586,
260 /// or in textual repr: setCollectionNesting(bool)
261 function setCollectionNesting(bool enable) external;
262
263 /// Toggle accessibility of collection nesting.
264 ///
265 /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
266 /// @param collections Addresses of collections that will be available for nesting.
267 /// @dev EVM selector for this function is: 0x64872396,256 /// @dev EVM selector for this function is: 0x0b9f3890,
268 /// or in textual repr: setCollectionNesting(bool,address[])257 /// or in textual repr: setCollectionNesting((bool,bool,address[]))
269 function setCollectionNesting(bool enable, address[] memory collections) external;258 function setCollectionNesting(CollectionNestingAndPermission memory collectionNestingAndPermissions) external;
270259
271 /// Returns nesting for a collection260 // /// Toggle accessibility of collection nesting.
261 // ///
262 // /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
263 // /// @dev EVM selector for this function is: 0x112d4586,
264 // /// or in textual repr: setCollectionNesting(bool)
265 // function setCollectionNesting(bool enable) external;
266
267 // /// Toggle accessibility of collection nesting.
268 // ///
269 // /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
270 // /// @param collections Addresses of collections that will be available for nesting.
271 // /// @dev EVM selector for this function is: 0x64872396,
272 // /// or in textual repr: setCollectionNesting(bool,address[])
273 // function setCollectionNesting(bool enable, address[] memory collections) external;
274
272 /// @dev EVM selector for this function is: 0x22d25bfe,275 /// @dev EVM selector for this function is: 0x92c660a8,
273 /// or in textual repr: collectionNestingRestrictedCollectionIds()276 /// or in textual repr: collectionNesting()
274 function collectionNestingRestrictedCollectionIds() external view returns (CollectionNesting memory);277 function collectionNesting() external view returns (CollectionNestingAndPermission memory);
278
279 // /// Returns nesting for a collection
280 // /// @dev EVM selector for this function is: 0x22d25bfe,
281 // /// or in textual repr: collectionNestingRestrictedCollectionIds()
282 // function collectionNestingRestrictedCollectionIds() external view returns (CollectionNesting memory);
275283
276 /// Returns permissions for a collection284 // /// Returns permissions for a collection
277 /// @dev EVM selector for this function is: 0x5b2eaf4b,285 // /// @dev EVM selector for this function is: 0x5b2eaf4b,
278 /// or in textual repr: collectionNestingPermissions()286 // /// or in textual repr: collectionNestingPermissions()
279 function collectionNestingPermissions() external view returns (CollectionNestingPermission[] memory);287 // function collectionNestingPermissions() external view returns (CollectionNestingPermission[] memory);
280288
281 /// Set the collection access method.289 /// Set the collection access method.
282 /// @param mode Access mode290 /// @param mode Access mode
416 uint256[] ids;424 uint256[] ids;
417}425}
426
427/// Nested collections and permissions
428struct CollectionNestingAndPermission {
429 /// Owner of token can nest tokens under it.
430 bool token_owner;
431 /// Admin of token collection can nest tokens under token.
432 bool collection_admin;
433 /// If set - only tokens from specified collections can be nested.
434 address[] restricted;
435}
418436
419/// [`CollectionLimits`](up_data_structs::CollectionLimits) field representation for EVM.437/// [`CollectionLimits`](up_data_structs::CollectionLimits) field representation for EVM.
420struct CollectionLimit {438struct CollectionLimit {
modifiedtests/src/eth/collectionAdmin.test.tsdiffbeforeafterboth
19import {IEthCrossAccountId} from '../util/playgrounds/types';19import {IEthCrossAccountId} from '../util/playgrounds/types';
20import {usingEthPlaygrounds, itEth} from './util';20import {usingEthPlaygrounds, itEth} from './util';
21import {EthUniqueHelper} from './util/playgrounds/unique.dev';21import {EthUniqueHelper} from './util/playgrounds/unique.dev';
22import {CreateCollectionData} from './util/playgrounds/types';
2223
23async function recordEthFee(helper: EthUniqueHelper, userAddress: string, call: () => Promise<any>) {24async function recordEthFee(helper: EthUniqueHelper, userAddress: string, call: () => Promise<any>) {
24 const before = await helper.balance.getSubstrate(helper.address.ethToSubstrate(userAddress));25 const before = await helper.balance.getSubstrate(helper.address.ethToSubstrate(userAddress));
55 const adminCrossSub = helper.ethCrossAccount.fromKeyringPair(adminSub);56 const adminCrossSub = helper.ethCrossAccount.fromKeyringPair(adminSub);
56 const adminCrossEth = helper.ethCrossAccount.fromAddress(adminEth);57 const adminCrossEth = helper.ethCrossAccount.fromAddress(adminEth);
5758
58 const {collectionAddress, collectionId} = await helper.eth.createCollection(testCase.mode, owner, 'A', 'B', 'C');59 const {collectionAddress, collectionId} = await helper.eth.createCollection(owner, new CreateCollectionData('A', 'B', 'C', testCase.mode)).send();
59 const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner, true);60 const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner, true);
6061
61 // Check isOwnerOrAdminCross returns false:62 // Check isOwnerOrAdminCross returns false:
modifiedtests/src/eth/collectionLimits.test.tsdiffbeforeafterboth
1import {IKeyringPair} from '@polkadot/types/types';1import {IKeyringPair} from '@polkadot/types/types';
2import {Pallets} from '../util';2import {Pallets} from '../util';
3import {expect, itEth, usingEthPlaygrounds} from './util';3import {expect, itEth, usingEthPlaygrounds} from './util';
4import {CollectionLimitField} from './util/playgrounds/types';4import {CollectionLimitField, CreateCollectionData} from './util/playgrounds/types';
55
66
7describe('Can set collection limits', () => {7describe('Can set collection limits', () => {
20 ].map(testCase =>20 ].map(testCase =>
21 itEth.ifWithPallets(`for ${testCase.case}`, testCase.requiredPallets || [], async ({helper}) => {21 itEth.ifWithPallets(`for ${testCase.case}`, testCase.requiredPallets || [], async ({helper}) => {
22 const owner = await helper.eth.createAccountWithBalance(donor);22 const owner = await helper.eth.createAccountWithBalance(donor);
23 const {collectionId, collectionAddress} = await helper.eth.createCollection(testCase.case, owner, 'Limits', 'absolutely anything', 'FLO', 18);23 const {collectionId, collectionAddress} = await helper.eth.createCollection(owner, new CreateCollectionData('Limits', 'absolutely anything', 'FLO', testCase.case, 18)).send();
24 const limits = {24 const limits = {
25 accountTokenOwnershipLimit: 1000,25 accountTokenOwnershipLimit: 1000,
26 sponsoredDataSize: 1024,26 sponsoredDataSize: 1024,
96 };96 };
9797
98 const owner = await helper.eth.createAccountWithBalance(donor);98 const owner = await helper.eth.createAccountWithBalance(donor);
99 const {collectionAddress} = await helper.eth.createCollection(testCase.case, owner, 'Limits', 'absolutely anything', 'ISNI', 18);99 const {collectionAddress} = await helper.eth.createCollection(owner, new CreateCollectionData('Limits', 'absolutely anything', 'ISNI', testCase.case, 18)).send();
100 const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, testCase.case, owner);100 const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, testCase.case, owner);
101101
102 // Cannot set non-existing limit102 // Cannot set non-existing limit
103 await expect(collectionEvm.methods103 await expect(collectionEvm.methods
104 .setCollectionLimit({field: 9, value: {status: true, value: 1}})104 .setCollectionLimit({field: 9, value: {status: true, value: 1}})
105 .call()).to.be.rejectedWith('Returned error: VM Exception while processing transaction: revert Value not convertible into enum "CollectionLimitField"');105 .call()).to.be.rejectedWith('Returned error: VM Exception while processing transaction: revert value not convertible into enum "CollectionLimitField"');
106106
107 // Cannot disable limits107 // Cannot disable limits
108 await expect(collectionEvm.methods108 await expect(collectionEvm.methods
129 itEth.ifWithPallets(`Non-owner and non-admin cannot set collection limits for ${testCase.case}`, testCase.requiredPallets || [], async ({helper}) => {129 itEth.ifWithPallets(`Non-owner and non-admin cannot set collection limits for ${testCase.case}`, testCase.requiredPallets || [], async ({helper}) => {
130 const owner = await helper.eth.createAccountWithBalance(donor);130 const owner = await helper.eth.createAccountWithBalance(donor);
131 const nonOwner = await helper.eth.createAccountWithBalance(donor);131 const nonOwner = await helper.eth.createAccountWithBalance(donor);
132 const {collectionAddress} = await helper.eth.createCollection(testCase.case, owner, 'Limits', 'absolutely anything', 'FLO', 18);132 const {collectionAddress} = await helper.eth.createCollection(owner, new CreateCollectionData('Limits', 'absolutely anything', 'FLO', testCase.case, 18)).send();
133133
134 const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, testCase.case, owner);134 const collectionEvm = await helper.ethNativeContract.collection(collectionAddress, testCase.case, owner);
135 await expect(collectionEvm.methods135 await expect(collectionEvm.methods
addedtests/src/eth/createCollection.test.tsdiffbeforeafterboth

no changes

modifiedtests/src/eth/destroyCollection.test.tsdiffbeforeafterboth
17import {IKeyringPair} from '@polkadot/types/types';17import {IKeyringPair} from '@polkadot/types/types';
18import {Pallets} from '../util';18import {Pallets} from '../util';
19import {expect, itEth, usingEthPlaygrounds} from './util';19import {expect, itEth, usingEthPlaygrounds} from './util';
20import {TCollectionMode} from '../util/playgrounds/types';
21import {CreateCollectionData} from './util/playgrounds/types';
2022
21describe('Destroy Collection from EVM', function() {23describe('Destroy Collection from EVM', function() {
22 let donor: IKeyringPair;24 let donor: IKeyringPair;
23 const testCases = [25 const testCases = [
24 {case: 'rft' as const, params: ['Limits', 'absolutely anything', 'OLF'], requiredPallets: [Pallets.ReFungible]},26 {case: 'rft' as const, params: ['Limits', 'absolutely anything', 'OLF', 'rft'], requiredPallets: [Pallets.ReFungible]},
25 {case: 'nft' as const, params: ['Limits', 'absolutely anything', 'OLF'], requiredPallets: [Pallets.NFT]},27 {case: 'nft' as const, params: ['Limits', 'absolutely anything', 'OLF', 'nft'], requiredPallets: [Pallets.NFT]},
26 {case: 'ft' as const, params: ['Limits', 'absolutely anything', 'OLF', 18], requiredPallets: [Pallets.Fungible]},28 {case: 'ft' as const, params: ['Limits', 'absolutely anything', 'OLF', 'ft', 18], requiredPallets: [Pallets.Fungible]},
27 ];29 ];
2830
29 before(async function() {31 before(async function() {
40 const unexistedCollection = helper.ethAddress.fromCollectionId(1000000);42 const unexistedCollection = helper.ethAddress.fromCollectionId(1000000);
4143
42 const collectionHelpers = await helper.ethNativeContract.collectionHelpers(signer);44 const collectionHelpers = await helper.ethNativeContract.collectionHelpers(signer);
43 const {collectionAddress} = await helper.eth.createCollection(testCase.case, owner, ...testCase.params as [string, string, string, number?]);45 const {collectionAddress} = await helper.eth.createCollection(owner, new CreateCollectionData(...testCase.params as [string, string, string, TCollectionMode, number?])).send();
44
45 // cannot burn collec46 // cannot burn collec
46 await expect(collectionHelpers.methods47 await expect(collectionHelpers.methods
modifiedtests/src/eth/events.test.tsdiffbeforeafterboth
19import {EthUniqueHelper, itEth, usingEthPlaygrounds} from './util';19import {EthUniqueHelper, itEth, usingEthPlaygrounds} from './util';
20import {IEvent, TCollectionMode} from '../util/playgrounds/types';20import {IEvent, TCollectionMode} from '../util/playgrounds/types';
21import {Pallets, requirePalletsOrSkip} from '../util';21import {Pallets, requirePalletsOrSkip} from '../util';
22import {CollectionLimitField, TokenPermissionField, NormalizedEvent} from './util/playgrounds/types';22import {CollectionLimitField, TokenPermissionField, NormalizedEvent, CreateCollectionData} from './util/playgrounds/types';
2323
24let donor: IKeyringPair;24let donor: IKeyringPair;
2525
39async function testCollectionCreatedAndDestroy(helper: EthUniqueHelper, mode: TCollectionMode) {39async function testCollectionCreatedAndDestroy(helper: EthUniqueHelper, mode: TCollectionMode) {
40 const owner = await helper.eth.createAccountWithBalance(donor);40 const owner = await helper.eth.createAccountWithBalance(donor);
41 const {unsubscribe, collectedEvents: subEvents} = await helper.subscribeEvents([{section: 'common', names: ['CollectionCreated', 'CollectionDestroyed']}]);41 const {unsubscribe, collectedEvents: subEvents} = await helper.subscribeEvents([{section: 'common', names: ['CollectionCreated', 'CollectionDestroyed']}]);
42 const {collectionAddress, events: ethEvents} = await helper.eth.createCollection(mode, owner, 'A', 'B', 'C');42 const {collectionAddress, events: ethEvents} = await helper.eth.createCollection(owner, new CreateCollectionData('A', 'B', 'C', mode, 18)).send();
43
43 await helper.wait.newBlocks(1);44 await helper.wait.newBlocks(1);
44 {45 {
7273
73async function testCollectionPropertySetAndDeleted(helper: EthUniqueHelper, mode: TCollectionMode) {74async function testCollectionPropertySetAndDeleted(helper: EthUniqueHelper, mode: TCollectionMode) {
74 const owner = await helper.eth.createAccountWithBalance(donor);75 const owner = await helper.eth.createAccountWithBalance(donor);
75 const {collectionAddress} = await helper.eth.createCollection(mode, owner, 'A', 'B', 'C');76 const {collectionAddress} = await helper.eth.createCollection(owner, new CreateCollectionData('A', 'B', 'C', mode, 18)).send();
76 const collection = await helper.ethNativeContract.collection(collectionAddress, mode, owner);77 const collection = await helper.ethNativeContract.collection(collectionAddress, mode, owner);
77 const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);78 const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);
7879
113114
114async function testPropertyPermissionSet(helper: EthUniqueHelper, mode: TCollectionMode) {115async function testPropertyPermissionSet(helper: EthUniqueHelper, mode: TCollectionMode) {
115 const owner = await helper.eth.createAccountWithBalance(donor);116 const owner = await helper.eth.createAccountWithBalance(donor);
116 const {collectionAddress} = await helper.eth.createCollection(mode, owner, 'A', 'B', 'C');117 const {collectionAddress} = await helper.eth.createCollection(owner, new CreateCollectionData('A', 'B', 'C', mode, 18)).send();
117 const collection = await helper.ethNativeContract.collection(collectionAddress, mode, owner);118 const collection = await helper.ethNativeContract.collection(collectionAddress, mode, owner);
118 const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);119 const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);
119 const ethEvents: any = [];120 const ethEvents: any = [];
144async function testAllowListAddressAddedAndRemoved(helper: EthUniqueHelper, mode: TCollectionMode) {145async function testAllowListAddressAddedAndRemoved(helper: EthUniqueHelper, mode: TCollectionMode) {
145 const owner = await helper.eth.createAccountWithBalance(donor);146 const owner = await helper.eth.createAccountWithBalance(donor);
146 const user = helper.ethCrossAccount.createAccount();147 const user = helper.ethCrossAccount.createAccount();
147 const {collectionAddress} = await helper.eth.createCollection(mode, owner, 'A', 'B', 'C');148 const {collectionAddress} = await helper.eth.createCollection(owner, new CreateCollectionData('A', 'B', 'C', mode, 18)).send();
148 const collection = await helper.ethNativeContract.collection(collectionAddress, mode, owner);149 const collection = await helper.ethNativeContract.collection(collectionAddress, mode, owner);
149 const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);150 const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);
150 const ethEvents: any[] = [];151 const ethEvents: any[] = [];
186async function testCollectionAdminAddedAndRemoved(helper: EthUniqueHelper, mode: TCollectionMode) {187async function testCollectionAdminAddedAndRemoved(helper: EthUniqueHelper, mode: TCollectionMode) {
187 const owner = await helper.eth.createAccountWithBalance(donor);188 const owner = await helper.eth.createAccountWithBalance(donor);
188 const user = helper.ethCrossAccount.createAccount();189 const user = helper.ethCrossAccount.createAccount();
189 const {collectionAddress} = await helper.eth.createCollection(mode, owner, 'A', 'B', 'C');190 const {collectionAddress} = await helper.eth.createCollection(owner, new CreateCollectionData('A', 'B', 'C', mode, 18)).send();
190 const collection = await helper.ethNativeContract.collection(collectionAddress, mode, owner);191 const collection = await helper.ethNativeContract.collection(collectionAddress, mode, owner);
191 const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);192 const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);
192 const ethEvents: any = [];193 const ethEvents: any = [];
226227
227async function testCollectionLimitSet(helper: EthUniqueHelper, mode: TCollectionMode) {228async function testCollectionLimitSet(helper: EthUniqueHelper, mode: TCollectionMode) {
228 const owner = await helper.eth.createAccountWithBalance(donor);229 const owner = await helper.eth.createAccountWithBalance(donor);
229 const {collectionAddress} = await helper.eth.createCollection(mode, owner, 'A', 'B', 'C');230 const {collectionAddress} = await helper.eth.createCollection(owner, new CreateCollectionData('A', 'B', 'C', mode, 18)).send();
230 const collection = await helper.ethNativeContract.collection(collectionAddress, mode, owner);231 const collection = await helper.ethNativeContract.collection(collectionAddress, mode, owner);
231 const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);232 const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);
232 const ethEvents: any = [];233 const ethEvents: any = [];
253async function testCollectionOwnerChanged(helper: EthUniqueHelper, mode: TCollectionMode) {254async function testCollectionOwnerChanged(helper: EthUniqueHelper, mode: TCollectionMode) {
254 const owner = await helper.eth.createAccountWithBalance(donor);255 const owner = await helper.eth.createAccountWithBalance(donor);
255 const newOwner = helper.ethCrossAccount.createAccount();256 const newOwner = helper.ethCrossAccount.createAccount();
256 const {collectionAddress} = await helper.eth.createCollection(mode, owner, 'A', 'B', 'C');257 const {collectionAddress} = await helper.eth.createCollection(owner, new CreateCollectionData('A', 'B', 'C', mode, 18)).send();
257 const collection = await helper.ethNativeContract.collection(collectionAddress, mode, owner);258 const collection = await helper.ethNativeContract.collection(collectionAddress, mode, owner);
258 const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);259 const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);
259 const ethEvents: any = [];260 const ethEvents: any = [];
279280
280async function testCollectionPermissionSet(helper: EthUniqueHelper, mode: TCollectionMode) {281async function testCollectionPermissionSet(helper: EthUniqueHelper, mode: TCollectionMode) {
281 const owner = await helper.eth.createAccountWithBalance(donor);282 const owner = await helper.eth.createAccountWithBalance(donor);
282 const {collectionAddress} = await helper.eth.createCollection(mode, owner, 'A', 'B', 'C');283 const {collectionAddress} = await helper.eth.createCollection(owner, new CreateCollectionData('A', 'B', 'C', mode, 18)).send();
283 const collection = await helper.ethNativeContract.collection(collectionAddress, mode, owner);284 const collection = await helper.ethNativeContract.collection(collectionAddress, mode, owner);
284 const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);285 const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);
285 const ethEvents: any = [];286 const ethEvents: any = [];
320async function testCollectionSponsorSetAndConfirmedAndThenRemoved(helper: EthUniqueHelper, mode: TCollectionMode) {321async function testCollectionSponsorSetAndConfirmedAndThenRemoved(helper: EthUniqueHelper, mode: TCollectionMode) {
321 const owner = await helper.eth.createAccountWithBalance(donor);322 const owner = await helper.eth.createAccountWithBalance(donor);
322 const sponsor = await helper.ethCrossAccount.createAccountWithBalance(donor);323 const sponsor = await helper.ethCrossAccount.createAccountWithBalance(donor);
323 const {collectionAddress} = await helper.eth.createCollection(mode, owner, 'A', 'B', 'C');324 const {collectionAddress} = await helper.eth.createCollection(owner, new CreateCollectionData('A', 'B', 'C', mode, 18)).send();
324 const collection = await helper.ethNativeContract.collection(collectionAddress, mode, owner);325 const collection = await helper.ethNativeContract.collection(collectionAddress, mode, owner);
325 const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);326 const collectionHelper = await helper.ethNativeContract.collectionHelpers(owner);
326 const ethEvents: any = [];327 const ethEvents: any = [];
374375
375async function testTokenPropertySetAndDeleted(helper: EthUniqueHelper, mode: TCollectionMode) {376async function testTokenPropertySetAndDeleted(helper: EthUniqueHelper, mode: TCollectionMode) {
376 const owner = await helper.eth.createAccountWithBalance(donor);377 const owner = await helper.eth.createAccountWithBalance(donor);
377 const {collectionAddress} = await helper.eth.createCollection(mode, owner, 'A', 'B', 'C');378 const {collectionAddress} = await helper.eth.createCollection(owner, new CreateCollectionData('A', 'B', 'C', mode, 18)).send();
378 const collection = await helper.ethNativeContract.collection(collectionAddress, mode, owner);379 const collection = await helper.ethNativeContract.collection(collectionAddress, mode, owner);
379 const result = await collection.methods.mint(owner).send({from: owner});380 const result = await collection.methods.mint(owner).send({from: owner});
380 const tokenId = result.events.Transfer.returnValues.tokenId;381 const tokenId = result.events.Transfer.returnValues.tokenId;
modifiedtests/src/eth/marketplace-v2/Market.soldiffbeforeafterboth
7import "@openzeppelin/contracts/access/Ownable.sol";7import "@openzeppelin/contracts/access/Ownable.sol";
8import { UniqueNFT, CrossAddress } from "@unique-nft/solidity-interfaces/contracts/UniqueNFT.sol";8import { UniqueNFT, CrossAddress } from "@unique-nft/solidity-interfaces/contracts/UniqueNFT.sol";
9import { UniqueFungible, CrossAddress as CrossAddressF } from "@unique-nft/solidity-interfaces/contracts/UniqueFungible.sol";9import { UniqueFungible, CrossAddress as CrossAddressF } from "@unique-nft/solidity-interfaces/contracts/UniqueFungible.sol";
10import "@unique-nft/solidity-interfaces/contracts/CollectionHelpers.sol";10import { CollectionHelpers } from "@unique-nft/solidity-interfaces/contracts/CollectionHelpers.sol";
11import "./royalty/UniqueRoyaltyHelper.sol";11import "./royalty/UniqueRoyaltyHelper.sol";
1212
13contract Market is Ownable, ReentrancyGuard {13contract Market is Ownable, ReentrancyGuard {
modifiedtests/src/eth/marketplace/marketplace.test.tsdiffbeforeafterboth
60 await helpers.methods.setSponsor(matcher.options.address, sponsor).send({from: matcherOwner});60 await helpers.methods.setSponsor(matcher.options.address, sponsor).send({from: matcherOwner});
61 await helpers.methods.confirmSponsorship(matcher.options.address).send({from: sponsor});61 await helpers.methods.confirmSponsorship(matcher.options.address).send({from: sponsor});
6262
63 const collection = await helper.nft.mintCollection(alice, {limits: {sponsorApproveTimeout: 1}, pendingSponsor: alice.address});63 const collection = await helper.nft.mintCollection(alice, {limits: {sponsorApproveTimeout: 1}, pendingSponsor: {Substrate: alice.address}});
64 await collection.confirmSponsorship(alice);64 await collection.confirmSponsorship(alice);
65 await collection.addToAllowList(alice, {Substrate: aliceDoubleMirror});65 await collection.addToAllowList(alice, {Substrate: aliceDoubleMirror});
66 const evmCollection = await helper.ethNativeContract.collection(helper.ethAddress.fromCollectionId(collection.collectionId), 'nft');66 const evmCollection = await helper.ethNativeContract.collection(helper.ethAddress.fromCollectionId(collection.collectionId), 'nft');
114 await helpers.methods.setSponsor(matcher.options.address, sponsor).send({from: matcherOwner});114 await helpers.methods.setSponsor(matcher.options.address, sponsor).send({from: matcherOwner});
115 await helpers.methods.confirmSponsorship(matcher.options.address).send({from: sponsor});115 await helpers.methods.confirmSponsorship(matcher.options.address).send({from: sponsor});
116116
117 const collection = await helper.nft.mintCollection(alice, {limits: {sponsorApproveTimeout: 1}, pendingSponsor: alice.address});117 const collection = await helper.nft.mintCollection(alice, {limits: {sponsorApproveTimeout: 1}, pendingSponsor: {Substrate: alice.address}});
118 await collection.confirmSponsorship(alice);118 await collection.confirmSponsorship(alice);
119 await collection.addToAllowList(alice, {Substrate: aliceDoubleMirror});119 await collection.addToAllowList(alice, {Substrate: aliceDoubleMirror});
120 const evmCollection = await helper.ethNativeContract.collection(helper.ethAddress.fromCollectionId(collection.collectionId), 'nft');120 const evmCollection = await helper.ethNativeContract.collection(helper.ethAddress.fromCollectionId(collection.collectionId), 'nft');
modifiedtests/src/eth/nesting/nest.test.tsdiffbeforeafterboth
6const createNestingCollection = async (6const createNestingCollection = async (
7 helper: EthUniqueHelper,7 helper: EthUniqueHelper,
8 owner: string,8 owner: string,
9 mergeDeprecated = false,
9): Promise<{ collectionId: number, collectionAddress: string, contract: Contract }> => {10): Promise<{ collectionId: number, collectionAddress: string, contract: Contract }> => {
10 const {collectionAddress, collectionId} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C');11 const {collectionAddress, collectionId} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C');
1112
12 const contract = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner);13 const contract = await helper.ethNativeContract.collection(collectionAddress, 'nft', owner, mergeDeprecated);
13 await contract.methods.setCollectionNesting(true).send({from: owner});14 await contract.methods.setCollectionNesting([true, false, []]).send({from: owner});
1415
15 return {collectionId, collectionAddress, contract};16 return {collectionId, collectionAddress, contract};
16};17};
52 expect(await contract.methods.ownerOf(secondTokenId).call()).to.be.equal(owner);53 expect(await contract.methods.ownerOf(secondTokenId).call()).to.be.equal(owner);
53 });54 });
5455
56 itEth('NFT: collectionNesting()', async ({helper}) => {
57 const owner = await helper.eth.createAccountWithBalance(donor);
58 const {collectionAddress: unnestedCollectionAddress} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C');
59 const unnestedContract = await helper.ethNativeContract.collection(unnestedCollectionAddress, 'nft', owner);
60 expect(await unnestedContract.methods.collectionNesting().call({from: owner})).to.be.like([false, false, []]);
61
62 const {contract} = await createNestingCollection(helper, owner);
63 expect(await contract.methods.collectionNesting().call({from: owner})).to.be.like([true, false, []]);
64 await contract.methods.setCollectionNesting([true, false, [unnestedCollectionAddress]]).send({from: owner});
65 expect(await contract.methods.collectionNesting().call({from: owner})).to.be.like([true, false, [unnestedCollectionAddress]]);
66 await contract.methods.setCollectionNesting([false, true, [unnestedCollectionAddress]]).send({from: owner});
67 expect(await contract.methods.collectionNesting().call({from: owner})).to.be.like([false, true, [unnestedCollectionAddress]]);
68 await contract.methods.setCollectionNesting([false, false, []]).send({from: owner});
69 expect(await contract.methods.collectionNesting().call({from: owner})).to.be.like([false, false, []]);
70 });
71
72 // Sof-deprecated
55 itEth('NFT: collectionNestingRestrictedCollectionIds() & collectionNestingPermissions', async ({helper}) => {73 itEth('NFT: collectionNestingRestrictedCollectionIds() & collectionNestingPermissions', async ({helper}) => {
56 const owner = await helper.eth.createAccountWithBalance(donor);74 const owner = await helper.eth.createAccountWithBalance(donor);
57 const {collectionId: unnestedCollsectionId, collectionAddress: unnsetedCollectionAddress} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C');75 const {collectionId: unnestedCollsectionId, collectionAddress: unnsetedCollectionAddress} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C');
58 const unnestedContract = await helper.ethNativeContract.collection(unnsetedCollectionAddress, 'nft', owner);76 const unnestedContract = await helper.ethNativeContract.collection(unnsetedCollectionAddress, 'nft', owner, true);
59 expect(await unnestedContract.methods.collectionNestingRestrictedCollectionIds().call({from: owner})).to.be.like([false, []]);77 expect(await unnestedContract.methods.collectionNestingRestrictedCollectionIds().call({from: owner})).to.be.like([false, []]);
6078
61 const {contract} = await createNestingCollection(helper, owner);79 const {contract} = await createNestingCollection(helper, owner, true);
62 expect(await contract.methods.collectionNestingRestrictedCollectionIds().call({from: owner})).to.be.like([true, []]);80 expect(await contract.methods.collectionNestingRestrictedCollectionIds().call({from: owner})).to.be.like([true, []]);
63 await contract.methods.setCollectionNesting(true, [unnsetedCollectionAddress]).send({from: owner});81 await contract.methods['setCollectionNesting(bool,address[])'](true, [unnsetedCollectionAddress]).send({from: owner});
64 expect(await contract.methods.collectionNestingRestrictedCollectionIds().call({from: owner})).to.be.like([true, [unnestedCollsectionId.toString()]]);82 expect(await contract.methods.collectionNestingRestrictedCollectionIds().call({from: owner})).to.be.like([true, [unnestedCollsectionId.toString()]]);
65 expect(await contract.methods.collectionNestingPermissions().call({from: owner})).to.be.like([['1', false], ['0', true]]);83 expect(await contract.methods.collectionNestingPermissions().call({from: owner})).to.be.like([['1', false], ['0', true]]);
66 await contract.methods.setCollectionNesting(false).send({from: owner});84 await contract.methods['setCollectionNesting(bool)'](false).send({from: owner});
67 expect(await contract.methods.collectionNestingPermissions().call({from: owner})).to.be.like([['1', false], ['0', false]]);85 expect(await contract.methods.collectionNestingPermissions().call({from: owner})).to.be.like([['1', false], ['0', false]]);
68 });86 });
6987
70 itEth('NFT: allows an Owner to nest/unnest their token (Restricted nesting)', async ({helper}) => {88 itEth('NFT: allows an Owner to nest/unnest their token (Restricted nesting)', async ({helper}) => {
71 const owner = await helper.eth.createAccountWithBalance(donor);89 const owner = await helper.eth.createAccountWithBalance(donor);
7290
73 const {collectionId: collectionIdA, collectionAddress: collectionAddressA, contract: contractA} = await createNestingCollection(helper, owner);91 const {collectionId: collectionIdA, contract: contractA} = await createNestingCollection(helper, owner);
74 const {collectionAddress: collectionAddressB, contract: contractB} = await createNestingCollection(helper, owner);92 const {contract: contractB} = await createNestingCollection(helper, owner);
75 await contractA.methods.setCollectionNesting(true, [collectionAddressA, collectionAddressB]).send({from: owner});93 await contractA.methods.setCollectionNesting([true, false, [contractA.options.address, contractB.options.address]]).send({from: owner});
7694
77 // Create a token to nest into95 // Create a token to nest into
78 const mintingtargetNftTokenIdResult = await contractA.methods.mint(owner).send({from: owner});96 const mintingtargetNftTokenIdResult = await contractA.methods.mint(owner).send({from: owner});
101 const owner = await helper.eth.createAccountWithBalance(donor);119 const owner = await helper.eth.createAccountWithBalance(donor);
102120
103 const {collectionId, contract} = await createNestingCollection(helper, owner);121 const {collectionId, contract} = await createNestingCollection(helper, owner);
104 await contract.methods.setCollectionNesting(false).send({from: owner});122 await contract.methods.setCollectionNesting([false, false, []]).send({from: owner});
105123
106 // Create a token to nest into124 // Create a token to nest into
107 const mintingTargetTokenIdResult = await contract.methods.mint(owner).send({from: owner});125 const mintingTargetTokenIdResult = await contract.methods.mint(owner).send({from: owner});
143 const owner = await helper.eth.createAccountWithBalance(donor);161 const owner = await helper.eth.createAccountWithBalance(donor);
144 const malignant = await helper.eth.createAccountWithBalance(donor);162 const malignant = await helper.eth.createAccountWithBalance(donor);
145163
146 const {collectionId: collectionIdA, collectionAddress: collectionAddressA, contract: contractA} = await createNestingCollection(helper, owner);164 const {collectionId: collectionIdA, contract: contractA} = await createNestingCollection(helper, owner);
147 const {collectionAddress: collectionAddressB, contract: contractB} = await createNestingCollection(helper, owner);165 const {collectionId: collectionIdB, contract: contractB} = await createNestingCollection(helper, owner);
148166
149 await contractA.methods.setCollectionNesting(true, [collectionAddressA, collectionAddressB]).send({from: owner});167 await contractA.methods.setCollectionNesting([true, false, [contractA.options.address, contractB.options.address]]).send({from: owner});
150168
151 // Create a token in one collection169 // Create a token in one collection
152 const mintingTokenIdAResult = await contractA.methods.mint(owner).send({from: owner});170 const mintingTokenIdAResult = await contractA.methods.mint(owner).send({from: owner});
166 itEth('NFT: disallows to nest token in an unlisted collection', async ({helper}) => {184 itEth('NFT: disallows to nest token in an unlisted collection', async ({helper}) => {
167 const owner = await helper.eth.createAccountWithBalance(donor);185 const owner = await helper.eth.createAccountWithBalance(donor);
168186
169 const {collectionId: collectionIdA, collectionAddress: collectionAddressA, contract: contractA} = await createNestingCollection(helper, owner);187 const {collectionId: collectionIdA, contract: contractA} = await createNestingCollection(helper, owner);
170 const {contract: contractB} = await createNestingCollection(helper, owner);188 const {contract: contractB} = await createNestingCollection(helper, owner);
171189
172 await contractA.methods.setCollectionNesting(true, [collectionAddressA]).send({from: owner});190 await contractA.methods.setCollectionNesting([true, false, [contractA.options.address]]).send({from: owner});
173191
174 // Create a token in one collection192 // Create a token in one collection
175 const mintingTokenIdAResult = await contractA.methods.mint(owner).send({from: owner});193 const mintingTokenIdAResult = await contractA.methods.mint(owner).send({from: owner});
251 itEth(`Disallow nest into collection without nesting permission [${testCase.mode}] (except for native fungible collection)`, async ({helper}) => {269 itEth(`Disallow nest into collection without nesting permission [${testCase.mode}] (except for native fungible collection)`, async ({helper}) => {
252 const owner = await helper.eth.createAccountWithBalance(donor);270 const owner = await helper.eth.createAccountWithBalance(donor);
253 const {collectionId: targetCollectionId, contract: targetContract} = await createNestingCollection(helper, owner);271 const {collectionId: targetCollectionId, contract: targetContract} = await createNestingCollection(helper, owner);
254 await targetContract.methods.setCollectionNesting(false).send({from: owner});272 await targetContract.methods.setCollectionNesting([false, false, []]).send({from: owner});
255273
256 const {contract: ftContract} = await createFungibleCollection(helper, owner, testCase.mode);274 const {contract: ftContract} = await createFungibleCollection(helper, owner, testCase.mode);
257275
modifiedtests/src/eth/tokenProperties.test.tsdiffbeforeafterboth
20import {ITokenPropertyPermission} from '../util/playgrounds/types';20import {ITokenPropertyPermission} from '../util/playgrounds/types';
21import {Pallets} from '../util';21import {Pallets} from '../util';
22import {UniqueNFTCollection, UniqueNFToken, UniqueRFTCollection} from '../util/playgrounds/unique';22import {UniqueNFTCollection, UniqueNFToken, UniqueRFTCollection} from '../util/playgrounds/unique';
23import {TokenPermissionField} from './util/playgrounds/types';23import {CreateCollectionData, TokenPermissionField} from './util/playgrounds/types';
2424
25describe('EVM token properties', () => {25describe('EVM token properties', () => {
26 let donor: IKeyringPair;26 let donor: IKeyringPair;
41 const owner = await helper.eth.createAccountWithBalance(donor);41 const owner = await helper.eth.createAccountWithBalance(donor);
42 const caller = await helper.ethCrossAccount.createAccountWithBalance(donor);42 const caller = await helper.ethCrossAccount.createAccountWithBalance(donor);
43 for(const [mutable,collectionAdmin, tokenOwner] of cartesian([], [false, true], [false, true], [false, true])) {43 for(const [mutable,collectionAdmin, tokenOwner] of cartesian([], [false, true], [false, true], [false, true])) {
44 const {collectionId, collectionAddress} = await helper.eth.createCollection(testCase.mode, owner, 'A', 'B', 'C');44 const {collectionId, collectionAddress} = await helper.eth.createCollection(owner, new CreateCollectionData('A', 'B', 'C', testCase.mode)).send();
45 const collection = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner);45 const collection = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner);
46 await collection.methods.addCollectionAdminCross(caller).send({from: owner});46 await collection.methods.addCollectionAdminCross(caller).send({from: owner});
4747
75 itEth.ifWithPallets(`[${testCase.mode}] Can set multiple token property permissions as owner`, testCase.requiredPallets, async({helper}) => {75 itEth.ifWithPallets(`[${testCase.mode}] Can set multiple token property permissions as owner`, testCase.requiredPallets, async({helper}) => {
76 const owner = await helper.eth.createAccountWithBalance(donor);76 const owner = await helper.eth.createAccountWithBalance(donor);
7777
78 const {collectionId, collectionAddress} = await helper.eth.createCollection(testCase.mode, owner, 'A', 'B', 'C');78 const {collectionId, collectionAddress} = await helper.eth.createCollection(owner, new CreateCollectionData('A', 'B', 'C', testCase.mode)).send();
79 const collection = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner);79 const collection = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner);
8080
81 await collection.methods.setTokenPropertyPermissions([81 await collection.methods.setTokenPropertyPermissions([
138 const owner = await helper.eth.createAccountWithBalance(donor);138 const owner = await helper.eth.createAccountWithBalance(donor);
139 const caller = await helper.ethCrossAccount.createAccountWithBalance(donor);139 const caller = await helper.ethCrossAccount.createAccountWithBalance(donor);
140140
141 const {collectionId, collectionAddress} = await helper.eth.createCollection(testCase.mode, owner, 'A', 'B', 'C');141 const {collectionId, collectionAddress} = await helper.eth.createCollection(owner, new CreateCollectionData('A', 'B', 'C', testCase.mode)).send();
142 const collection = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner);142 const collection = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner);
143 await collection.methods.addCollectionAdminCross(caller).send({from: owner});143 await collection.methods.addCollectionAdminCross(caller).send({from: owner});
144144
455 const owner = await helper.eth.createAccountWithBalance(donor);455 const owner = await helper.eth.createAccountWithBalance(donor);
456 const caller = await helper.eth.createAccountWithBalance(donor);456 const caller = await helper.eth.createAccountWithBalance(donor);
457457
458 const {collectionAddress} = await helper.eth.createCollection(testCase.mode, owner, 'A', 'B', 'C');458 const {collectionAddress} = await helper.eth.createCollection(owner, new CreateCollectionData('A', 'B', 'C', testCase.mode)).send();
459 const collection = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner);459 const collection = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner);
460460
461 await expect(collection.methods.setTokenPropertyPermissions([461 await expect(collection.methods.setTokenPropertyPermissions([
474 itEth.ifWithPallets(`[${testCase.mode}] Cannot set token property permissions with invalid character`, testCase.requiredPallets, async({helper}) => {474 itEth.ifWithPallets(`[${testCase.mode}] Cannot set token property permissions with invalid character`, testCase.requiredPallets, async({helper}) => {
475 const owner = await helper.eth.createAccountWithBalance(donor);475 const owner = await helper.eth.createAccountWithBalance(donor);
476476
477 const {collectionAddress} = await helper.eth.createCollection(testCase.mode, owner, 'A', 'B', 'C');477 const {collectionAddress} = await helper.eth.createCollection(owner, new CreateCollectionData('A', 'B', 'C', testCase.mode)).send();
478 const collection = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner);478 const collection = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner);
479479
480 await expect(collection.methods.setTokenPropertyPermissions([480 await expect(collection.methods.setTokenPropertyPermissions([
494 itEth.ifWithPallets(`[${testCase.mode}] Can reconfigure token property permissions to stricter ones`, testCase.requiredPallets, async({helper}) => {494 itEth.ifWithPallets(`[${testCase.mode}] Can reconfigure token property permissions to stricter ones`, testCase.requiredPallets, async({helper}) => {
495 const owner = await helper.eth.createAccountWithBalance(donor);495 const owner = await helper.eth.createAccountWithBalance(donor);
496496
497 const {collectionAddress, collectionId} = await helper.eth.createCollection(testCase.mode, owner, 'A', 'B', 'C');497 const {collectionAddress, collectionId} = await helper.eth.createCollection(owner, new CreateCollectionData('A', 'B', 'C', testCase.mode)).send();
498 const collection = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner);498 const collection = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner);
499499
500 // 1. Owner sets strict property-permissions:500 // 1. Owner sets strict property-permissions:
530 itEth.ifWithPallets(`[${testCase.mode}] Cannot reconfigure token property permissions to less strict ones`, testCase.requiredPallets, async({helper}) => {530 itEth.ifWithPallets(`[${testCase.mode}] Cannot reconfigure token property permissions to less strict ones`, testCase.requiredPallets, async({helper}) => {
531 const owner = await helper.eth.createAccountWithBalance(donor);531 const owner = await helper.eth.createAccountWithBalance(donor);
532532
533 const {collectionAddress} = await helper.eth.createCollection(testCase.mode, owner, 'A', 'B', 'C');533 const {collectionAddress} = await helper.eth.createCollection(owner, new CreateCollectionData('A', 'B', 'C', testCase.mode)).send();
534 const collection = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner);534 const collection = await helper.ethNativeContract.collection(collectionAddress, testCase.mode, owner);
535535
536 // 1. Owner sets strict property-permissions:536 // 1. Owner sets strict property-permissions:
modifiedtests/src/eth/tokens/callMethodsERC20.test.tsdiffbeforeafterboth
17import {Pallets, requirePalletsOrSkip} from '../../util';17import {Pallets, requirePalletsOrSkip} from '../../util';
18import {expect, itEth, usingEthPlaygrounds} from '../util';18import {expect, itEth, usingEthPlaygrounds} from '../util';
19import {IKeyringPair} from '@polkadot/types/types';19import {IKeyringPair} from '@polkadot/types/types';
20import {CreateCollectionData} from '../util/playgrounds/types';
2021
21[22[
22 {mode: 'ft' as const, requiredPallets: []},23 {mode: 'ft' as const, requiredPallets: []},
36 const caller = await helper.eth.createAccountWithBalance(donor);37 const caller = await helper.eth.createAccountWithBalance(donor);
37 const mintingParams = testCase.mode === 'ft' ? [caller, 200n] : [caller];38 const mintingParams = testCase.mode === 'ft' ? [caller, 200n] : [caller];
3839
39 const {collection, collectionId} = await helper.eth.createCollection(testCase.mode, caller, 'TotalSupply', '6', '6');40 const {collection, collectionId} = await helper.eth.createCollection(caller, new CreateCollectionData('TotalSupply', '6', '6', testCase.mode)).send();
40 if(testCase.mode === 'rft') await collection.methods.mint(caller).send({from: caller});41 if(testCase.mode === 'rft') await collection.methods.mint(caller).send({from: caller});
4142
42 // Use collection contract for FT or token contract for RFT:43 // Use collection contract for FT or token contract for RFT:
57 const caller = await helper.eth.createAccountWithBalance(donor);58 const caller = await helper.eth.createAccountWithBalance(donor);
58 const mintingParams = testCase.mode === 'ft' ? [caller, 200n] : [caller];59 const mintingParams = testCase.mode === 'ft' ? [caller, 200n] : [caller];
5960
60 const {collection, collectionId} = await helper.eth.createCollection(testCase.mode, caller, 'BalanceOf', 'Descroption', 'Prefix');61 const {collection, collectionId} = await helper.eth.createCollection(caller, new CreateCollectionData('BalanceOf', 'Descroption', 'Prefix', testCase.mode)).send();
61 if(testCase.mode === 'rft') await collection.methods.mint(caller).send({from: caller});62 if(testCase.mode === 'rft') await collection.methods.mint(caller).send({from: caller});
6263
63 // Use collection contract for FT or token contract for RFT:64 // Use collection contract for FT or token contract for RFT:
7677
77 itEth('decimals', async ({helper}) => {78 itEth('decimals', async ({helper}) => {
78 const caller = await helper.eth.createAccountWithBalance(donor);79 const caller = await helper.eth.createAccountWithBalance(donor);
79 const {collection, collectionId} = await helper.eth.createCollection(testCase.mode, caller, 'BalanceOf', 'Descroption', 'Prefix');80 const {collection, collectionId} = await helper.eth.createCollection(caller, new CreateCollectionData('BalanceOf', 'Descroption', 'Prefix', testCase.mode)).send();
80 if(testCase.mode === 'rft') await collection.methods.mint(caller).send({from: caller});81 if(testCase.mode === 'rft') await collection.methods.mint(caller).send({from: caller});
8182
82 // Use collection contract for FT or token contract for RFT:83 // Use collection contract for FT or token contract for RFT:
modifiedtests/src/eth/tokens/callMethodsERC721.test.tsdiffbeforeafterboth
17import {Pallets} from '../../util';17import {Pallets} from '../../util';
18import {expect, itEth, usingEthPlaygrounds} from '../util';18import {expect, itEth, usingEthPlaygrounds} from '../util';
19import {IKeyringPair} from '@polkadot/types/types';19import {IKeyringPair} from '@polkadot/types/types';
20import {CreateCollectionData} from '../util/playgrounds/types';
2021
2122
22describe('ERC-721 call methods', () => {23describe('ERC-721 call methods', () => {
37 const [callerSub] = await helper.arrange.createAccounts([100n], donor);38 const [callerSub] = await helper.arrange.createAccounts([100n], donor);
38 const [name, description, tokenPrefix] = ['Name', 'Description', 'Symbol'];39 const [name, description, tokenPrefix] = ['Name', 'Description', 'Symbol'];
3940
40 const {collection: collectionEth} = await helper.eth.createCollection(testCase.mode, callerEth, name, description, tokenPrefix);41 const {collection: collectionEth} = await helper.eth.createCollection(callerEth, new CreateCollectionData(name, description, tokenPrefix, testCase.mode)).send();
41 await collectionEth.methods.mint(callerEth).send({from: callerEth});42 await collectionEth.methods.mint(callerEth).send({from: callerEth});
42 const {collectionId} = await helper[testCase.mode].mintCollection(callerSub, {name, description, tokenPrefix});43 const {collectionId} = await helper[testCase.mode].mintCollection(callerSub, {name, description, tokenPrefix});
43 const collectionSub = await helper.ethNativeContract.collectionById(collectionId, testCase.mode, callerEth);44 const collectionSub = await helper.ethNativeContract.collectionById(collectionId, testCase.mode, callerEth);
60 itEth.ifWithPallets(`${testCase.mode.toUpperCase()}: totalSupply`, testCase.requiredPallets, async ({helper}) => {61 itEth.ifWithPallets(`${testCase.mode.toUpperCase()}: totalSupply`, testCase.requiredPallets, async ({helper}) => {
61 const caller = await helper.eth.createAccountWithBalance(donor);62 const caller = await helper.eth.createAccountWithBalance(donor);
6263
63 const {collection} = await helper.eth.createCollection(testCase.mode, caller, 'TotalSupply', '6', '6');64 const {collection} = await helper.eth.createCollection(caller, new CreateCollectionData('TotalSupply', '6', '6', testCase.mode)).send();
64 await collection.methods.mint(caller).send({from: caller});65 await collection.methods.mint(caller).send({from: caller});
6566
66 const totalSupply = await collection.methods.totalSupply().call();67 const totalSupply = await collection.methods.totalSupply().call();
75 itEth.ifWithPallets(`${testCase.mode.toUpperCase()}: balanceOf`, testCase.requiredPallets, async ({helper}) => {76 itEth.ifWithPallets(`${testCase.mode.toUpperCase()}: balanceOf`, testCase.requiredPallets, async ({helper}) => {
76 const caller = await helper.eth.createAccountWithBalance(donor);77 const caller = await helper.eth.createAccountWithBalance(donor);
7778
78 const {collection} = await helper.eth.createCollection(testCase.mode, caller, 'BalanceOf', 'Descroption', 'Prefix');79 const {collection} = await helper.eth.createCollection(caller, new CreateCollectionData('BalanceOf', 'Descroption', 'Prefix', testCase.mode)).send();
79 await collection.methods.mint(caller).send({from: caller});80 await collection.methods.mint(caller).send({from: caller});
80 await collection.methods.mint(caller).send({from: caller});81 await collection.methods.mint(caller).send({from: caller});
81 await collection.methods.mint(caller).send({from: caller});82 await collection.methods.mint(caller).send({from: caller});
91 ].map(testCase => {92 ].map(testCase => {
92 itEth.ifWithPallets(`${testCase.mode.toUpperCase()}: ownerOf`, testCase.requiredPallets, async ({helper}) => {93 itEth.ifWithPallets(`${testCase.mode.toUpperCase()}: ownerOf`, testCase.requiredPallets, async ({helper}) => {
93 const caller = await helper.eth.createAccountWithBalance(donor);94 const caller = await helper.eth.createAccountWithBalance(donor);
94 const {collection} = await helper.eth.createCollection(testCase.mode, caller, 'OwnerOf', '6', '6');95 const {collection} = await helper.eth.createCollection(caller, new CreateCollectionData('OwnerOf', '6', '6', testCase.mode)).send();
9596
96 const result = await collection.methods.mint(caller).send();97 const result = await collection.methods.mint(caller).send();
97 const tokenId = result.events.Transfer.returnValues.tokenId;98 const tokenId = result.events.Transfer.returnValues.tokenId;
108 itEth.ifWithPallets(`${testCase.mode.toUpperCase()}: ownerOf after burn`, testCase.requiredPallets, async ({helper}) => {109 itEth.ifWithPallets(`${testCase.mode.toUpperCase()}: ownerOf after burn`, testCase.requiredPallets, async ({helper}) => {
109 const caller = await helper.eth.createAccountWithBalance(donor);110 const caller = await helper.eth.createAccountWithBalance(donor);
110 const receiver = helper.eth.createAccount();111 const receiver = helper.eth.createAccount();
111 const {collection, collectionId} = await helper.eth.createCollection(testCase.mode, caller, 'OwnerOf-AfterBurn', '6', '6');112 const {collection, collectionId} = await helper.eth.createCollection(caller, new CreateCollectionData('OwnerOf-AfterBurn', '6', '6', testCase.mode)).send();
112113
113 const result = await collection.methods.mint(caller).send();114 const result = await collection.methods.mint(caller).send();
114 const tokenId = result.events.Transfer.returnValues.tokenId;115 const tokenId = result.events.Transfer.returnValues.tokenId;
modifiedtests/src/eth/tokens/minting.test.tsdiffbeforeafterboth
17import {IKeyringPair} from '@polkadot/types/types';17import {IKeyringPair} from '@polkadot/types/types';
18import {Pallets} from '../../util';18import {Pallets} from '../../util';
19import {expect, itEth, usingEthPlaygrounds} from '../util';19import {expect, itEth, usingEthPlaygrounds} from '../util';
20import {CreateCollectionData} from '../util/playgrounds/types';
2021
2122
22describe('Minting tokens', () => {23describe('Minting tokens', () => {
78 const receiver = helper.eth.createAccount();79 const receiver = helper.eth.createAccount();
79 const mintingParams = testCase.mode === 'ft' ? [receiver, 100] : [receiver];80 const mintingParams = testCase.mode === 'ft' ? [receiver, 100] : [receiver];
8081
81 const {collection, collectionAddress, collectionId} = await helper.eth.createCollection(testCase.mode, owner, 'Name', 'Desc', 'Prefix');82 const {collection, collectionAddress, collectionId} = await helper.eth.createCollection(owner, new CreateCollectionData('Name', 'Desc', 'Prefix', testCase.mode)).send();
8283
83 const result = await collection.methods.mint(...mintingParams).send({from: owner});84 const result = await collection.methods.mint(...mintingParams).send({from: owner});
8485
112 const receiver = helper.eth.createAccount();113 const receiver = helper.eth.createAccount();
113 const mintingParams = testCase.mode === 'ft' ? [receiver, 100] : [receiver];114 const mintingParams = testCase.mode === 'ft' ? [receiver, 100] : [receiver];
114115
115 const {collection, collectionAddress, collectionId} = await helper.eth.createCollection(testCase.mode, owner, 'Name', 'Desc', 'Prefix');116 const {collection, collectionAddress, collectionId} = await helper.eth.createCollection(owner, new CreateCollectionData('Name', 'Desc', 'Prefix', testCase.mode)).send();
116117
117 const result = await collection.methods.mint(...mintingParams).send({from: owner});118 const result = await collection.methods.mint(...mintingParams).send({from: owner});
118119
modifiedtests/src/eth/util/playgrounds/types.tsdiffbeforeafterboth
1import {CollectionFlag, TCollectionMode} from '../../../util/playgrounds/types';
2
1export interface ContractImports {3export interface ContractImports {
2 solPath: string;4 solPath: string;
19 value: bigint,21 value: bigint,
20}22}
23
24export type EthAddress = string;
2125
22export interface CrossAddress {26export interface CrossAddress {
23 readonly eth: string,27 readonly eth: EthAddress,
24 readonly sub: string | Uint8Array,28 readonly sub: string | Uint8Array,
25}29}
2630
49 value: OptionUint,53 value: OptionUint,
50}54}
5155
56export interface CollectionLimitValue {
57 field: CollectionLimitField,
58 value: bigint,
59}
60
61export enum CollectionMode {
62 Fungible,
63 Nonfungible,
64 Refungible,
65}
66
67export interface PropertyPermission {
68 code: TokenPermissionField,
69 value: boolean,
70}
71export interface TokenPropertyPermission {
72 key: string,
73 permissions: PropertyPermission[],
74}
75export interface CollectionNestingAndPermission {
76 token_owner: boolean,
77 collection_admin: boolean,
78 restricted: string[],
79}
80
81export const emptyAddress: [string, string] = [
82 '0x0000000000000000000000000000000000000000',
83 '0',
84];
85
86export const CREATE_COLLECTION_DATA_DEFAULTS = {
87 decimals: 0,
88 properties: [],
89 tokenPropertyPermissions: [],
90 adminList: [],
91 nestingSettings: {token_owner: false, collection_admin: false, restricted: []},
92 limits: [],
93 pendingSponsor: emptyAddress,
94 flags: 0,
95};
96
97export interface Property {
98 key: string;
99 value: Buffer;
100}
101
102export class CreateCollectionData {
103 name: string;
104 description: string;
105 tokenPrefix: string;
106 collectionMode: TCollectionMode;
107 decimals? = 0;
108 properties?: Property[] = [];
109 tokenPropertyPermissions?: TokenPropertyPermission[] = [];
110 adminList?: CrossAddress[] = [];
111 nestingSettings?: CollectionNestingAndPermission = {token_owner: false, collection_admin: false, restricted: []};
112 limits?: CollectionLimitValue[] = [];
113 pendingSponsor?: [string, string] = emptyAddress;
114 flags?: number | CollectionFlag[] = [0];
115
116 constructor(
117 name: string,
118 description: string,
119 tokenPrefix: string,
120 collectionMode: TCollectionMode,
121 decimals = 18,
122 ) {
123 this.name = name;
124 this.description = description;
125 this.tokenPrefix = tokenPrefix;
126 this.collectionMode = collectionMode;
127 if(collectionMode == 'ft')
128 this.decimals = decimals;
129 else
130 this.decimals = 0;
131 }
132}
modifiedtests/src/eth/util/playgrounds/unique.dev.tsdiffbeforeafterboth
1818
19import {ArrangeGroup, DevUniqueHelper} from '../../../util/playgrounds/unique.dev';19import {ArrangeGroup, DevUniqueHelper} from '../../../util/playgrounds/unique.dev';
2020
21import {ContractImports, CompiledContract, CrossAddress, NormalizedEvent, EthProperty} from './types';21import {ContractImports, CompiledContract, CrossAddress, NormalizedEvent, EthProperty, CollectionMode, CreateCollectionData} from './types';
2222
23// Native contracts ABI23// Native contracts ABI
24import collectionHelpersAbi from '../../abi/collectionHelpers.json' assert {type: 'json'};24import collectionHelpersAbi from '../../abi/collectionHelpers.json' assert {type: 'json'};
181 }180 }
182}181}
182
183class CreateCollectionTransaction {
184 signer: string;
185 data: CreateCollectionData;
186 mergeDeprecated: boolean;
187 helper: EthUniqueHelper;
188
189 constructor(helper: EthUniqueHelper, signer: string, data: CreateCollectionData, mergeDeprecated = false) {
190 this.helper = helper;
191 this.signer = signer;
192
193 let flags = 0;
194 // convert CollectionFlags to number and join them in one number
195 if(!data.flags || typeof data.flags == 'number') {
196 flags = data.flags ?? 0;
197 } else {
198 for(let i = 0; i < data.flags.length; i++){
199 const flag = data.flags[i];
200 flags = flags | flag;
201 }
202 }
203 data.flags = flags;
204
205 this.data = data;
206 this.mergeDeprecated = mergeDeprecated;
207 }
208
209 private async createTransaction() {
210 const collectionHelper = await this.helper.ethNativeContract.collectionHelpers(this.signer);
211 let collectionMode;
212 switch (this.data.collectionMode) {
213 case 'nft': collectionMode = CollectionMode.Nonfungible; break;
214 case 'rft': collectionMode = CollectionMode.Refungible; break;
215 case 'ft': collectionMode = CollectionMode.Fungible; break;
216 }
217
218 const tx = collectionHelper.methods.createCollection([
219 this.data.pendingSponsor,
220 this.data.name,
221 this.data.description,
222 this.data.tokenPrefix,
223 collectionMode,
224 this.data.decimals,
225 this.data.properties,
226 this.data.tokenPropertyPermissions,
227 this.data.adminList,
228 this.data.nestingSettings,
229 this.data.limits,
230 this.data.flags,
231 ]);
232 return tx;
233 }
234
235 async send(options?: any): Promise<{ collectionId: number, collectionAddress: string, events: NormalizedEvent[], collection: Contract }> {
236 const collectionCreationPrice = {
237 value: Number(this.helper.balance.getCollectionCreationPrice()),
238 };
239 const tx = await this.createTransaction();
240 const result = await tx.send({...options, ...collectionCreationPrice});
241
242 const collectionAddress = this.helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId);
243 const collectionId = this.helper.ethAddress.extractCollectionId(collectionAddress);
244 const events = this.helper.eth.normalizeEvents(result.events);
245 const collection = await this.helper.ethNativeContract.collectionById(collectionId, this.data.collectionMode, this.signer, this.mergeDeprecated);
246
247 return {collectionId, collectionAddress, events, collection};
248 }
249
250 async call(options?: any) {
251 const collectionCreationPrice = {
252 value: Number(this.helper.balance.getCollectionCreationPrice()),
253 };
254 const tx = await this.createTransaction();
255
256 return await tx.call({...options, ...collectionCreationPrice});
257 }
258}
183259
184260
185class EthGroup extends EthGroupBase {261class EthGroup extends EthGroupBase {
236 }312 }
237 }313 }
314
315 createCollection(signer: string, data: CreateCollectionData, mergeDeprecated = false): CreateCollectionTransaction {
316 return new CreateCollectionTransaction(this.helper, signer, data, mergeDeprecated);
317 }
238318
239 async createCollection(mode: TCollectionMode, signer: string, name: string, description: string, tokenPrefix: string, decimals = 18, mergeDeprecated = false): Promise<{ collectionId: number, collectionAddress: string, events: NormalizedEvent[], collection: Contract }> {319 createNFTCollection(signer: string, name: string, description: string, tokenPrefix: string): Promise<{ collectionId: number, collectionAddress: string, events: NormalizedEvent[] }> {
240 const collectionCreationPrice = this.helper.balance.getCollectionCreationPrice();
241 const collectionHelper = await this.helper.ethNativeContract.collectionHelpers(signer);
242 const functionName: string = this.createCollectionMethodName(mode);
243
244 const functionParams = mode === 'ft' ? [name, decimals, description, tokenPrefix] : [name, description, tokenPrefix];
245 const result = await collectionHelper.methods[functionName](...functionParams).send({value: Number(collectionCreationPrice)});
246
247 const collectionAddress = this.helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId);
248 const collectionId = this.helper.ethAddress.extractCollectionId(collectionAddress);
249 const events = this.helper.eth.normalizeEvents(result.events);
250 const collection = await this.helper.ethNativeContract.collectionById(collectionId, mode, signer, mergeDeprecated);320 return this.createCollection(signer, new CreateCollectionData(name, description, tokenPrefix, 'nft')).send();
251
252 return {collectionId, collectionAddress, events, collection};
253 }321 }
254322
255 createNFTCollection(signer: string, name: string, description: string, tokenPrefix: string): Promise<{ collectionId: number, collectionAddress: string, events: NormalizedEvent[] }> {323 async createERC721MetadataCompatibleCollection(signer: string, data: CreateCollectionData, baseUri: string): Promise<{ collectionId: number, collectionAddress: string, events: NormalizedEvent[] }> {
324 const collectionHelper = await this.helper.ethNativeContract.collectionHelpers(signer);
325
256 return this.createCollection('nft', signer, name, description, tokenPrefix);326 const {collectionId, collectionAddress, events} = await this.createCollection(signer, data).send();
327
328 await collectionHelper.methods.makeCollectionERC721MetadataCompatible(collectionAddress, baseUri).send();
329
330 return {collectionId, collectionAddress, events};
257 }331 }
258332
259 async createERC721MetadataCompatibleNFTCollection(signer: string, name: string, description: string, tokenPrefix: string, baseUri: string): Promise<{ collectionId: number, collectionAddress: string, events: NormalizedEvent[] }> {333 async createERC721MetadataCompatibleNFTCollection(signer: string, name: string, description: string, tokenPrefix: string, baseUri: string): Promise<{ collectionId: number, collectionAddress: string, events: NormalizedEvent[] }> {
260 const collectionHelper = await this.helper.ethNativeContract.collectionHelpers(signer);334 const collectionHelper = await this.helper.ethNativeContract.collectionHelpers(signer);
261335
262 const {collectionId, collectionAddress, events} = await this.createCollection('nft', signer, name, description, tokenPrefix);336 const {collectionId, collectionAddress, events} = await this.createCollection(signer, new CreateCollectionData(name, description, tokenPrefix, 'nft')).send();
263337
264 await collectionHelper.methods.makeCollectionERC721MetadataCompatible(collectionAddress, baseUri).send();338 await collectionHelper.methods.makeCollectionERC721MetadataCompatible(collectionAddress, baseUri).send();
265339
266 return {collectionId, collectionAddress, events};340 return {collectionId, collectionAddress, events};
267 }341 }
268342
269 createRFTCollection(signer: string, name: string, description: string, tokenPrefix: string): Promise<{ collectionId: number, collectionAddress: string, events: NormalizedEvent[] }> {343 createRFTCollection(signer: string, name: string, description: string, tokenPrefix: string): Promise<{ collectionId: number, collectionAddress: string, events: NormalizedEvent[] }> {
270 return this.createCollection('rft', signer, name, description, tokenPrefix);344 return this.createCollection(signer, new CreateCollectionData(name, description, tokenPrefix, 'rft')).send();
271 }345 }
272346
273 createFungibleCollection(signer: string, name: string, decimals: number, description: string, tokenPrefix: string): Promise<{ collectionId: number, collectionAddress: string, events: NormalizedEvent[] }> {347 createFungibleCollection(signer: string, name: string, decimals: number, description: string, tokenPrefix: string): Promise<{ collectionId: number, collectionAddress: string, events: NormalizedEvent[] }> {
274 return this.createCollection('ft', signer, name, description, tokenPrefix, decimals);348 return this.createCollection(signer, new CreateCollectionData(name, description, tokenPrefix, 'ft')).send();
275 }349 }
276350
277 async createERC721MetadataCompatibleRFTCollection(signer: string, name: string, description: string, tokenPrefix: string, baseUri: string): Promise<{ collectionId: number, collectionAddress: string, events: NormalizedEvent[] }> {351 async createERC721MetadataCompatibleRFTCollection(signer: string, name: string, description: string, tokenPrefix: string, baseUri: string): Promise<{ collectionId: number, collectionAddress: string, events: NormalizedEvent[] }> {
278 const collectionHelper = await this.helper.ethNativeContract.collectionHelpers(signer);352 const collectionHelper = await this.helper.ethNativeContract.collectionHelpers(signer);
279353
280 const {collectionId, collectionAddress, events} = await this.createCollection('rft', signer, name, description, tokenPrefix);354 const {collectionId, collectionAddress, events} = await this.createCollection(signer, new CreateCollectionData(name, description, tokenPrefix, 'rft')).send();
281355
282 await collectionHelper.methods.makeCollectionERC721MetadataCompatible(collectionAddress, baseUri).send();356 await collectionHelper.methods.makeCollectionERC721MetadataCompatible(collectionAddress, baseUri).send();
283357
432 };506 };
433 }507 }
508
509 fromAddr(address: TEthereumAccount): [string, string] {
510 return [
511 address,
512 '0',
513 ];
514 }
434515
435 fromKeyringPair(keyring: IKeyringPair): CrossAddress {516 fromKeyringPair(keyring: IKeyringPair): CrossAddress {
436 return {517 return {
modifiedtests/src/interfaces/augment-api-tx.tsdiffbeforeafterboth
1499 * 1499 *
1500 * * `data`: Explicit data of a collection used for its creation.1500 * * `data`: Explicit data of a collection used for its creation.
1501 **/1501 **/
1502 createCollectionEx: AugmentedSubmittable<(data: UpDataStructsCreateCollectionData | { mode?: any; access?: any; name?: any; description?: any; tokenPrefix?: any; pendingSponsor?: any; limits?: any; permissions?: any; tokenPropertyPermissions?: any; properties?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [UpDataStructsCreateCollectionData]>;1502 createCollectionEx: AugmentedSubmittable<(data: UpDataStructsCreateCollectionData | { mode?: any; access?: any; name?: any; description?: any; tokenPrefix?: any; limits?: any; permissions?: any; tokenPropertyPermissions?: any; properties?: any; adminList?: any; pendingSponsor?: any; flags?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [UpDataStructsCreateCollectionData]>;
1503 /**1503 /**
1504 * Mint an item within a collection.1504 * Mint an item within a collection.
1505 * 1505 *
modifiedtests/src/interfaces/augment-types.tsdiffbeforeafterboth
25import type { CollectiveOrigin, MemberCount, ProposalIndex, Votes, VotesTo230 } from '@polkadot/types/interfaces/collective';25import type { CollectiveOrigin, MemberCount, ProposalIndex, Votes, VotesTo230 } from '@polkadot/types/interfaces/collective';
26import type { AuthorityId, RawVRFOutput } from '@polkadot/types/interfaces/consensus';26import type { AuthorityId, RawVRFOutput } from '@polkadot/types/interfaces/consensus';
27import type { AliveContractInfo, CodeHash, CodeSource, CodeUploadRequest, CodeUploadResult, CodeUploadResultValue, ContractCallFlags, ContractCallRequest, ContractExecResult, ContractExecResultOk, ContractExecResultResult, ContractExecResultSuccessTo255, ContractExecResultSuccessTo260, ContractExecResultTo255, ContractExecResultTo260, ContractExecResultTo267, ContractExecResultU64, ContractInfo, ContractInstantiateResult, ContractInstantiateResultTo267, ContractInstantiateResultTo299, ContractInstantiateResultU64, ContractReturnFlags, ContractStorageKey, DeletedContract, ExecReturnValue, Gas, HostFnWeights, HostFnWeightsTo264, InstantiateRequest, InstantiateRequestV1, InstantiateRequestV2, InstantiateReturnValue, InstantiateReturnValueOk, InstantiateReturnValueTo267, InstructionWeights, Limits, LimitsTo264, PrefabWasmModule, RentProjection, Schedule, ScheduleTo212, ScheduleTo258, ScheduleTo264, SeedOf, StorageDeposit, TombstoneContractInfo, TrieId } from '@polkadot/types/interfaces/contracts';27import type { AliveContractInfo, CodeHash, CodeSource, CodeUploadRequest, CodeUploadResult, CodeUploadResultValue, ContractCallFlags, ContractCallRequest, ContractExecResult, ContractExecResultOk, ContractExecResultResult, ContractExecResultSuccessTo255, ContractExecResultSuccessTo260, ContractExecResultTo255, ContractExecResultTo260, ContractExecResultTo267, ContractExecResultU64, ContractInfo, ContractInstantiateResult, ContractInstantiateResultTo267, ContractInstantiateResultTo299, ContractInstantiateResultU64, ContractReturnFlags, ContractStorageKey, DeletedContract, ExecReturnValue, Gas, HostFnWeights, HostFnWeightsTo264, InstantiateRequest, InstantiateRequestV1, InstantiateRequestV2, InstantiateReturnValue, InstantiateReturnValueOk, InstantiateReturnValueTo267, InstructionWeights, Limits, LimitsTo264, PrefabWasmModule, RentProjection, Schedule, ScheduleTo212, ScheduleTo258, ScheduleTo264, SeedOf, StorageDeposit, TombstoneContractInfo, TrieId } from '@polkadot/types/interfaces/contracts';
28import type { ContractConstructorSpecLatest, ContractConstructorSpecV0, ContractConstructorSpecV1, ContractConstructorSpecV2, ContractConstructorSpecV3, ContractConstructorSpecV4, ContractContractSpecV0, ContractContractSpecV1, ContractContractSpecV2, ContractContractSpecV3, ContractContractSpecV4, ContractCryptoHasher, ContractDiscriminant, ContractDisplayName, ContractEnvironmentV4, ContractEventParamSpecLatest, ContractEventParamSpecV0, ContractEventParamSpecV2, ContractEventSpecLatest, ContractEventSpecV0, ContractEventSpecV1, ContractEventSpecV2, ContractLayoutArray, ContractLayoutCell, ContractLayoutEnum, ContractLayoutHash, ContractLayoutHashingStrategy, ContractLayoutKey, ContractLayoutStruct, ContractLayoutStructField, ContractMessageParamSpecLatest, ContractMessageParamSpecV0, ContractMessageParamSpecV2, ContractMessageSpecLatest, ContractMessageSpecV0, ContractMessageSpecV1, ContractMessageSpecV2, ContractMessageSpecV3, ContractMetadata, ContractMetadataLatest, ContractMetadataV0, ContractMetadataV1, ContractMetadataV2, ContractMetadataV3, ContractMetadataV4, ContractProject, ContractProjectContract, ContractProjectInfo, ContractProjectSource, ContractProjectV0, ContractSelector, ContractStorageLayout, ContractTypeSpec } from '@polkadot/types/interfaces/contractsAbi';28import type { ContractConstructorSpecLatest, ContractConstructorSpecV0, ContractConstructorSpecV1, ContractConstructorSpecV2, ContractConstructorSpecV3, ContractContractSpecV0, ContractContractSpecV1, ContractContractSpecV2, ContractContractSpecV3, ContractContractSpecV4, ContractCryptoHasher, ContractDiscriminant, ContractDisplayName, ContractEventParamSpecLatest, ContractEventParamSpecV0, ContractEventParamSpecV2, ContractEventSpecLatest, ContractEventSpecV0, ContractEventSpecV1, ContractEventSpecV2, ContractLayoutArray, ContractLayoutCell, ContractLayoutEnum, ContractLayoutHash, ContractLayoutHashingStrategy, ContractLayoutKey, ContractLayoutStruct, ContractLayoutStructField, ContractMessageParamSpecLatest, ContractMessageParamSpecV0, ContractMessageParamSpecV2, ContractMessageSpecLatest, ContractMessageSpecV0, ContractMessageSpecV1, ContractMessageSpecV2, ContractMetadata, ContractMetadataLatest, ContractMetadataV0, ContractMetadataV1, ContractMetadataV2, ContractMetadataV3, ContractMetadataV4, ContractProject, ContractProjectContract, ContractProjectInfo, ContractProjectSource, ContractProjectV0, ContractSelector, ContractStorageLayout, ContractTypeSpec } from '@polkadot/types/interfaces/contractsAbi';
29import type { FundIndex, FundInfo, LastContribution, TrieIndex } from '@polkadot/types/interfaces/crowdloan';29import type { FundIndex, FundInfo, LastContribution, TrieIndex } from '@polkadot/types/interfaces/crowdloan';
30import type { CollationInfo, CollationInfoV1, ConfigData, MessageId, OverweightIndex, PageCounter, PageIndexData } from '@polkadot/types/interfaces/cumulus';30import type { CollationInfo, CollationInfoV1, ConfigData, MessageId, OverweightIndex, PageCounter, PageIndexData } from '@polkadot/types/interfaces/cumulus';
31import type { AccountVote, AccountVoteSplit, AccountVoteStandard, Conviction, Delegations, PreimageStatus, PreimageStatusAvailable, PriorLock, PropIndex, Proposal, ProxyState, ReferendumIndex, ReferendumInfo, ReferendumInfoFinished, ReferendumInfoTo239, ReferendumStatus, Tally, Voting, VotingDelegating, VotingDirect, VotingDirectVote } from '@polkadot/types/interfaces/democracy';31import type { AccountVote, AccountVoteSplit, AccountVoteStandard, Conviction, Delegations, PreimageStatus, PreimageStatusAvailable, PriorLock, PropIndex, Proposal, ProxyState, ReferendumIndex, ReferendumInfo, ReferendumInfoFinished, ReferendumInfoTo239, ReferendumStatus, Tally, Voting, VotingDelegating, VotingDirect, VotingDirectVote } from '@polkadot/types/interfaces/democracy';
254 ContractConstructorSpecV1: ContractConstructorSpecV1;254 ContractConstructorSpecV1: ContractConstructorSpecV1;
255 ContractConstructorSpecV2: ContractConstructorSpecV2;255 ContractConstructorSpecV2: ContractConstructorSpecV2;
256 ContractConstructorSpecV3: ContractConstructorSpecV3;256 ContractConstructorSpecV3: ContractConstructorSpecV3;
257 ContractConstructorSpecV4: ContractConstructorSpecV4;
258 ContractContractSpecV0: ContractContractSpecV0;257 ContractContractSpecV0: ContractContractSpecV0;
259 ContractContractSpecV1: ContractContractSpecV1;258 ContractContractSpecV1: ContractContractSpecV1;
260 ContractContractSpecV2: ContractContractSpecV2;259 ContractContractSpecV2: ContractContractSpecV2;
263 ContractCryptoHasher: ContractCryptoHasher;262 ContractCryptoHasher: ContractCryptoHasher;
264 ContractDiscriminant: ContractDiscriminant;263 ContractDiscriminant: ContractDiscriminant;
265 ContractDisplayName: ContractDisplayName;264 ContractDisplayName: ContractDisplayName;
266 ContractEnvironmentV4: ContractEnvironmentV4;
267 ContractEventParamSpecLatest: ContractEventParamSpecLatest;265 ContractEventParamSpecLatest: ContractEventParamSpecLatest;
268 ContractEventParamSpecV0: ContractEventParamSpecV0;266 ContractEventParamSpecV0: ContractEventParamSpecV0;
269 ContractEventParamSpecV2: ContractEventParamSpecV2;267 ContractEventParamSpecV2: ContractEventParamSpecV2;
300 ContractMessageSpecV0: ContractMessageSpecV0;298 ContractMessageSpecV0: ContractMessageSpecV0;
301 ContractMessageSpecV1: ContractMessageSpecV1;299 ContractMessageSpecV1: ContractMessageSpecV1;
302 ContractMessageSpecV2: ContractMessageSpecV2;300 ContractMessageSpecV2: ContractMessageSpecV2;
303 ContractMessageSpecV3: ContractMessageSpecV3;
304 ContractMetadata: ContractMetadata;301 ContractMetadata: ContractMetadata;
305 ContractMetadataLatest: ContractMetadataLatest;302 ContractMetadataLatest: ContractMetadataLatest;
306 ContractMetadataV0: ContractMetadataV0;303 ContractMetadataV0: ContractMetadataV0;
modifiedtests/src/interfaces/default/types.tsdiffbeforeafterboth
3221 readonly name: Vec<u16>;3221 readonly name: Vec<u16>;
3222 readonly description: Vec<u16>;3222 readonly description: Vec<u16>;
3223 readonly tokenPrefix: Bytes;3223 readonly tokenPrefix: Bytes;
3224 readonly pendingSponsor: Option<AccountId32>;
3225 readonly limits: Option<UpDataStructsCollectionLimits>;3224 readonly limits: Option<UpDataStructsCollectionLimits>;
3226 readonly permissions: Option<UpDataStructsCollectionPermissions>;3225 readonly permissions: Option<UpDataStructsCollectionPermissions>;
3227 readonly tokenPropertyPermissions: Vec<UpDataStructsPropertyKeyPermission>;3226 readonly tokenPropertyPermissions: Vec<UpDataStructsPropertyKeyPermission>;
3228 readonly properties: Vec<UpDataStructsProperty>;3227 readonly properties: Vec<UpDataStructsProperty>;
3228 readonly adminList: Vec<PalletEvmAccountBasicCrossAccountIdRepr>;
3229 readonly pendingSponsor: Option<PalletEvmAccountBasicCrossAccountIdRepr>;
3230 readonly flags: U8aFixed;
3229}3231}
32303232
3231/** @name UpDataStructsCreateFungibleData */3233/** @name UpDataStructsCreateFungibleData */
modifiedtests/src/interfaces/lookup.tsdiffbeforeafterboth
2903 ReFungible: 'Null'2903 ReFungible: 'Null'
2904 }2904 }
2905 },2905 },
2906 /**2906 /**
2907 * Lookup335: up_data_structs::CreateCollectionData<sp_core::crypto::AccountId32>2907 * Lookup335: up_data_structs::CreateCollectionData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
2908 **/2908 **/
2909 UpDataStructsCreateCollectionData: {2909 UpDataStructsCreateCollectionData: {
2910 mode: 'UpDataStructsCollectionMode',2910 mode: 'UpDataStructsCollectionMode',
2911 access: 'Option<UpDataStructsAccessMode>',2911 access: 'Option<UpDataStructsAccessMode>',
2912 name: 'Vec<u16>',2912 name: 'Vec<u16>',
2913 description: 'Vec<u16>',2913 description: 'Vec<u16>',
2914 tokenPrefix: 'Bytes',2914 tokenPrefix: 'Bytes',
2915 pendingSponsor: 'Option<AccountId32>',
2916 limits: 'Option<UpDataStructsCollectionLimits>',2915 limits: 'Option<UpDataStructsCollectionLimits>',
2917 permissions: 'Option<UpDataStructsCollectionPermissions>',2916 permissions: 'Option<UpDataStructsCollectionPermissions>',
2918 tokenPropertyPermissions: 'Vec<UpDataStructsPropertyKeyPermission>',2917 tokenPropertyPermissions: 'Vec<UpDataStructsPropertyKeyPermission>',
2919 properties: 'Vec<UpDataStructsProperty>'2918 properties: 'Vec<UpDataStructsProperty>',
2919 adminList: 'Vec<PalletEvmAccountBasicCrossAccountIdRepr>',
2920 pendingSponsor: 'Option<PalletEvmAccountBasicCrossAccountIdRepr>',
2921 flags: '[u8;1]'
2920 },2922 },
2921 /**2923 /**
2922 * Lookup337: up_data_structs::AccessMode2924 * Lookup337: up_data_structs::AccessMode
2989 key: 'Bytes',2991 key: 'Bytes',
2990 value: 'Bytes'2992 value: 'Bytes'
2991 },2993 },
2992 /**2994 /**
2993 * Lookup360: up_data_structs::CreateItemData2995 * Lookup362: up_data_structs::CreateItemData
2994 **/2996 **/
2995 UpDataStructsCreateItemData: {2997 UpDataStructsCreateItemData: {
2996 _enum: {2998 _enum: {
2997 NFT: 'UpDataStructsCreateNftData',2999 NFT: 'UpDataStructsCreateNftData',
2998 Fungible: 'UpDataStructsCreateFungibleData',3000 Fungible: 'UpDataStructsCreateFungibleData',
2999 ReFungible: 'UpDataStructsCreateReFungibleData'3001 ReFungible: 'UpDataStructsCreateReFungibleData'
3000 }3002 }
3001 },3003 },
3002 /**3004 /**
3003 * Lookup361: up_data_structs::CreateNftData3005 * Lookup363: up_data_structs::CreateNftData
3004 **/3006 **/
3005 UpDataStructsCreateNftData: {3007 UpDataStructsCreateNftData: {
3006 properties: 'Vec<UpDataStructsProperty>'3008 properties: 'Vec<UpDataStructsProperty>'
3007 },3009 },
3008 /**3010 /**
3009 * Lookup362: up_data_structs::CreateFungibleData3011 * Lookup364: up_data_structs::CreateFungibleData
3010 **/3012 **/
3011 UpDataStructsCreateFungibleData: {3013 UpDataStructsCreateFungibleData: {
3012 value: 'u128'3014 value: 'u128'
3013 },3015 },
3014 /**3016 /**
3015 * Lookup363: up_data_structs::CreateReFungibleData3017 * Lookup365: up_data_structs::CreateReFungibleData
3016 **/3018 **/
3017 UpDataStructsCreateReFungibleData: {3019 UpDataStructsCreateReFungibleData: {
3018 pieces: 'u128',3020 pieces: 'u128',
3019 properties: 'Vec<UpDataStructsProperty>'3021 properties: 'Vec<UpDataStructsProperty>'
3020 },3022 },
3021 /**3023 /**
3022 * Lookup366: up_data_structs::CreateItemExData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>3024 * Lookup368: up_data_structs::CreateItemExData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
3023 **/3025 **/
3024 UpDataStructsCreateItemExData: {3026 UpDataStructsCreateItemExData: {
3025 _enum: {3027 _enum: {
3026 NFT: 'Vec<UpDataStructsCreateNftExData>',3028 NFT: 'Vec<UpDataStructsCreateNftExData>',
3029 RefungibleMultipleOwners: 'UpDataStructsCreateRefungibleExMultipleOwners'3031 RefungibleMultipleOwners: 'UpDataStructsCreateRefungibleExMultipleOwners'
3030 }3032 }
3031 },3033 },
3032 /**3034 /**
3033 * Lookup368: up_data_structs::CreateNftExData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>3035 * Lookup370: up_data_structs::CreateNftExData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
3034 **/3036 **/
3035 UpDataStructsCreateNftExData: {3037 UpDataStructsCreateNftExData: {
3036 properties: 'Vec<UpDataStructsProperty>',3038 properties: 'Vec<UpDataStructsProperty>',
3037 owner: 'PalletEvmAccountBasicCrossAccountIdRepr'3039 owner: 'PalletEvmAccountBasicCrossAccountIdRepr'
3038 },3040 },
3039 /**3041 /**
3040 * Lookup375: up_data_structs::CreateRefungibleExSingleOwner<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>3042 * Lookup377: up_data_structs::CreateRefungibleExSingleOwner<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
3041 **/3043 **/
3042 UpDataStructsCreateRefungibleExSingleOwner: {3044 UpDataStructsCreateRefungibleExSingleOwner: {
3043 user: 'PalletEvmAccountBasicCrossAccountIdRepr',3045 user: 'PalletEvmAccountBasicCrossAccountIdRepr',
3044 pieces: 'u128',3046 pieces: 'u128',
3045 properties: 'Vec<UpDataStructsProperty>'3047 properties: 'Vec<UpDataStructsProperty>'
3046 },3048 },
3047 /**3049 /**
3048 * Lookup377: up_data_structs::CreateRefungibleExMultipleOwners<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>3050 * Lookup379: up_data_structs::CreateRefungibleExMultipleOwners<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
3049 **/3051 **/
3050 UpDataStructsCreateRefungibleExMultipleOwners: {3052 UpDataStructsCreateRefungibleExMultipleOwners: {
3051 users: 'BTreeMap<PalletEvmAccountBasicCrossAccountIdRepr, u128>',3053 users: 'BTreeMap<PalletEvmAccountBasicCrossAccountIdRepr, u128>',
3052 properties: 'Vec<UpDataStructsProperty>'3054 properties: 'Vec<UpDataStructsProperty>'
3053 },3055 },
3054 /**3056 /**
3055 * Lookup378: pallet_configuration::pallet::Call<T>3057 * Lookup380: pallet_configuration::pallet::Call<T>
3056 **/3058 **/
3057 PalletConfigurationCall: {3059 PalletConfigurationCall: {
3058 _enum: {3060 _enum: {
3059 set_weight_to_fee_coefficient_override: {3061 set_weight_to_fee_coefficient_override: {
3077 }3079 }
3078 }3080 }
3079 },3081 },
3080 /**3082 /**
3081 * Lookup380: pallet_configuration::AppPromotionConfiguration<BlockNumber>3083 * Lookup382: pallet_configuration::AppPromotionConfiguration<BlockNumber>
3082 **/3084 **/
3083 PalletConfigurationAppPromotionConfiguration: {3085 PalletConfigurationAppPromotionConfiguration: {
3084 recalculationInterval: 'Option<u32>',3086 recalculationInterval: 'Option<u32>',
3085 pendingInterval: 'Option<u32>',3087 pendingInterval: 'Option<u32>',
3086 intervalIncome: 'Option<Perbill>',3088 intervalIncome: 'Option<Perbill>',
3087 maxStakersPerCalculation: 'Option<u8>'3089 maxStakersPerCalculation: 'Option<u8>'
3088 },3090 },
3089 /**3091 /**
3090 * Lookup384: pallet_structure::pallet::Call<T>3092 * Lookup386: pallet_structure::pallet::Call<T>
3091 **/3093 **/
3092 PalletStructureCall: 'Null',3094 PalletStructureCall: 'Null',
3093 /**3095 /**
3094 * Lookup385: pallet_app_promotion::pallet::Call<T>3096 * Lookup387: pallet_app_promotion::pallet::Call<T>
3095 **/3097 **/
3096 PalletAppPromotionCall: {3098 PalletAppPromotionCall: {
3097 _enum: {3099 _enum: {
3098 set_admin_address: {3100 set_admin_address: {
3125 }3127 }
3126 }3128 }
3127 },3129 },
3128 /**3130 /**
3129 * Lookup386: pallet_foreign_assets::module::Call<T>3131 * Lookup388: pallet_foreign_assets::module::Call<T>
3130 **/3132 **/
3131 PalletForeignAssetsModuleCall: {3133 PalletForeignAssetsModuleCall: {
3132 _enum: {3134 _enum: {
3133 register_foreign_asset: {3135 register_foreign_asset: {
3142 }3144 }
3143 }3145 }
3144 },3146 },
3145 /**3147 /**
3146 * Lookup387: pallet_evm::pallet::Call<T>3148 * Lookup389: pallet_evm::pallet::Call<T>
3147 **/3149 **/
3148 PalletEvmCall: {3150 PalletEvmCall: {
3149 _enum: {3151 _enum: {
3150 withdraw: {3152 withdraw: {
3185 }3187 }
3186 }3188 }
3187 },3189 },
3188 /**3190 /**
3189 * Lookup393: pallet_ethereum::pallet::Call<T>3191 * Lookup395: pallet_ethereum::pallet::Call<T>
3190 **/3192 **/
3191 PalletEthereumCall: {3193 PalletEthereumCall: {
3192 _enum: {3194 _enum: {
3193 transact: {3195 transact: {
3194 transaction: 'EthereumTransactionTransactionV2'3196 transaction: 'EthereumTransactionTransactionV2'
3195 }3197 }
3196 }3198 }
3197 },3199 },
3198 /**3200 /**
3199 * Lookup394: ethereum::transaction::TransactionV23201 * Lookup396: ethereum::transaction::TransactionV2
3200 **/3202 **/
3201 EthereumTransactionTransactionV2: {3203 EthereumTransactionTransactionV2: {
3202 _enum: {3204 _enum: {
3203 Legacy: 'EthereumTransactionLegacyTransaction',3205 Legacy: 'EthereumTransactionLegacyTransaction',
3204 EIP2930: 'EthereumTransactionEip2930Transaction',3206 EIP2930: 'EthereumTransactionEip2930Transaction',
3205 EIP1559: 'EthereumTransactionEip1559Transaction'3207 EIP1559: 'EthereumTransactionEip1559Transaction'
3206 }3208 }
3207 },3209 },
3208 /**3210 /**
3209 * Lookup395: ethereum::transaction::LegacyTransaction3211 * Lookup397: ethereum::transaction::LegacyTransaction
3210 **/3212 **/
3211 EthereumTransactionLegacyTransaction: {3213 EthereumTransactionLegacyTransaction: {
3212 nonce: 'U256',3214 nonce: 'U256',
3213 gasPrice: 'U256',3215 gasPrice: 'U256',
3217 input: 'Bytes',3219 input: 'Bytes',
3218 signature: 'EthereumTransactionTransactionSignature'3220 signature: 'EthereumTransactionTransactionSignature'
3219 },3221 },
3220 /**3222 /**
3221 * Lookup396: ethereum::transaction::TransactionAction3223 * Lookup398: ethereum::transaction::TransactionAction
3222 **/3224 **/
3223 EthereumTransactionTransactionAction: {3225 EthereumTransactionTransactionAction: {
3224 _enum: {3226 _enum: {
3225 Call: 'H160',3227 Call: 'H160',
3226 Create: 'Null'3228 Create: 'Null'
3227 }3229 }
3228 },3230 },
3229 /**3231 /**
3230 * Lookup397: ethereum::transaction::TransactionSignature3232 * Lookup399: ethereum::transaction::TransactionSignature
3231 **/3233 **/
3232 EthereumTransactionTransactionSignature: {3234 EthereumTransactionTransactionSignature: {
3233 v: 'u64',3235 v: 'u64',
3234 r: 'H256',3236 r: 'H256',
3235 s: 'H256'3237 s: 'H256'
3236 },3238 },
3237 /**3239 /**
3238 * Lookup399: ethereum::transaction::EIP2930Transaction3240 * Lookup401: ethereum::transaction::EIP2930Transaction
3239 **/3241 **/
3240 EthereumTransactionEip2930Transaction: {3242 EthereumTransactionEip2930Transaction: {
3241 chainId: 'u64',3243 chainId: 'u64',
3242 nonce: 'U256',3244 nonce: 'U256',
3250 r: 'H256',3252 r: 'H256',
3251 s: 'H256'3253 s: 'H256'
3252 },3254 },
3253 /**3255 /**
3254 * Lookup401: ethereum::transaction::AccessListItem3256 * Lookup403: ethereum::transaction::AccessListItem
3255 **/3257 **/
3256 EthereumTransactionAccessListItem: {3258 EthereumTransactionAccessListItem: {
3257 address: 'H160',3259 address: 'H160',
3258 storageKeys: 'Vec<H256>'3260 storageKeys: 'Vec<H256>'
3259 },3261 },
3260 /**3262 /**
3261 * Lookup402: ethereum::transaction::EIP1559Transaction3263 * Lookup404: ethereum::transaction::EIP1559Transaction
3262 **/3264 **/
3263 EthereumTransactionEip1559Transaction: {3265 EthereumTransactionEip1559Transaction: {
3264 chainId: 'u64',3266 chainId: 'u64',
3265 nonce: 'U256',3267 nonce: 'U256',
3274 r: 'H256',3276 r: 'H256',
3275 s: 'H256'3277 s: 'H256'
3276 },3278 },
3277 /**3279 /**
3278 * Lookup403: pallet_evm_contract_helpers::pallet::Call<T>3280 * Lookup405: pallet_evm_contract_helpers::pallet::Call<T>
3279 **/3281 **/
3280 PalletEvmContractHelpersCall: {3282 PalletEvmContractHelpersCall: {
3281 _enum: {3283 _enum: {
3282 migrate_from_self_sponsoring: {3284 migrate_from_self_sponsoring: {
3283 addresses: 'Vec<H160>'3285 addresses: 'Vec<H160>'
3284 }3286 }
3285 }3287 }
3286 },3288 },
3287 /**3289 /**
3288 * Lookup405: pallet_evm_migration::pallet::Call<T>3290 * Lookup407: pallet_evm_migration::pallet::Call<T>
3289 **/3291 **/
3290 PalletEvmMigrationCall: {3292 PalletEvmMigrationCall: {
3291 _enum: {3293 _enum: {
3292 begin: {3294 begin: {
3309 remove_rmrk_data: 'Null'3311 remove_rmrk_data: 'Null'
3310 }3312 }
3311 },3313 },
3312 /**3314 /**
3313 * Lookup409: pallet_maintenance::pallet::Call<T>3315 * Lookup411: pallet_maintenance::pallet::Call<T>
3314 **/3316 **/
3315 PalletMaintenanceCall: {3317 PalletMaintenanceCall: {
3316 _enum: {3318 _enum: {
3317 enable: 'Null',3319 enable: 'Null',
3325 }3327 }
3326 }3328 }
3327 },3329 },
3328 /**3330 /**
3329 * Lookup410: pallet_test_utils::pallet::Call<T>3331 * Lookup412: pallet_test_utils::pallet::Call<T>
3330 **/3332 **/
3331 PalletTestUtilsCall: {3333 PalletTestUtilsCall: {
3332 _enum: {3334 _enum: {
3333 enable: 'Null',3335 enable: 'Null',
3344 }3346 }
3345 }3347 }
3346 },3348 },
3347 /**3349 /**
3348 * Lookup412: pallet_sudo::pallet::Error<T>3350 * Lookup414: pallet_sudo::pallet::Error<T>
3349 **/3351 **/
3350 PalletSudoError: {3352 PalletSudoError: {
3351 _enum: ['RequireSudo']3353 _enum: ['RequireSudo']
3352 },3354 },
3353 /**3355 /**
3354 * Lookup414: orml_vesting::module::Error<T>3356 * Lookup416: orml_vesting::module::Error<T>
3355 **/3357 **/
3356 OrmlVestingModuleError: {3358 OrmlVestingModuleError: {
3357 _enum: ['ZeroVestingPeriod', 'ZeroVestingPeriodCount', 'InsufficientBalanceToLock', 'TooManyVestingSchedules', 'AmountLow', 'MaxVestingSchedulesExceeded']3359 _enum: ['ZeroVestingPeriod', 'ZeroVestingPeriodCount', 'InsufficientBalanceToLock', 'TooManyVestingSchedules', 'AmountLow', 'MaxVestingSchedulesExceeded']
3358 },3360 },
3359 /**3361 /**
3360 * Lookup415: orml_xtokens::module::Error<T>3362 * Lookup417: orml_xtokens::module::Error<T>
3361 **/3363 **/
3362 OrmlXtokensModuleError: {3364 OrmlXtokensModuleError: {
3363 _enum: ['AssetHasNoReserve', 'NotCrossChainTransfer', 'InvalidDest', 'NotCrossChainTransferableCurrency', 'UnweighableMessage', 'XcmExecutionFailed', 'CannotReanchor', 'InvalidAncestry', 'InvalidAsset', 'DestinationNotInvertible', 'BadVersion', 'DistinctReserveForAssetAndFee', 'ZeroFee', 'ZeroAmount', 'TooManyAssetsBeingSent', 'AssetIndexNonExistent', 'FeeNotEnough', 'NotSupportedMultiLocation', 'MinXcmFeeNotDefined']3365 _enum: ['AssetHasNoReserve', 'NotCrossChainTransfer', 'InvalidDest', 'NotCrossChainTransferableCurrency', 'UnweighableMessage', 'XcmExecutionFailed', 'CannotReanchor', 'InvalidAncestry', 'InvalidAsset', 'DestinationNotInvertible', 'BadVersion', 'DistinctReserveForAssetAndFee', 'ZeroFee', 'ZeroAmount', 'TooManyAssetsBeingSent', 'AssetIndexNonExistent', 'FeeNotEnough', 'NotSupportedMultiLocation', 'MinXcmFeeNotDefined']
3364 },3366 },
3365 /**3367 /**
3366 * Lookup418: orml_tokens::BalanceLock<Balance>3368 * Lookup420: orml_tokens::BalanceLock<Balance>
3367 **/3369 **/
3368 OrmlTokensBalanceLock: {3370 OrmlTokensBalanceLock: {
3369 id: '[u8;8]',3371 id: '[u8;8]',
3370 amount: 'u128'3372 amount: 'u128'
3371 },3373 },
3372 /**3374 /**
3373 * Lookup420: orml_tokens::AccountData<Balance>3375 * Lookup422: orml_tokens::AccountData<Balance>
3374 **/3376 **/
3375 OrmlTokensAccountData: {3377 OrmlTokensAccountData: {
3376 free: 'u128',3378 free: 'u128',
3377 reserved: 'u128',3379 reserved: 'u128',
3378 frozen: 'u128'3380 frozen: 'u128'
3379 },3381 },
3380 /**3382 /**
3381 * Lookup422: orml_tokens::ReserveData<ReserveIdentifier, Balance>3383 * Lookup424: orml_tokens::ReserveData<ReserveIdentifier, Balance>
3382 **/3384 **/
3383 OrmlTokensReserveData: {3385 OrmlTokensReserveData: {
3384 id: 'Null',3386 id: 'Null',
3385 amount: 'u128'3387 amount: 'u128'
3386 },3388 },
3387 /**3389 /**
3388 * Lookup424: orml_tokens::module::Error<T>3390 * Lookup426: orml_tokens::module::Error<T>
3389 **/3391 **/
3390 OrmlTokensModuleError: {3392 OrmlTokensModuleError: {
3391 _enum: ['BalanceTooLow', 'AmountIntoBalanceFailed', 'LiquidityRestrictions', 'MaxLocksExceeded', 'KeepAlive', 'ExistentialDeposit', 'DeadAccount', 'TooManyReserves']3393 _enum: ['BalanceTooLow', 'AmountIntoBalanceFailed', 'LiquidityRestrictions', 'MaxLocksExceeded', 'KeepAlive', 'ExistentialDeposit', 'DeadAccount', 'TooManyReserves']
3392 },3394 },
3393 /**3395 /**
3394 * Lookup429: pallet_identity::types::RegistrarInfo<Balance, sp_core::crypto::AccountId32>3396 * Lookup431: pallet_identity::types::RegistrarInfo<Balance, sp_core::crypto::AccountId32>
3395 **/3397 **/
3396 PalletIdentityRegistrarInfo: {3398 PalletIdentityRegistrarInfo: {
3397 account: 'AccountId32',3399 account: 'AccountId32',
3398 fee: 'u128',3400 fee: 'u128',
3399 fields: 'PalletIdentityBitFlags'3401 fields: 'PalletIdentityBitFlags'
3400 },3402 },
3401 /**3403 /**
3402 * Lookup431: pallet_identity::pallet::Error<T>3404 * Lookup433: pallet_identity::pallet::Error<T>
3403 **/3405 **/
3404 PalletIdentityError: {3406 PalletIdentityError: {
3405 _enum: ['TooManySubAccounts', 'NotFound', 'NotNamed', 'EmptyIndex', 'FeeChanged', 'NoIdentity', 'StickyJudgement', 'JudgementGiven', 'InvalidJudgement', 'InvalidIndex', 'InvalidTarget', 'TooManyFields', 'TooManyRegistrars', 'AlreadyClaimed', 'NotSub', 'NotOwned', 'JudgementForDifferentIdentity', 'JudgementPaymentFailed']3407 _enum: ['TooManySubAccounts', 'NotFound', 'NotNamed', 'EmptyIndex', 'FeeChanged', 'NoIdentity', 'StickyJudgement', 'JudgementGiven', 'InvalidJudgement', 'InvalidIndex', 'InvalidTarget', 'TooManyFields', 'TooManyRegistrars', 'AlreadyClaimed', 'NotSub', 'NotOwned', 'JudgementForDifferentIdentity', 'JudgementPaymentFailed']
3406 },3408 },
3407 /**3409 /**
3408 * Lookup432: pallet_preimage::RequestStatus<sp_core::crypto::AccountId32, Balance>3410 * Lookup434: pallet_preimage::RequestStatus<sp_core::crypto::AccountId32, Balance>
3409 **/3411 **/
3410 PalletPreimageRequestStatus: {3412 PalletPreimageRequestStatus: {
3411 _enum: {3413 _enum: {
3412 Unrequested: {3414 Unrequested: {
3420 }3422 }
3421 }3423 }
3422 },3424 },
3423 /**3425 /**
3424 * Lookup437: pallet_preimage::pallet::Error<T>3426 * Lookup439: pallet_preimage::pallet::Error<T>
3425 **/3427 **/
3426 PalletPreimageError: {3428 PalletPreimageError: {
3427 _enum: ['TooBig', 'AlreadyNoted', 'NotAuthorized', 'NotNoted', 'Requested', 'NotRequested']3429 _enum: ['TooBig', 'AlreadyNoted', 'NotAuthorized', 'NotNoted', 'Requested', 'NotRequested']
3428 },3430 },
3429 /**3431 /**
3430 * Lookup439: cumulus_pallet_xcmp_queue::InboundChannelDetails3432 * Lookup441: cumulus_pallet_xcmp_queue::InboundChannelDetails
3431 **/3433 **/
3432 CumulusPalletXcmpQueueInboundChannelDetails: {3434 CumulusPalletXcmpQueueInboundChannelDetails: {
3433 sender: 'u32',3435 sender: 'u32',
3434 state: 'CumulusPalletXcmpQueueInboundState',3436 state: 'CumulusPalletXcmpQueueInboundState',
3435 messageMetadata: 'Vec<(u32,PolkadotParachainPrimitivesXcmpMessageFormat)>'3437 messageMetadata: 'Vec<(u32,PolkadotParachainPrimitivesXcmpMessageFormat)>'
3436 },3438 },
3437 /**3439 /**
3438 * Lookup440: cumulus_pallet_xcmp_queue::InboundState3440 * Lookup442: cumulus_pallet_xcmp_queue::InboundState
3439 **/3441 **/
3440 CumulusPalletXcmpQueueInboundState: {3442 CumulusPalletXcmpQueueInboundState: {
3441 _enum: ['Ok', 'Suspended']3443 _enum: ['Ok', 'Suspended']
3442 },3444 },
3443 /**3445 /**
3444 * Lookup443: polkadot_parachain::primitives::XcmpMessageFormat3446 * Lookup445: polkadot_parachain::primitives::XcmpMessageFormat
3445 **/3447 **/
3446 PolkadotParachainPrimitivesXcmpMessageFormat: {3448 PolkadotParachainPrimitivesXcmpMessageFormat: {
3447 _enum: ['ConcatenatedVersionedXcm', 'ConcatenatedEncodedBlob', 'Signals']3449 _enum: ['ConcatenatedVersionedXcm', 'ConcatenatedEncodedBlob', 'Signals']
3448 },3450 },
3449 /**3451 /**
3450 * Lookup446: cumulus_pallet_xcmp_queue::OutboundChannelDetails3452 * Lookup448: cumulus_pallet_xcmp_queue::OutboundChannelDetails
3451 **/3453 **/
3452 CumulusPalletXcmpQueueOutboundChannelDetails: {3454 CumulusPalletXcmpQueueOutboundChannelDetails: {
3453 recipient: 'u32',3455 recipient: 'u32',
3454 state: 'CumulusPalletXcmpQueueOutboundState',3456 state: 'CumulusPalletXcmpQueueOutboundState',
3455 signalsExist: 'bool',3457 signalsExist: 'bool',
3456 firstIndex: 'u16',3458 firstIndex: 'u16',
3457 lastIndex: 'u16'3459 lastIndex: 'u16'
3458 },3460 },
3459 /**3461 /**
3460 * Lookup447: cumulus_pallet_xcmp_queue::OutboundState3462 * Lookup449: cumulus_pallet_xcmp_queue::OutboundState
3461 **/3463 **/
3462 CumulusPalletXcmpQueueOutboundState: {3464 CumulusPalletXcmpQueueOutboundState: {
3463 _enum: ['Ok', 'Suspended']3465 _enum: ['Ok', 'Suspended']
3464 },3466 },
3465 /**3467 /**
3466 * Lookup449: cumulus_pallet_xcmp_queue::QueueConfigData3468 * Lookup451: cumulus_pallet_xcmp_queue::QueueConfigData
3467 **/3469 **/
3468 CumulusPalletXcmpQueueQueueConfigData: {3470 CumulusPalletXcmpQueueQueueConfigData: {
3469 suspendThreshold: 'u32',3471 suspendThreshold: 'u32',
3470 dropThreshold: 'u32',3472 dropThreshold: 'u32',
3473 weightRestrictDecay: 'SpWeightsWeightV2Weight',3475 weightRestrictDecay: 'SpWeightsWeightV2Weight',
3474 xcmpMaxIndividualWeight: 'SpWeightsWeightV2Weight'3476 xcmpMaxIndividualWeight: 'SpWeightsWeightV2Weight'
3475 },3477 },
3476 /**3478 /**
3477 * Lookup451: cumulus_pallet_xcmp_queue::pallet::Error<T>3479 * Lookup453: cumulus_pallet_xcmp_queue::pallet::Error<T>
3478 **/3480 **/
3479 CumulusPalletXcmpQueueError: {3481 CumulusPalletXcmpQueueError: {
3480 _enum: ['FailedToSend', 'BadXcmOrigin', 'BadXcm', 'BadOverweightIndex', 'WeightOverLimit']3482 _enum: ['FailedToSend', 'BadXcmOrigin', 'BadXcm', 'BadOverweightIndex', 'WeightOverLimit']
3481 },3483 },
3482 /**3484 /**
3483 * Lookup452: pallet_xcm::pallet::QueryStatus<BlockNumber>3485 * Lookup454: pallet_xcm::pallet::QueryStatus<BlockNumber>
3484 **/3486 **/
3485 PalletXcmQueryStatus: {3487 PalletXcmQueryStatus: {
3486 _enum: {3488 _enum: {
3487 Pending: {3489 Pending: {
3500 }3502 }
3501 }3503 }
3502 },3504 },
3503 /**3505 /**
3504 * Lookup456: xcm::VersionedResponse3506 * Lookup458: xcm::VersionedResponse
3505 **/3507 **/
3506 XcmVersionedResponse: {3508 XcmVersionedResponse: {
3507 _enum: {3509 _enum: {
3508 __Unused0: 'Null',3510 __Unused0: 'Null',
3511 V3: 'XcmV3Response'3513 V3: 'XcmV3Response'
3512 }3514 }
3513 },3515 },
3514 /**3516 /**
3515 * Lookup462: pallet_xcm::pallet::VersionMigrationStage3517 * Lookup464: pallet_xcm::pallet::VersionMigrationStage
3516 **/3518 **/
3517 PalletXcmVersionMigrationStage: {3519 PalletXcmVersionMigrationStage: {
3518 _enum: {3520 _enum: {
3519 MigrateSupportedVersion: 'Null',3521 MigrateSupportedVersion: 'Null',
3522 MigrateAndNotifyOldTargets: 'Null'3524 MigrateAndNotifyOldTargets: 'Null'
3523 }3525 }
3524 },3526 },
3525 /**3527 /**
3526 * Lookup465: xcm::VersionedAssetId3528 * Lookup467: xcm::VersionedAssetId
3527 **/3529 **/
3528 XcmVersionedAssetId: {3530 XcmVersionedAssetId: {
3529 _enum: {3531 _enum: {
3530 __Unused0: 'Null',3532 __Unused0: 'Null',
3533 V3: 'XcmV3MultiassetAssetId'3535 V3: 'XcmV3MultiassetAssetId'
3534 }3536 }
3535 },3537 },
3536 /**3538 /**
3537 * Lookup466: pallet_xcm::pallet::RemoteLockedFungibleRecord<ConsumerIdentifier, MaxConsumers>3539 * Lookup468: pallet_xcm::pallet::RemoteLockedFungibleRecord<ConsumerIdentifier, MaxConsumers>
3538 **/3540 **/
3539 PalletXcmRemoteLockedFungibleRecord: {3541 PalletXcmRemoteLockedFungibleRecord: {
3540 amount: 'u128',3542 amount: 'u128',
3541 owner: 'XcmVersionedMultiLocation',3543 owner: 'XcmVersionedMultiLocation',
3542 locker: 'XcmVersionedMultiLocation',3544 locker: 'XcmVersionedMultiLocation',
3543 consumers: 'Vec<(Null,u128)>'3545 consumers: 'Vec<(Null,u128)>'
3544 },3546 },
3545 /**3547 /**
3546 * Lookup473: pallet_xcm::pallet::Error<T>3548 * Lookup475: pallet_xcm::pallet::Error<T>
3547 **/3549 **/
3548 PalletXcmError: {3550 PalletXcmError: {
3549 _enum: ['Unreachable', 'SendFailure', 'Filtered', 'UnweighableMessage', 'DestinationNotInvertible', 'Empty', 'CannotReanchor', 'TooManyAssets', 'InvalidOrigin', 'BadVersion', 'BadLocation', 'NoSubscription', 'AlreadySubscribed', 'InvalidAsset', 'LowBalance', 'TooManyLocks', 'AccountNotSovereign', 'FeesNotMet', 'LockNotFound', 'InUse']3551 _enum: ['Unreachable', 'SendFailure', 'Filtered', 'UnweighableMessage', 'DestinationNotInvertible', 'Empty', 'CannotReanchor', 'TooManyAssets', 'InvalidOrigin', 'BadVersion', 'BadLocation', 'NoSubscription', 'AlreadySubscribed', 'InvalidAsset', 'LowBalance', 'TooManyLocks', 'AccountNotSovereign', 'FeesNotMet', 'LockNotFound', 'InUse']
3550 },3552 },
3551 /**3553 /**
3552 * Lookup474: cumulus_pallet_xcm::pallet::Error<T>3554 * Lookup476: cumulus_pallet_xcm::pallet::Error<T>
3553 **/3555 **/
3554 CumulusPalletXcmError: 'Null',3556 CumulusPalletXcmError: 'Null',
3555 /**3557 /**
3556 * Lookup475: cumulus_pallet_dmp_queue::ConfigData3558 * Lookup477: cumulus_pallet_dmp_queue::ConfigData
3557 **/3559 **/
3558 CumulusPalletDmpQueueConfigData: {3560 CumulusPalletDmpQueueConfigData: {
3559 maxIndividual: 'SpWeightsWeightV2Weight'3561 maxIndividual: 'SpWeightsWeightV2Weight'
3560 },3562 },
3561 /**3563 /**
3562 * Lookup476: cumulus_pallet_dmp_queue::PageIndexData3564 * Lookup478: cumulus_pallet_dmp_queue::PageIndexData
3563 **/3565 **/
3564 CumulusPalletDmpQueuePageIndexData: {3566 CumulusPalletDmpQueuePageIndexData: {
3565 beginUsed: 'u32',3567 beginUsed: 'u32',
3566 endUsed: 'u32',3568 endUsed: 'u32',
3567 overweightCount: 'u64'3569 overweightCount: 'u64'
3568 },3570 },
3569 /**3571 /**
3570 * Lookup479: cumulus_pallet_dmp_queue::pallet::Error<T>3572 * Lookup481: cumulus_pallet_dmp_queue::pallet::Error<T>
3571 **/3573 **/
3572 CumulusPalletDmpQueueError: {3574 CumulusPalletDmpQueueError: {
3573 _enum: ['Unknown', 'OverLimit']3575 _enum: ['Unknown', 'OverLimit']
3574 },3576 },
3575 /**3577 /**
3576 * Lookup483: pallet_unique::pallet::Error<T>3578 * Lookup485: pallet_unique::pallet::Error<T>
3577 **/3579 **/
3578 PalletUniqueError: {3580 PalletUniqueError: {
3579 _enum: ['CollectionDecimalPointLimitExceeded', 'EmptyArgument', 'RepartitionCalledOnNonRefungibleCollection']3581 _enum: ['CollectionDecimalPointLimitExceeded', 'EmptyArgument', 'RepartitionCalledOnNonRefungibleCollection']
3580 },3582 },
3581 /**3583 /**
3582 * Lookup484: pallet_configuration::pallet::Error<T>3584 * Lookup486: pallet_configuration::pallet::Error<T>
3583 **/3585 **/
3584 PalletConfigurationError: {3586 PalletConfigurationError: {
3585 _enum: ['InconsistentConfiguration']3587 _enum: ['InconsistentConfiguration']
3586 },3588 },
3587 /**3589 /**
3588 * Lookup485: up_data_structs::Collection<sp_core::crypto::AccountId32>3590 * Lookup487: up_data_structs::Collection<sp_core::crypto::AccountId32>
3589 **/3591 **/
3590 UpDataStructsCollection: {3592 UpDataStructsCollection: {
3591 owner: 'AccountId32',3593 owner: 'AccountId32',
3592 mode: 'UpDataStructsCollectionMode',3594 mode: 'UpDataStructsCollectionMode',
3598 permissions: 'UpDataStructsCollectionPermissions',3600 permissions: 'UpDataStructsCollectionPermissions',
3599 flags: '[u8;1]'3601 flags: '[u8;1]'
3600 },3602 },
3601 /**3603 /**
3602 * Lookup486: up_data_structs::SponsorshipState<sp_core::crypto::AccountId32>3604 * Lookup488: up_data_structs::SponsorshipState<sp_core::crypto::AccountId32>
3603 **/3605 **/
3604 UpDataStructsSponsorshipStateAccountId32: {3606 UpDataStructsSponsorshipStateAccountId32: {
3605 _enum: {3607 _enum: {
3606 Disabled: 'Null',3608 Disabled: 'Null',
3607 Unconfirmed: 'AccountId32',3609 Unconfirmed: 'AccountId32',
3608 Confirmed: 'AccountId32'3610 Confirmed: 'AccountId32'
3609 }3611 }
3610 },3612 },
3611 /**3613 /**
3612 * Lookup487: up_data_structs::Properties3614 * Lookup489: up_data_structs::Properties
3613 **/3615 **/
3614 UpDataStructsProperties: {3616 UpDataStructsProperties: {
3615 map: 'UpDataStructsPropertiesMapBoundedVec',3617 map: 'UpDataStructsPropertiesMapBoundedVec',
3616 consumedSpace: 'u32',3618 consumedSpace: 'u32',
3617 reserved: 'u32'3619 reserved: 'u32'
3618 },3620 },
3619 /**3621 /**
3620 * Lookup488: up_data_structs::PropertiesMap<bounded_collections::bounded_vec::BoundedVec<T, S>>3622 * Lookup490: up_data_structs::PropertiesMap<bounded_collections::bounded_vec::BoundedVec<T, S>>
3621 **/3623 **/
3622 UpDataStructsPropertiesMapBoundedVec: 'BTreeMap<Bytes, Bytes>',3624 UpDataStructsPropertiesMapBoundedVec: 'BTreeMap<Bytes, Bytes>',
3623 /**3625 /**
3624 * Lookup493: up_data_structs::PropertiesMap<up_data_structs::PropertyPermission>3626 * Lookup495: up_data_structs::PropertiesMap<up_data_structs::PropertyPermission>
3625 **/3627 **/
3626 UpDataStructsPropertiesMapPropertyPermission: 'BTreeMap<Bytes, UpDataStructsPropertyPermission>',3628 UpDataStructsPropertiesMapPropertyPermission: 'BTreeMap<Bytes, UpDataStructsPropertyPermission>',
3627 /**3629 /**
3628 * Lookup500: up_data_structs::CollectionStats3630 * Lookup502: up_data_structs::CollectionStats
3629 **/3631 **/
3630 UpDataStructsCollectionStats: {3632 UpDataStructsCollectionStats: {
3631 created: 'u32',3633 created: 'u32',
3632 destroyed: 'u32',3634 destroyed: 'u32',
3633 alive: 'u32'3635 alive: 'u32'
3634 },3636 },
3635 /**3637 /**
3636 * Lookup501: up_data_structs::TokenChild3638 * Lookup503: up_data_structs::TokenChild
3637 **/3639 **/
3638 UpDataStructsTokenChild: {3640 UpDataStructsTokenChild: {
3639 token: 'u32',3641 token: 'u32',
3640 collection: 'u32'3642 collection: 'u32'
3641 },3643 },
3642 /**3644 /**
3643 * Lookup502: PhantomType::up_data_structs<T>3645 * Lookup504: PhantomType::up_data_structs<T>
3644 **/3646 **/
3645 PhantomTypeUpDataStructs: '[(UpDataStructsTokenData,UpDataStructsRpcCollection,UpPovEstimateRpcPovInfo);0]',3647 PhantomTypeUpDataStructs: '[(UpDataStructsTokenData,UpDataStructsRpcCollection,UpPovEstimateRpcPovInfo);0]',
3646 /**3648 /**
3647 * Lookup504: up_data_structs::TokenData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>3649 * Lookup506: up_data_structs::TokenData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
3648 **/3650 **/
3649 UpDataStructsTokenData: {3651 UpDataStructsTokenData: {
3650 properties: 'Vec<UpDataStructsProperty>',3652 properties: 'Vec<UpDataStructsProperty>',
3651 owner: 'Option<PalletEvmAccountBasicCrossAccountIdRepr>',3653 owner: 'Option<PalletEvmAccountBasicCrossAccountIdRepr>',
3652 pieces: 'u128'3654 pieces: 'u128'
3653 },3655 },
3654 /**3656 /**
3655 * Lookup506: up_data_structs::RpcCollection<sp_core::crypto::AccountId32>3657 * Lookup507: up_data_structs::RpcCollection<sp_core::crypto::AccountId32>
3656 **/3658 **/
3657 UpDataStructsRpcCollection: {3659 UpDataStructsRpcCollection: {
3658 owner: 'AccountId32',3660 owner: 'AccountId32',
3659 mode: 'UpDataStructsCollectionMode',3661 mode: 'UpDataStructsCollectionMode',
3668 readOnly: 'bool',3670 readOnly: 'bool',
3669 flags: 'UpDataStructsRpcCollectionFlags'3671 flags: 'UpDataStructsRpcCollectionFlags'
3670 },3672 },
3671 /**3673 /**
3672 * Lookup507: up_data_structs::RpcCollectionFlags3674 * Lookup508: up_data_structs::RpcCollectionFlags
3673 **/3675 **/
3674 UpDataStructsRpcCollectionFlags: {3676 UpDataStructsRpcCollectionFlags: {
3675 foreign: 'bool',3677 foreign: 'bool',
3676 erc721metadata: 'bool'3678 erc721metadata: 'bool'
3677 },3679 },
3678 /**3680 /**
3679 * Lookup508: up_pov_estimate_rpc::PovInfo3681 * Lookup509: up_pov_estimate_rpc::PovInfo
3680 **/3682 **/
3681 UpPovEstimateRpcPovInfo: {3683 UpPovEstimateRpcPovInfo: {
3682 proofSize: 'u64',3684 proofSize: 'u64',
3683 compactProofSize: 'u64',3685 compactProofSize: 'u64',
3684 compressedProofSize: 'u64',3686 compressedProofSize: 'u64',
3685 results: 'Vec<Result<Result<Null, SpRuntimeDispatchError>, SpRuntimeTransactionValidityTransactionValidityError>>',3687 results: 'Vec<Result<Result<Null, SpRuntimeDispatchError>, SpRuntimeTransactionValidityTransactionValidityError>>',
3686 keyValues: 'Vec<UpPovEstimateRpcTrieKeyValue>'3688 keyValues: 'Vec<UpPovEstimateRpcTrieKeyValue>'
3687 },3689 },
3688 /**3690 /**
3689 * Lookup511: sp_runtime::transaction_validity::TransactionValidityError3691 * Lookup512: sp_runtime::transaction_validity::TransactionValidityError
3690 **/3692 **/
3691 SpRuntimeTransactionValidityTransactionValidityError: {3693 SpRuntimeTransactionValidityTransactionValidityError: {
3692 _enum: {3694 _enum: {
3693 Invalid: 'SpRuntimeTransactionValidityInvalidTransaction',3695 Invalid: 'SpRuntimeTransactionValidityInvalidTransaction',
3694 Unknown: 'SpRuntimeTransactionValidityUnknownTransaction'3696 Unknown: 'SpRuntimeTransactionValidityUnknownTransaction'
3695 }3697 }
3696 },3698 },
3697 /**3699 /**
3698 * Lookup512: sp_runtime::transaction_validity::InvalidTransaction3700 * Lookup513: sp_runtime::transaction_validity::InvalidTransaction
3699 **/3701 **/
3700 SpRuntimeTransactionValidityInvalidTransaction: {3702 SpRuntimeTransactionValidityInvalidTransaction: {
3701 _enum: {3703 _enum: {
3702 Call: 'Null',3704 Call: 'Null',
3712 BadSigner: 'Null'3714 BadSigner: 'Null'
3713 }3715 }
3714 },3716 },
3715 /**3717 /**
3716 * Lookup513: sp_runtime::transaction_validity::UnknownTransaction3718 * Lookup514: sp_runtime::transaction_validity::UnknownTransaction
3717 **/3719 **/
3718 SpRuntimeTransactionValidityUnknownTransaction: {3720 SpRuntimeTransactionValidityUnknownTransaction: {
3719 _enum: {3721 _enum: {
3720 CannotLookup: 'Null',3722 CannotLookup: 'Null',
3721 NoUnsignedValidator: 'Null',3723 NoUnsignedValidator: 'Null',
3722 Custom: 'u8'3724 Custom: 'u8'
3723 }3725 }
3724 },3726 },
3725 /**3727 /**
3726 * Lookup515: up_pov_estimate_rpc::TrieKeyValue3728 * Lookup516: up_pov_estimate_rpc::TrieKeyValue
3727 **/3729 **/
3728 UpPovEstimateRpcTrieKeyValue: {3730 UpPovEstimateRpcTrieKeyValue: {
3729 key: 'Bytes',3731 key: 'Bytes',
3730 value: 'Bytes'3732 value: 'Bytes'
3731 },3733 },
3732 /**3734 /**
3733 * Lookup517: pallet_common::pallet::Error<T>3735 * Lookup518: pallet_common::pallet::Error<T>
3734 **/3736 **/
3735 PalletCommonError: {3737 PalletCommonError: {
3736 _enum: ['CollectionNotFound', 'MustBeTokenOwner', 'NoPermission', 'CantDestroyNotEmptyCollection', 'PublicMintingNotAllowed', 'AddressNotInAllowlist', 'CollectionNameLimitExceeded', 'CollectionDescriptionLimitExceeded', 'CollectionTokenPrefixLimitExceeded', 'TotalCollectionsLimitExceeded', 'CollectionAdminCountExceeded', 'CollectionLimitBoundsExceeded', 'OwnerPermissionsCantBeReverted', 'TransferNotAllowed', 'AccountTokenLimitExceeded', 'CollectionTokenLimitExceeded', 'MetadataFlagFrozen', 'TokenNotFound', 'TokenValueTooLow', 'ApprovedValueTooLow', 'CantApproveMoreThanOwned', 'AddressIsNotEthMirror', 'AddressIsZero', 'UnsupportedOperation', 'NotSufficientFounds', 'UserIsNotAllowedToNest', 'SourceCollectionIsNotAllowedToNest', 'CollectionFieldSizeExceeded', 'NoSpaceForProperty', 'PropertyLimitReached', 'PropertyKeyIsTooLong', 'InvalidCharacterInPropertyKey', 'EmptyPropertyKey', 'CollectionIsExternal', 'CollectionIsInternal', 'ConfirmSponsorshipFail', 'UserIsNotCollectionAdmin']3738 _enum: ['CollectionNotFound', 'MustBeTokenOwner', 'NoPermission', 'CantDestroyNotEmptyCollection', 'PublicMintingNotAllowed', 'AddressNotInAllowlist', 'CollectionNameLimitExceeded', 'CollectionDescriptionLimitExceeded', 'CollectionTokenPrefixLimitExceeded', 'TotalCollectionsLimitExceeded', 'CollectionAdminCountExceeded', 'CollectionLimitBoundsExceeded', 'OwnerPermissionsCantBeReverted', 'TransferNotAllowed', 'AccountTokenLimitExceeded', 'CollectionTokenLimitExceeded', 'MetadataFlagFrozen', 'TokenNotFound', 'TokenValueTooLow', 'ApprovedValueTooLow', 'CantApproveMoreThanOwned', 'AddressIsNotEthMirror', 'AddressIsZero', 'UnsupportedOperation', 'NotSufficientFounds', 'UserIsNotAllowedToNest', 'SourceCollectionIsNotAllowedToNest', 'CollectionFieldSizeExceeded', 'NoSpaceForProperty', 'PropertyLimitReached', 'PropertyKeyIsTooLong', 'InvalidCharacterInPropertyKey', 'EmptyPropertyKey', 'CollectionIsExternal', 'CollectionIsInternal', 'ConfirmSponsorshipFail', 'UserIsNotCollectionAdmin']
3737 },3739 },
3738 /**3740 /**
3739 * Lookup519: pallet_fungible::pallet::Error<T>3741 * Lookup520: pallet_fungible::pallet::Error<T>
3740 **/3742 **/
3741 PalletFungibleError: {3743 PalletFungibleError: {
3742 _enum: ['NotFungibleDataUsedToMintFungibleCollectionToken', 'FungibleItemsHaveNoId', 'FungibleItemsDontHaveData', 'FungibleDisallowsNesting', 'SettingPropertiesNotAllowed', 'SettingAllowanceForAllNotAllowed', 'FungibleTokensAreAlwaysValid']3744 _enum: ['NotFungibleDataUsedToMintFungibleCollectionToken', 'FungibleItemsHaveNoId', 'FungibleItemsDontHaveData', 'FungibleDisallowsNesting', 'SettingPropertiesNotAllowed', 'SettingAllowanceForAllNotAllowed', 'FungibleTokensAreAlwaysValid']
3743 },3745 },
3744 /**3746 /**
3745 * Lookup524: pallet_refungible::pallet::Error<T>3747 * Lookup525: pallet_refungible::pallet::Error<T>
3746 **/3748 **/
3747 PalletRefungibleError: {3749 PalletRefungibleError: {
3748 _enum: ['NotRefungibleDataUsedToMintFungibleCollectionToken', 'WrongRefungiblePieces', 'RepartitionWhileNotOwningAllPieces', 'RefungibleDisallowsNesting', 'SettingPropertiesNotAllowed']3750 _enum: ['NotRefungibleDataUsedToMintFungibleCollectionToken', 'WrongRefungiblePieces', 'RepartitionWhileNotOwningAllPieces', 'RefungibleDisallowsNesting', 'SettingPropertiesNotAllowed']
3749 },3751 },
3750 /**3752 /**
3751 * Lookup525: pallet_nonfungible::ItemData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>3753 * Lookup526: pallet_nonfungible::ItemData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
3752 **/3754 **/
3753 PalletNonfungibleItemData: {3755 PalletNonfungibleItemData: {
3754 owner: 'PalletEvmAccountBasicCrossAccountIdRepr'3756 owner: 'PalletEvmAccountBasicCrossAccountIdRepr'
3755 },3757 },
3756 /**3758 /**
3757 * Lookup527: up_data_structs::PropertyScope3759 * Lookup528: up_data_structs::PropertyScope
3758 **/3760 **/
3759 UpDataStructsPropertyScope: {3761 UpDataStructsPropertyScope: {
3760 _enum: ['None', 'Rmrk']3762 _enum: ['None', 'Rmrk']
3761 },3763 },
3762 /**3764 /**
3763 * Lookup530: pallet_nonfungible::pallet::Error<T>3765 * Lookup531: pallet_nonfungible::pallet::Error<T>
3764 **/3766 **/
3765 PalletNonfungibleError: {3767 PalletNonfungibleError: {
3766 _enum: ['NotNonfungibleDataUsedToMintFungibleCollectionToken', 'NonfungibleItemsHaveNoAmount', 'CantBurnNftWithChildren']3768 _enum: ['NotNonfungibleDataUsedToMintFungibleCollectionToken', 'NonfungibleItemsHaveNoAmount', 'CantBurnNftWithChildren']
3767 },3769 },
3768 /**3770 /**
3769 * Lookup531: pallet_structure::pallet::Error<T>3771 * Lookup532: pallet_structure::pallet::Error<T>
3770 **/3772 **/
3771 PalletStructureError: {3773 PalletStructureError: {
3772 _enum: ['OuroborosDetected', 'DepthLimit', 'BreadthLimit', 'TokenNotFound', 'CantNestTokenUnderCollection']3774 _enum: ['OuroborosDetected', 'DepthLimit', 'BreadthLimit', 'TokenNotFound', 'CantNestTokenUnderCollection']
3773 },3775 },
3774 /**3776 /**
3775 * Lookup536: pallet_app_promotion::pallet::Error<T>3777 * Lookup537: pallet_app_promotion::pallet::Error<T>
3776 **/3778 **/
3777 PalletAppPromotionError: {3779 PalletAppPromotionError: {
3778 _enum: ['AdminNotSet', 'NoPermission', 'NotSufficientFunds', 'PendingForBlockOverflow', 'SponsorNotSet', 'InsufficientStakedBalance', 'InconsistencyState']3780 _enum: ['AdminNotSet', 'NoPermission', 'NotSufficientFunds', 'PendingForBlockOverflow', 'SponsorNotSet', 'InsufficientStakedBalance', 'InconsistencyState']
3779 },3781 },
3780 /**3782 /**
3781 * Lookup537: pallet_foreign_assets::module::Error<T>3783 * Lookup538: pallet_foreign_assets::module::Error<T>
3782 **/3784 **/
3783 PalletForeignAssetsModuleError: {3785 PalletForeignAssetsModuleError: {
3784 _enum: ['BadLocation', 'MultiLocationExisted', 'AssetIdNotExists', 'AssetIdExisted']3786 _enum: ['BadLocation', 'MultiLocationExisted', 'AssetIdNotExists', 'AssetIdExisted']
3785 },3787 },
3786 /**3788 /**
3787 * Lookup538: pallet_evm::CodeMetadata3789 * Lookup539: pallet_evm::CodeMetadata
3788 **/3790 **/
3789 PalletEvmCodeMetadata: {3791 PalletEvmCodeMetadata: {
3790 _alias: {3792 _alias: {
3791 size_: 'size',3793 size_: 'size',
3794 size_: 'u64',3796 size_: 'u64',
3795 hash_: 'H256'3797 hash_: 'H256'
3796 },3798 },
3797 /**3799 /**
3798 * Lookup540: pallet_evm::pallet::Error<T>3800 * Lookup541: pallet_evm::pallet::Error<T>
3799 **/3801 **/
3800 PalletEvmError: {3802 PalletEvmError: {
3801 _enum: ['BalanceLow', 'FeeOverflow', 'PaymentOverflow', 'WithdrawFailed', 'GasPriceTooLow', 'InvalidNonce', 'GasLimitTooLow', 'GasLimitTooHigh', 'Undefined', 'Reentrancy', 'TransactionMustComeFromEOA']3803 _enum: ['BalanceLow', 'FeeOverflow', 'PaymentOverflow', 'WithdrawFailed', 'GasPriceTooLow', 'InvalidNonce', 'GasLimitTooLow', 'GasLimitTooHigh', 'Undefined', 'Reentrancy', 'TransactionMustComeFromEOA']
3802 },3804 },
3803 /**3805 /**
3804 * Lookup543: fp_rpc::TransactionStatus3806 * Lookup544: fp_rpc::TransactionStatus
3805 **/3807 **/
3806 FpRpcTransactionStatus: {3808 FpRpcTransactionStatus: {
3807 transactionHash: 'H256',3809 transactionHash: 'H256',
3808 transactionIndex: 'u32',3810 transactionIndex: 'u32',
3812 logs: 'Vec<EthereumLog>',3814 logs: 'Vec<EthereumLog>',
3813 logsBloom: 'EthbloomBloom'3815 logsBloom: 'EthbloomBloom'
3814 },3816 },
3815 /**3817 /**
3816 * Lookup545: ethbloom::Bloom3818 * Lookup546: ethbloom::Bloom
3817 **/3819 **/
3818 EthbloomBloom: '[u8;256]',3820 EthbloomBloom: '[u8;256]',
3819 /**3821 /**
3820 * Lookup547: ethereum::receipt::ReceiptV33822 * Lookup548: ethereum::receipt::ReceiptV3
3821 **/3823 **/
3822 EthereumReceiptReceiptV3: {3824 EthereumReceiptReceiptV3: {
3823 _enum: {3825 _enum: {
3824 Legacy: 'EthereumReceiptEip658ReceiptData',3826 Legacy: 'EthereumReceiptEip658ReceiptData',
3825 EIP2930: 'EthereumReceiptEip658ReceiptData',3827 EIP2930: 'EthereumReceiptEip658ReceiptData',
3826 EIP1559: 'EthereumReceiptEip658ReceiptData'3828 EIP1559: 'EthereumReceiptEip658ReceiptData'
3827 }3829 }
3828 },3830 },
3829 /**3831 /**
3830 * Lookup548: ethereum::receipt::EIP658ReceiptData3832 * Lookup549: ethereum::receipt::EIP658ReceiptData
3831 **/3833 **/
3832 EthereumReceiptEip658ReceiptData: {3834 EthereumReceiptEip658ReceiptData: {
3833 statusCode: 'u8',3835 statusCode: 'u8',
3834 usedGas: 'U256',3836 usedGas: 'U256',
3835 logsBloom: 'EthbloomBloom',3837 logsBloom: 'EthbloomBloom',
3836 logs: 'Vec<EthereumLog>'3838 logs: 'Vec<EthereumLog>'
3837 },3839 },
3838 /**3840 /**
3839 * Lookup549: ethereum::block::Block<ethereum::transaction::TransactionV2>3841 * Lookup550: ethereum::block::Block<ethereum::transaction::TransactionV2>
3840 **/3842 **/
3841 EthereumBlock: {3843 EthereumBlock: {
3842 header: 'EthereumHeader',3844 header: 'EthereumHeader',
3843 transactions: 'Vec<EthereumTransactionTransactionV2>',3845 transactions: 'Vec<EthereumTransactionTransactionV2>',
3844 ommers: 'Vec<EthereumHeader>'3846 ommers: 'Vec<EthereumHeader>'
3845 },3847 },
3846 /**3848 /**
3847 * Lookup550: ethereum::header::Header3849 * Lookup551: ethereum::header::Header
3848 **/3850 **/
3849 EthereumHeader: {3851 EthereumHeader: {
3850 parentHash: 'H256',3852 parentHash: 'H256',
3851 ommersHash: 'H256',3853 ommersHash: 'H256',
3863 mixHash: 'H256',3865 mixHash: 'H256',
3864 nonce: 'EthereumTypesHashH64'3866 nonce: 'EthereumTypesHashH64'
3865 },3867 },
3866 /**3868 /**
3867 * Lookup551: ethereum_types::hash::H643869 * Lookup552: ethereum_types::hash::H64
3868 **/3870 **/
3869 EthereumTypesHashH64: '[u8;8]',3871 EthereumTypesHashH64: '[u8;8]',
3870 /**3872 /**
3871 * Lookup556: pallet_ethereum::pallet::Error<T>3873 * Lookup557: pallet_ethereum::pallet::Error<T>
3872 **/3874 **/
3873 PalletEthereumError: {3875 PalletEthereumError: {
3874 _enum: ['InvalidSignature', 'PreLogExists']3876 _enum: ['InvalidSignature', 'PreLogExists']
3875 },3877 },
3876 /**3878 /**
3877 * Lookup557: pallet_evm_coder_substrate::pallet::Error<T>3879 * Lookup558: pallet_evm_coder_substrate::pallet::Error<T>
3878 **/3880 **/
3879 PalletEvmCoderSubstrateError: {3881 PalletEvmCoderSubstrateError: {
3880 _enum: ['OutOfGas', 'OutOfFund']3882 _enum: ['OutOfGas', 'OutOfFund']
3881 },3883 },
3882 /**3884 /**
3883 * Lookup558: up_data_structs::SponsorshipState<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>3885 * Lookup559: up_data_structs::SponsorshipState<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
3884 **/3886 **/
3885 UpDataStructsSponsorshipStateBasicCrossAccountIdRepr: {3887 UpDataStructsSponsorshipStateBasicCrossAccountIdRepr: {
3886 _enum: {3888 _enum: {
3887 Disabled: 'Null',3889 Disabled: 'Null',
3888 Unconfirmed: 'PalletEvmAccountBasicCrossAccountIdRepr',3890 Unconfirmed: 'PalletEvmAccountBasicCrossAccountIdRepr',
3889 Confirmed: 'PalletEvmAccountBasicCrossAccountIdRepr'3891 Confirmed: 'PalletEvmAccountBasicCrossAccountIdRepr'
3890 }3892 }
3891 },3893 },
3892 /**3894 /**
3893 * Lookup559: pallet_evm_contract_helpers::SponsoringModeT3895 * Lookup560: pallet_evm_contract_helpers::SponsoringModeT
3894 **/3896 **/
3895 PalletEvmContractHelpersSponsoringModeT: {3897 PalletEvmContractHelpersSponsoringModeT: {
3896 _enum: ['Disabled', 'Allowlisted', 'Generous']3898 _enum: ['Disabled', 'Allowlisted', 'Generous']
3897 },3899 },
3898 /**3900 /**
3899 * Lookup565: pallet_evm_contract_helpers::pallet::Error<T>3901 * Lookup566: pallet_evm_contract_helpers::pallet::Error<T>
3900 **/3902 **/
3901 PalletEvmContractHelpersError: {3903 PalletEvmContractHelpersError: {
3902 _enum: ['NoPermission', 'NoPendingSponsor', 'TooManyMethodsHaveSponsoredLimit']3904 _enum: ['NoPermission', 'NoPendingSponsor', 'TooManyMethodsHaveSponsoredLimit']
3903 },3905 },
3904 /**3906 /**
3905 * Lookup566: pallet_evm_migration::pallet::Error<T>3907 * Lookup567: pallet_evm_migration::pallet::Error<T>
3906 **/3908 **/
3907 PalletEvmMigrationError: {3909 PalletEvmMigrationError: {
3908 _enum: ['AccountNotEmpty', 'AccountIsNotMigrating', 'BadEvent']3910 _enum: ['AccountNotEmpty', 'AccountIsNotMigrating', 'BadEvent']
3909 },3911 },
3910 /**3912 /**
3911 * Lookup567: pallet_maintenance::pallet::Error<T>3913 * Lookup568: pallet_maintenance::pallet::Error<T>
3912 **/3914 **/
3913 PalletMaintenanceError: 'Null',3915 PalletMaintenanceError: 'Null',
3914 /**3916 /**
3915 * Lookup568: pallet_test_utils::pallet::Error<T>3917 * Lookup569: pallet_test_utils::pallet::Error<T>
3916 **/3918 **/
3917 PalletTestUtilsError: {3919 PalletTestUtilsError: {
3918 _enum: ['TestPalletDisabled', 'TriggerRollback']3920 _enum: ['TestPalletDisabled', 'TriggerRollback']
3919 },3921 },
3920 /**3922 /**
3921 * Lookup570: sp_runtime::MultiSignature3923 * Lookup571: sp_runtime::MultiSignature
3922 **/3924 **/
3923 SpRuntimeMultiSignature: {3925 SpRuntimeMultiSignature: {
3924 _enum: {3926 _enum: {
3925 Ed25519: 'SpCoreEd25519Signature',3927 Ed25519: 'SpCoreEd25519Signature',
3926 Sr25519: 'SpCoreSr25519Signature',3928 Sr25519: 'SpCoreSr25519Signature',
3927 Ecdsa: 'SpCoreEcdsaSignature'3929 Ecdsa: 'SpCoreEcdsaSignature'
3928 }3930 }
3929 },3931 },
3930 /**3932 /**
3931 * Lookup571: sp_core::ed25519::Signature3933 * Lookup572: sp_core::ed25519::Signature
3932 **/3934 **/
3933 SpCoreEd25519Signature: '[u8;64]',3935 SpCoreEd25519Signature: '[u8;64]',
3934 /**3936 /**
3935 * Lookup573: sp_core::sr25519::Signature3937 * Lookup574: sp_core::sr25519::Signature
3936 **/3938 **/
3937 SpCoreSr25519Signature: '[u8;64]',3939 SpCoreSr25519Signature: '[u8;64]',
3938 /**3940 /**
3939 * Lookup574: sp_core::ecdsa::Signature3941 * Lookup575: sp_core::ecdsa::Signature
3940 **/3942 **/
3941 SpCoreEcdsaSignature: '[u8;65]',3943 SpCoreEcdsaSignature: '[u8;65]',
3942 /**3944 /**
3943 * Lookup577: frame_system::extensions::check_spec_version::CheckSpecVersion<T>3945 * Lookup578: frame_system::extensions::check_spec_version::CheckSpecVersion<T>
3944 **/3946 **/
3945 FrameSystemExtensionsCheckSpecVersion: 'Null',3947 FrameSystemExtensionsCheckSpecVersion: 'Null',
3946 /**3948 /**
3947 * Lookup578: frame_system::extensions::check_tx_version::CheckTxVersion<T>3949 * Lookup579: frame_system::extensions::check_tx_version::CheckTxVersion<T>
3948 **/3950 **/
3949 FrameSystemExtensionsCheckTxVersion: 'Null',3951 FrameSystemExtensionsCheckTxVersion: 'Null',
3950 /**3952 /**
3951 * Lookup579: frame_system::extensions::check_genesis::CheckGenesis<T>3953 * Lookup580: frame_system::extensions::check_genesis::CheckGenesis<T>
3952 **/3954 **/
3953 FrameSystemExtensionsCheckGenesis: 'Null',3955 FrameSystemExtensionsCheckGenesis: 'Null',
3954 /**3956 /**
3955 * Lookup582: frame_system::extensions::check_nonce::CheckNonce<T>3957 * Lookup583: frame_system::extensions::check_nonce::CheckNonce<T>
3956 **/3958 **/
3957 FrameSystemExtensionsCheckNonce: 'Compact<u32>',3959 FrameSystemExtensionsCheckNonce: 'Compact<u32>',
3958 /**3960 /**
3959 * Lookup583: frame_system::extensions::check_weight::CheckWeight<T>3961 * Lookup584: frame_system::extensions::check_weight::CheckWeight<T>
3960 **/3962 **/
3961 FrameSystemExtensionsCheckWeight: 'Null',3963 FrameSystemExtensionsCheckWeight: 'Null',
3962 /**3964 /**
3963 * Lookup584: opal_runtime::runtime_common::maintenance::CheckMaintenance3965 * Lookup585: opal_runtime::runtime_common::maintenance::CheckMaintenance
3964 **/3966 **/
3965 OpalRuntimeRuntimeCommonMaintenanceCheckMaintenance: 'Null',3967 OpalRuntimeRuntimeCommonMaintenanceCheckMaintenance: 'Null',
3966 /**3968 /**
3967 * Lookup585: opal_runtime::runtime_common::identity::DisableIdentityCalls3969 * Lookup586: opal_runtime::runtime_common::identity::DisableIdentityCalls
3968 **/3970 **/
3969 OpalRuntimeRuntimeCommonIdentityDisableIdentityCalls: 'Null',3971 OpalRuntimeRuntimeCommonIdentityDisableIdentityCalls: 'Null',
3970 /**3972 /**
3971 * Lookup586: pallet_template_transaction_payment::ChargeTransactionPayment<opal_runtime::Runtime>3973 * Lookup587: pallet_template_transaction_payment::ChargeTransactionPayment<opal_runtime::Runtime>
3972 **/3974 **/
3973 PalletTemplateTransactionPaymentChargeTransactionPayment: 'Compact<u128>',3975 PalletTemplateTransactionPaymentChargeTransactionPayment: 'Compact<u128>',
3974 /**3976 /**
3975 * Lookup587: opal_runtime::Runtime3977 * Lookup588: opal_runtime::Runtime
3976 **/3978 **/
3977 OpalRuntimeRuntime: 'Null',3979 OpalRuntimeRuntime: 'Null',
3978 /**3980 /**
3979 * Lookup588: pallet_ethereum::FakeTransactionFinalizer<opal_runtime::Runtime>3981 * Lookup589: pallet_ethereum::FakeTransactionFinalizer<opal_runtime::Runtime>
3980 **/3982 **/
3981 PalletEthereumFakeTransactionFinalizer: 'Null'3983 PalletEthereumFakeTransactionFinalizer: 'Null'
3982};3984};
39833985
modifiedtests/src/interfaces/types-lookup.tsdiffbeforeafterboth
3181 readonly name: Vec<u16>;3181 readonly name: Vec<u16>;
3182 readonly description: Vec<u16>;3182 readonly description: Vec<u16>;
3183 readonly tokenPrefix: Bytes;3183 readonly tokenPrefix: Bytes;
3184 readonly pendingSponsor: Option<AccountId32>;
3185 readonly limits: Option<UpDataStructsCollectionLimits>;3184 readonly limits: Option<UpDataStructsCollectionLimits>;
3186 readonly permissions: Option<UpDataStructsCollectionPermissions>;3185 readonly permissions: Option<UpDataStructsCollectionPermissions>;
3187 readonly tokenPropertyPermissions: Vec<UpDataStructsPropertyKeyPermission>;3186 readonly tokenPropertyPermissions: Vec<UpDataStructsPropertyKeyPermission>;
3188 readonly properties: Vec<UpDataStructsProperty>;3187 readonly properties: Vec<UpDataStructsProperty>;
3188 readonly adminList: Vec<PalletEvmAccountBasicCrossAccountIdRepr>;
3189 readonly pendingSponsor: Option<PalletEvmAccountBasicCrossAccountIdRepr>;
3190 readonly flags: U8aFixed;
3189 }3191 }
31903192
3191 /** @name UpDataStructsAccessMode (337) */3193 /** @name UpDataStructsAccessMode (337) */
3252 readonly value: Bytes;3254 readonly value: Bytes;
3253 }3255 }
32543256
3255 /** @name UpDataStructsCreateItemData (360) */3257 /** @name UpDataStructsCreateItemData (362) */
3256 interface UpDataStructsCreateItemData extends Enum {3258 interface UpDataStructsCreateItemData extends Enum {
3257 readonly isNft: boolean;3259 readonly isNft: boolean;
3258 readonly asNft: UpDataStructsCreateNftData;3260 readonly asNft: UpDataStructsCreateNftData;
3263 readonly type: 'Nft' | 'Fungible' | 'ReFungible';3265 readonly type: 'Nft' | 'Fungible' | 'ReFungible';
3264 }3266 }
32653267
3266 /** @name UpDataStructsCreateNftData (361) */3268 /** @name UpDataStructsCreateNftData (363) */
3267 interface UpDataStructsCreateNftData extends Struct {3269 interface UpDataStructsCreateNftData extends Struct {
3268 readonly properties: Vec<UpDataStructsProperty>;3270 readonly properties: Vec<UpDataStructsProperty>;
3269 }3271 }
32703272
3271 /** @name UpDataStructsCreateFungibleData (362) */3273 /** @name UpDataStructsCreateFungibleData (364) */
3272 interface UpDataStructsCreateFungibleData extends Struct {3274 interface UpDataStructsCreateFungibleData extends Struct {
3273 readonly value: u128;3275 readonly value: u128;
3274 }3276 }
32753277
3276 /** @name UpDataStructsCreateReFungibleData (363) */3278 /** @name UpDataStructsCreateReFungibleData (365) */
3277 interface UpDataStructsCreateReFungibleData extends Struct {3279 interface UpDataStructsCreateReFungibleData extends Struct {
3278 readonly pieces: u128;3280 readonly pieces: u128;
3279 readonly properties: Vec<UpDataStructsProperty>;3281 readonly properties: Vec<UpDataStructsProperty>;
3280 }3282 }
32813283
3282 /** @name UpDataStructsCreateItemExData (366) */3284 /** @name UpDataStructsCreateItemExData (368) */
3283 interface UpDataStructsCreateItemExData extends Enum {3285 interface UpDataStructsCreateItemExData extends Enum {
3284 readonly isNft: boolean;3286 readonly isNft: boolean;
3285 readonly asNft: Vec<UpDataStructsCreateNftExData>;3287 readonly asNft: Vec<UpDataStructsCreateNftExData>;
3292 readonly type: 'Nft' | 'Fungible' | 'RefungibleMultipleItems' | 'RefungibleMultipleOwners';3294 readonly type: 'Nft' | 'Fungible' | 'RefungibleMultipleItems' | 'RefungibleMultipleOwners';
3293 }3295 }
32943296
3295 /** @name UpDataStructsCreateNftExData (368) */3297 /** @name UpDataStructsCreateNftExData (370) */
3296 interface UpDataStructsCreateNftExData extends Struct {3298 interface UpDataStructsCreateNftExData extends Struct {
3297 readonly properties: Vec<UpDataStructsProperty>;3299 readonly properties: Vec<UpDataStructsProperty>;
3298 readonly owner: PalletEvmAccountBasicCrossAccountIdRepr;3300 readonly owner: PalletEvmAccountBasicCrossAccountIdRepr;
3299 }3301 }
33003302
3301 /** @name UpDataStructsCreateRefungibleExSingleOwner (375) */3303 /** @name UpDataStructsCreateRefungibleExSingleOwner (377) */
3302 interface UpDataStructsCreateRefungibleExSingleOwner extends Struct {3304 interface UpDataStructsCreateRefungibleExSingleOwner extends Struct {
3303 readonly user: PalletEvmAccountBasicCrossAccountIdRepr;3305 readonly user: PalletEvmAccountBasicCrossAccountIdRepr;
3304 readonly pieces: u128;3306 readonly pieces: u128;
3305 readonly properties: Vec<UpDataStructsProperty>;3307 readonly properties: Vec<UpDataStructsProperty>;
3306 }3308 }
33073309
3308 /** @name UpDataStructsCreateRefungibleExMultipleOwners (377) */3310 /** @name UpDataStructsCreateRefungibleExMultipleOwners (379) */
3309 interface UpDataStructsCreateRefungibleExMultipleOwners extends Struct {3311 interface UpDataStructsCreateRefungibleExMultipleOwners extends Struct {
3310 readonly users: BTreeMap<PalletEvmAccountBasicCrossAccountIdRepr, u128>;3312 readonly users: BTreeMap<PalletEvmAccountBasicCrossAccountIdRepr, u128>;
3311 readonly properties: Vec<UpDataStructsProperty>;3313 readonly properties: Vec<UpDataStructsProperty>;
3312 }3314 }
33133315
3314 /** @name PalletConfigurationCall (378) */3316 /** @name PalletConfigurationCall (380) */
3315 interface PalletConfigurationCall extends Enum {3317 interface PalletConfigurationCall extends Enum {
3316 readonly isSetWeightToFeeCoefficientOverride: boolean;3318 readonly isSetWeightToFeeCoefficientOverride: boolean;
3317 readonly asSetWeightToFeeCoefficientOverride: {3319 readonly asSetWeightToFeeCoefficientOverride: {
3340 readonly type: 'SetWeightToFeeCoefficientOverride' | 'SetMinGasPriceOverride' | 'SetAppPromotionConfigurationOverride' | 'SetCollatorSelectionDesiredCollators' | 'SetCollatorSelectionLicenseBond' | 'SetCollatorSelectionKickThreshold';3342 readonly type: 'SetWeightToFeeCoefficientOverride' | 'SetMinGasPriceOverride' | 'SetAppPromotionConfigurationOverride' | 'SetCollatorSelectionDesiredCollators' | 'SetCollatorSelectionLicenseBond' | 'SetCollatorSelectionKickThreshold';
3341 }3343 }
33423344
3343 /** @name PalletConfigurationAppPromotionConfiguration (380) */3345 /** @name PalletConfigurationAppPromotionConfiguration (382) */
3344 interface PalletConfigurationAppPromotionConfiguration extends Struct {3346 interface PalletConfigurationAppPromotionConfiguration extends Struct {
3345 readonly recalculationInterval: Option<u32>;3347 readonly recalculationInterval: Option<u32>;
3346 readonly pendingInterval: Option<u32>;3348 readonly pendingInterval: Option<u32>;
3347 readonly intervalIncome: Option<Perbill>;3349 readonly intervalIncome: Option<Perbill>;
3348 readonly maxStakersPerCalculation: Option<u8>;3350 readonly maxStakersPerCalculation: Option<u8>;
3349 }3351 }
33503352
3351 /** @name PalletStructureCall (384) */3353 /** @name PalletStructureCall (386) */
3352 type PalletStructureCall = Null;3354 type PalletStructureCall = Null;
33533355
3354 /** @name PalletAppPromotionCall (385) */3356 /** @name PalletAppPromotionCall (387) */
3355 interface PalletAppPromotionCall extends Enum {3357 interface PalletAppPromotionCall extends Enum {
3356 readonly isSetAdminAddress: boolean;3358 readonly isSetAdminAddress: boolean;
3357 readonly asSetAdminAddress: {3359 readonly asSetAdminAddress: {
3393 readonly type: 'SetAdminAddress' | 'Stake' | 'UnstakeAll' | 'SponsorCollection' | 'StopSponsoringCollection' | 'SponsorContract' | 'StopSponsoringContract' | 'PayoutStakers' | 'UnstakePartial' | 'ForceUnstake';3395 readonly type: 'SetAdminAddress' | 'Stake' | 'UnstakeAll' | 'SponsorCollection' | 'StopSponsoringCollection' | 'SponsorContract' | 'StopSponsoringContract' | 'PayoutStakers' | 'UnstakePartial' | 'ForceUnstake';
3394 }3396 }
33953397
3396 /** @name PalletForeignAssetsModuleCall (386) */3398 /** @name PalletForeignAssetsModuleCall (388) */
3397 interface PalletForeignAssetsModuleCall extends Enum {3399 interface PalletForeignAssetsModuleCall extends Enum {
3398 readonly isRegisterForeignAsset: boolean;3400 readonly isRegisterForeignAsset: boolean;
3399 readonly asRegisterForeignAsset: {3401 readonly asRegisterForeignAsset: {
3410 readonly type: 'RegisterForeignAsset' | 'UpdateForeignAsset';3412 readonly type: 'RegisterForeignAsset' | 'UpdateForeignAsset';
3411 }3413 }
34123414
3413 /** @name PalletEvmCall (387) */3415 /** @name PalletEvmCall (389) */
3414 interface PalletEvmCall extends Enum {3416 interface PalletEvmCall extends Enum {
3415 readonly isWithdraw: boolean;3417 readonly isWithdraw: boolean;
3416 readonly asWithdraw: {3418 readonly asWithdraw: {
3455 readonly type: 'Withdraw' | 'Call' | 'Create' | 'Create2';3457 readonly type: 'Withdraw' | 'Call' | 'Create' | 'Create2';
3456 }3458 }
34573459
3458 /** @name PalletEthereumCall (393) */3460 /** @name PalletEthereumCall (395) */
3459 interface PalletEthereumCall extends Enum {3461 interface PalletEthereumCall extends Enum {
3460 readonly isTransact: boolean;3462 readonly isTransact: boolean;
3461 readonly asTransact: {3463 readonly asTransact: {
3464 readonly type: 'Transact';3466 readonly type: 'Transact';
3465 }3467 }
34663468
3467 /** @name EthereumTransactionTransactionV2 (394) */3469 /** @name EthereumTransactionTransactionV2 (396) */
3468 interface EthereumTransactionTransactionV2 extends Enum {3470 interface EthereumTransactionTransactionV2 extends Enum {
3469 readonly isLegacy: boolean;3471 readonly isLegacy: boolean;
3470 readonly asLegacy: EthereumTransactionLegacyTransaction;3472 readonly asLegacy: EthereumTransactionLegacyTransaction;
3475 readonly type: 'Legacy' | 'Eip2930' | 'Eip1559';3477 readonly type: 'Legacy' | 'Eip2930' | 'Eip1559';
3476 }3478 }
34773479
3478 /** @name EthereumTransactionLegacyTransaction (395) */3480 /** @name EthereumTransactionLegacyTransaction (397) */
3479 interface EthereumTransactionLegacyTransaction extends Struct {3481 interface EthereumTransactionLegacyTransaction extends Struct {
3480 readonly nonce: U256;3482 readonly nonce: U256;
3481 readonly gasPrice: U256;3483 readonly gasPrice: U256;
3486 readonly signature: EthereumTransactionTransactionSignature;3488 readonly signature: EthereumTransactionTransactionSignature;
3487 }3489 }
34883490
3489 /** @name EthereumTransactionTransactionAction (396) */3491 /** @name EthereumTransactionTransactionAction (398) */
3490 interface EthereumTransactionTransactionAction extends Enum {3492 interface EthereumTransactionTransactionAction extends Enum {
3491 readonly isCall: boolean;3493 readonly isCall: boolean;
3492 readonly asCall: H160;3494 readonly asCall: H160;
3493 readonly isCreate: boolean;3495 readonly isCreate: boolean;
3494 readonly type: 'Call' | 'Create';3496 readonly type: 'Call' | 'Create';
3495 }3497 }
34963498
3497 /** @name EthereumTransactionTransactionSignature (397) */3499 /** @name EthereumTransactionTransactionSignature (399) */
3498 interface EthereumTransactionTransactionSignature extends Struct {3500 interface EthereumTransactionTransactionSignature extends Struct {
3499 readonly v: u64;3501 readonly v: u64;
3500 readonly r: H256;3502 readonly r: H256;
3501 readonly s: H256;3503 readonly s: H256;
3502 }3504 }
35033505
3504 /** @name EthereumTransactionEip2930Transaction (399) */3506 /** @name EthereumTransactionEip2930Transaction (401) */
3505 interface EthereumTransactionEip2930Transaction extends Struct {3507 interface EthereumTransactionEip2930Transaction extends Struct {
3506 readonly chainId: u64;3508 readonly chainId: u64;
3507 readonly nonce: U256;3509 readonly nonce: U256;
3516 readonly s: H256;3518 readonly s: H256;
3517 }3519 }
35183520
3519 /** @name EthereumTransactionAccessListItem (401) */3521 /** @name EthereumTransactionAccessListItem (403) */
3520 interface EthereumTransactionAccessListItem extends Struct {3522 interface EthereumTransactionAccessListItem extends Struct {
3521 readonly address: H160;3523 readonly address: H160;
3522 readonly storageKeys: Vec<H256>;3524 readonly storageKeys: Vec<H256>;
3523 }3525 }
35243526
3525 /** @name EthereumTransactionEip1559Transaction (402) */3527 /** @name EthereumTransactionEip1559Transaction (404) */
3526 interface EthereumTransactionEip1559Transaction extends Struct {3528 interface EthereumTransactionEip1559Transaction extends Struct {
3527 readonly chainId: u64;3529 readonly chainId: u64;
3528 readonly nonce: U256;3530 readonly nonce: U256;
3538 readonly s: H256;3540 readonly s: H256;
3539 }3541 }
35403542
3541 /** @name PalletEvmContractHelpersCall (403) */3543 /** @name PalletEvmContractHelpersCall (405) */
3542 interface PalletEvmContractHelpersCall extends Enum {3544 interface PalletEvmContractHelpersCall extends Enum {
3543 readonly isMigrateFromSelfSponsoring: boolean;3545 readonly isMigrateFromSelfSponsoring: boolean;
3544 readonly asMigrateFromSelfSponsoring: {3546 readonly asMigrateFromSelfSponsoring: {
3547 readonly type: 'MigrateFromSelfSponsoring';3549 readonly type: 'MigrateFromSelfSponsoring';
3548 }3550 }
35493551
3550 /** @name PalletEvmMigrationCall (405) */3552 /** @name PalletEvmMigrationCall (407) */
3551 interface PalletEvmMigrationCall extends Enum {3553 interface PalletEvmMigrationCall extends Enum {
3552 readonly isBegin: boolean;3554 readonly isBegin: boolean;
3553 readonly asBegin: {3555 readonly asBegin: {
3575 readonly type: 'Begin' | 'SetData' | 'Finish' | 'InsertEthLogs' | 'InsertEvents' | 'RemoveRmrkData';3577 readonly type: 'Begin' | 'SetData' | 'Finish' | 'InsertEthLogs' | 'InsertEvents' | 'RemoveRmrkData';
3576 }3578 }
35773579
3578 /** @name PalletMaintenanceCall (409) */3580 /** @name PalletMaintenanceCall (411) */
3579 interface PalletMaintenanceCall extends Enum {3581 interface PalletMaintenanceCall extends Enum {
3580 readonly isEnable: boolean;3582 readonly isEnable: boolean;
3581 readonly isDisable: boolean;3583 readonly isDisable: boolean;
3587 readonly type: 'Enable' | 'Disable' | 'ExecutePreimage';3589 readonly type: 'Enable' | 'Disable' | 'ExecutePreimage';
3588 }3590 }
35893591
3590 /** @name PalletTestUtilsCall (410) */3592 /** @name PalletTestUtilsCall (412) */
3591 interface PalletTestUtilsCall extends Enum {3593 interface PalletTestUtilsCall extends Enum {
3592 readonly isEnable: boolean;3594 readonly isEnable: boolean;
3593 readonly isSetTestValue: boolean;3595 readonly isSetTestValue: boolean;
3607 readonly type: 'Enable' | 'SetTestValue' | 'SetTestValueAndRollback' | 'IncTestValue' | 'JustTakeFee' | 'BatchAll';3609 readonly type: 'Enable' | 'SetTestValue' | 'SetTestValueAndRollback' | 'IncTestValue' | 'JustTakeFee' | 'BatchAll';
3608 }3610 }
36093611
3610 /** @name PalletSudoError (412) */3612 /** @name PalletSudoError (414) */
3611 interface PalletSudoError extends Enum {3613 interface PalletSudoError extends Enum {
3612 readonly isRequireSudo: boolean;3614 readonly isRequireSudo: boolean;
3613 readonly type: 'RequireSudo';3615 readonly type: 'RequireSudo';
3614 }3616 }
36153617
3616 /** @name OrmlVestingModuleError (414) */3618 /** @name OrmlVestingModuleError (416) */
3617 interface OrmlVestingModuleError extends Enum {3619 interface OrmlVestingModuleError extends Enum {
3618 readonly isZeroVestingPeriod: boolean;3620 readonly isZeroVestingPeriod: boolean;
3619 readonly isZeroVestingPeriodCount: boolean;3621 readonly isZeroVestingPeriodCount: boolean;
3624 readonly type: 'ZeroVestingPeriod' | 'ZeroVestingPeriodCount' | 'InsufficientBalanceToLock' | 'TooManyVestingSchedules' | 'AmountLow' | 'MaxVestingSchedulesExceeded';3626 readonly type: 'ZeroVestingPeriod' | 'ZeroVestingPeriodCount' | 'InsufficientBalanceToLock' | 'TooManyVestingSchedules' | 'AmountLow' | 'MaxVestingSchedulesExceeded';
3625 }3627 }
36263628
3627 /** @name OrmlXtokensModuleError (415) */3629 /** @name OrmlXtokensModuleError (417) */
3628 interface OrmlXtokensModuleError extends Enum {3630 interface OrmlXtokensModuleError extends Enum {
3629 readonly isAssetHasNoReserve: boolean;3631 readonly isAssetHasNoReserve: boolean;
3630 readonly isNotCrossChainTransfer: boolean;3632 readonly isNotCrossChainTransfer: boolean;
3648 readonly type: 'AssetHasNoReserve' | 'NotCrossChainTransfer' | 'InvalidDest' | 'NotCrossChainTransferableCurrency' | 'UnweighableMessage' | 'XcmExecutionFailed' | 'CannotReanchor' | 'InvalidAncestry' | 'InvalidAsset' | 'DestinationNotInvertible' | 'BadVersion' | 'DistinctReserveForAssetAndFee' | 'ZeroFee' | 'ZeroAmount' | 'TooManyAssetsBeingSent' | 'AssetIndexNonExistent' | 'FeeNotEnough' | 'NotSupportedMultiLocation' | 'MinXcmFeeNotDefined';3650 readonly type: 'AssetHasNoReserve' | 'NotCrossChainTransfer' | 'InvalidDest' | 'NotCrossChainTransferableCurrency' | 'UnweighableMessage' | 'XcmExecutionFailed' | 'CannotReanchor' | 'InvalidAncestry' | 'InvalidAsset' | 'DestinationNotInvertible' | 'BadVersion' | 'DistinctReserveForAssetAndFee' | 'ZeroFee' | 'ZeroAmount' | 'TooManyAssetsBeingSent' | 'AssetIndexNonExistent' | 'FeeNotEnough' | 'NotSupportedMultiLocation' | 'MinXcmFeeNotDefined';
3649 }3651 }
36503652
3651 /** @name OrmlTokensBalanceLock (418) */3653 /** @name OrmlTokensBalanceLock (420) */
3652 interface OrmlTokensBalanceLock extends Struct {3654 interface OrmlTokensBalanceLock extends Struct {
3653 readonly id: U8aFixed;3655 readonly id: U8aFixed;
3654 readonly amount: u128;3656 readonly amount: u128;
3655 }3657 }
36563658
3657 /** @name OrmlTokensAccountData (420) */3659 /** @name OrmlTokensAccountData (422) */
3658 interface OrmlTokensAccountData extends Struct {3660 interface OrmlTokensAccountData extends Struct {
3659 readonly free: u128;3661 readonly free: u128;
3660 readonly reserved: u128;3662 readonly reserved: u128;
3661 readonly frozen: u128;3663 readonly frozen: u128;
3662 }3664 }
36633665
3664 /** @name OrmlTokensReserveData (422) */3666 /** @name OrmlTokensReserveData (424) */
3665 interface OrmlTokensReserveData extends Struct {3667 interface OrmlTokensReserveData extends Struct {
3666 readonly id: Null;3668 readonly id: Null;
3667 readonly amount: u128;3669 readonly amount: u128;
3668 }3670 }
36693671
3670 /** @name OrmlTokensModuleError (424) */3672 /** @name OrmlTokensModuleError (426) */
3671 interface OrmlTokensModuleError extends Enum {3673 interface OrmlTokensModuleError extends Enum {
3672 readonly isBalanceTooLow: boolean;3674 readonly isBalanceTooLow: boolean;
3673 readonly isAmountIntoBalanceFailed: boolean;3675 readonly isAmountIntoBalanceFailed: boolean;
3680 readonly type: 'BalanceTooLow' | 'AmountIntoBalanceFailed' | 'LiquidityRestrictions' | 'MaxLocksExceeded' | 'KeepAlive' | 'ExistentialDeposit' | 'DeadAccount' | 'TooManyReserves';3682 readonly type: 'BalanceTooLow' | 'AmountIntoBalanceFailed' | 'LiquidityRestrictions' | 'MaxLocksExceeded' | 'KeepAlive' | 'ExistentialDeposit' | 'DeadAccount' | 'TooManyReserves';
3681 }3683 }
36823684
3683 /** @name PalletIdentityRegistrarInfo (429) */3685 /** @name PalletIdentityRegistrarInfo (431) */
3684 interface PalletIdentityRegistrarInfo extends Struct {3686 interface PalletIdentityRegistrarInfo extends Struct {
3685 readonly account: AccountId32;3687 readonly account: AccountId32;
3686 readonly fee: u128;3688 readonly fee: u128;
3687 readonly fields: PalletIdentityBitFlags;3689 readonly fields: PalletIdentityBitFlags;
3688 }3690 }
36893691
3690 /** @name PalletIdentityError (431) */3692 /** @name PalletIdentityError (433) */
3691 interface PalletIdentityError extends Enum {3693 interface PalletIdentityError extends Enum {
3692 readonly isTooManySubAccounts: boolean;3694 readonly isTooManySubAccounts: boolean;
3693 readonly isNotFound: boolean;3695 readonly isNotFound: boolean;
3710 readonly type: 'TooManySubAccounts' | 'NotFound' | 'NotNamed' | 'EmptyIndex' | 'FeeChanged' | 'NoIdentity' | 'StickyJudgement' | 'JudgementGiven' | 'InvalidJudgement' | 'InvalidIndex' | 'InvalidTarget' | 'TooManyFields' | 'TooManyRegistrars' | 'AlreadyClaimed' | 'NotSub' | 'NotOwned' | 'JudgementForDifferentIdentity' | 'JudgementPaymentFailed';3712 readonly type: 'TooManySubAccounts' | 'NotFound' | 'NotNamed' | 'EmptyIndex' | 'FeeChanged' | 'NoIdentity' | 'StickyJudgement' | 'JudgementGiven' | 'InvalidJudgement' | 'InvalidIndex' | 'InvalidTarget' | 'TooManyFields' | 'TooManyRegistrars' | 'AlreadyClaimed' | 'NotSub' | 'NotOwned' | 'JudgementForDifferentIdentity' | 'JudgementPaymentFailed';
3711 }3713 }
37123714
3713 /** @name PalletPreimageRequestStatus (432) */3715 /** @name PalletPreimageRequestStatus (434) */
3714 interface PalletPreimageRequestStatus extends Enum {3716 interface PalletPreimageRequestStatus extends Enum {
3715 readonly isUnrequested: boolean;3717 readonly isUnrequested: boolean;
3716 readonly asUnrequested: {3718 readonly asUnrequested: {
3726 readonly type: 'Unrequested' | 'Requested';3728 readonly type: 'Unrequested' | 'Requested';
3727 }3729 }
37283730
3729 /** @name PalletPreimageError (437) */3731 /** @name PalletPreimageError (439) */
3730 interface PalletPreimageError extends Enum {3732 interface PalletPreimageError extends Enum {
3731 readonly isTooBig: boolean;3733 readonly isTooBig: boolean;
3732 readonly isAlreadyNoted: boolean;3734 readonly isAlreadyNoted: boolean;
3737 readonly type: 'TooBig' | 'AlreadyNoted' | 'NotAuthorized' | 'NotNoted' | 'Requested' | 'NotRequested';3739 readonly type: 'TooBig' | 'AlreadyNoted' | 'NotAuthorized' | 'NotNoted' | 'Requested' | 'NotRequested';
3738 }3740 }
37393741
3740 /** @name CumulusPalletXcmpQueueInboundChannelDetails (439) */3742 /** @name CumulusPalletXcmpQueueInboundChannelDetails (441) */
3741 interface CumulusPalletXcmpQueueInboundChannelDetails extends Struct {3743 interface CumulusPalletXcmpQueueInboundChannelDetails extends Struct {
3742 readonly sender: u32;3744 readonly sender: u32;
3743 readonly state: CumulusPalletXcmpQueueInboundState;3745 readonly state: CumulusPalletXcmpQueueInboundState;
3744 readonly messageMetadata: Vec<ITuple<[u32, PolkadotParachainPrimitivesXcmpMessageFormat]>>;3746 readonly messageMetadata: Vec<ITuple<[u32, PolkadotParachainPrimitivesXcmpMessageFormat]>>;
3745 }3747 }
37463748
3747 /** @name CumulusPalletXcmpQueueInboundState (440) */3749 /** @name CumulusPalletXcmpQueueInboundState (442) */
3748 interface CumulusPalletXcmpQueueInboundState extends Enum {3750 interface CumulusPalletXcmpQueueInboundState extends Enum {
3749 readonly isOk: boolean;3751 readonly isOk: boolean;
3750 readonly isSuspended: boolean;3752 readonly isSuspended: boolean;
3751 readonly type: 'Ok' | 'Suspended';3753 readonly type: 'Ok' | 'Suspended';
3752 }3754 }
37533755
3754 /** @name PolkadotParachainPrimitivesXcmpMessageFormat (443) */3756 /** @name PolkadotParachainPrimitivesXcmpMessageFormat (445) */
3755 interface PolkadotParachainPrimitivesXcmpMessageFormat extends Enum {3757 interface PolkadotParachainPrimitivesXcmpMessageFormat extends Enum {
3756 readonly isConcatenatedVersionedXcm: boolean;3758 readonly isConcatenatedVersionedXcm: boolean;
3757 readonly isConcatenatedEncodedBlob: boolean;3759 readonly isConcatenatedEncodedBlob: boolean;
3758 readonly isSignals: boolean;3760 readonly isSignals: boolean;
3759 readonly type: 'ConcatenatedVersionedXcm' | 'ConcatenatedEncodedBlob' | 'Signals';3761 readonly type: 'ConcatenatedVersionedXcm' | 'ConcatenatedEncodedBlob' | 'Signals';
3760 }3762 }
37613763
3762 /** @name CumulusPalletXcmpQueueOutboundChannelDetails (446) */3764 /** @name CumulusPalletXcmpQueueOutboundChannelDetails (448) */
3763 interface CumulusPalletXcmpQueueOutboundChannelDetails extends Struct {3765 interface CumulusPalletXcmpQueueOutboundChannelDetails extends Struct {
3764 readonly recipient: u32;3766 readonly recipient: u32;
3765 readonly state: CumulusPalletXcmpQueueOutboundState;3767 readonly state: CumulusPalletXcmpQueueOutboundState;
3768 readonly lastIndex: u16;3770 readonly lastIndex: u16;
3769 }3771 }
37703772
3771 /** @name CumulusPalletXcmpQueueOutboundState (447) */3773 /** @name CumulusPalletXcmpQueueOutboundState (449) */
3772 interface CumulusPalletXcmpQueueOutboundState extends Enum {3774 interface CumulusPalletXcmpQueueOutboundState extends Enum {
3773 readonly isOk: boolean;3775 readonly isOk: boolean;
3774 readonly isSuspended: boolean;3776 readonly isSuspended: boolean;
3775 readonly type: 'Ok' | 'Suspended';3777 readonly type: 'Ok' | 'Suspended';
3776 }3778 }
37773779
3778 /** @name CumulusPalletXcmpQueueQueueConfigData (449) */3780 /** @name CumulusPalletXcmpQueueQueueConfigData (451) */
3779 interface CumulusPalletXcmpQueueQueueConfigData extends Struct {3781 interface CumulusPalletXcmpQueueQueueConfigData extends Struct {
3780 readonly suspendThreshold: u32;3782 readonly suspendThreshold: u32;
3781 readonly dropThreshold: u32;3783 readonly dropThreshold: u32;
3785 readonly xcmpMaxIndividualWeight: SpWeightsWeightV2Weight;3787 readonly xcmpMaxIndividualWeight: SpWeightsWeightV2Weight;
3786 }3788 }
37873789
3788 /** @name CumulusPalletXcmpQueueError (451) */3790 /** @name CumulusPalletXcmpQueueError (453) */
3789 interface CumulusPalletXcmpQueueError extends Enum {3791 interface CumulusPalletXcmpQueueError extends Enum {
3790 readonly isFailedToSend: boolean;3792 readonly isFailedToSend: boolean;
3791 readonly isBadXcmOrigin: boolean;3793 readonly isBadXcmOrigin: boolean;
3795 readonly type: 'FailedToSend' | 'BadXcmOrigin' | 'BadXcm' | 'BadOverweightIndex' | 'WeightOverLimit';3797 readonly type: 'FailedToSend' | 'BadXcmOrigin' | 'BadXcm' | 'BadOverweightIndex' | 'WeightOverLimit';
3796 }3798 }
37973799
3798 /** @name PalletXcmQueryStatus (452) */3800 /** @name PalletXcmQueryStatus (454) */
3799 interface PalletXcmQueryStatus extends Enum {3801 interface PalletXcmQueryStatus extends Enum {
3800 readonly isPending: boolean;3802 readonly isPending: boolean;
3801 readonly asPending: {3803 readonly asPending: {
3817 readonly type: 'Pending' | 'VersionNotifier' | 'Ready';3819 readonly type: 'Pending' | 'VersionNotifier' | 'Ready';
3818 }3820 }
38193821
3820 /** @name XcmVersionedResponse (456) */3822 /** @name XcmVersionedResponse (458) */
3821 interface XcmVersionedResponse extends Enum {3823 interface XcmVersionedResponse extends Enum {
3822 readonly isV2: boolean;3824 readonly isV2: boolean;
3823 readonly asV2: XcmV2Response;3825 readonly asV2: XcmV2Response;
3826 readonly type: 'V2' | 'V3';3828 readonly type: 'V2' | 'V3';
3827 }3829 }
38283830
3829 /** @name PalletXcmVersionMigrationStage (462) */3831 /** @name PalletXcmVersionMigrationStage (464) */
3830 interface PalletXcmVersionMigrationStage extends Enum {3832 interface PalletXcmVersionMigrationStage extends Enum {
3831 readonly isMigrateSupportedVersion: boolean;3833 readonly isMigrateSupportedVersion: boolean;
3832 readonly isMigrateVersionNotifiers: boolean;3834 readonly isMigrateVersionNotifiers: boolean;
3836 readonly type: 'MigrateSupportedVersion' | 'MigrateVersionNotifiers' | 'NotifyCurrentTargets' | 'MigrateAndNotifyOldTargets';3838 readonly type: 'MigrateSupportedVersion' | 'MigrateVersionNotifiers' | 'NotifyCurrentTargets' | 'MigrateAndNotifyOldTargets';
3837 }3839 }
38383840
3839 /** @name XcmVersionedAssetId (465) */3841 /** @name XcmVersionedAssetId (467) */
3840 interface XcmVersionedAssetId extends Enum {3842 interface XcmVersionedAssetId extends Enum {
3841 readonly isV3: boolean;3843 readonly isV3: boolean;
3842 readonly asV3: XcmV3MultiassetAssetId;3844 readonly asV3: XcmV3MultiassetAssetId;
3843 readonly type: 'V3';3845 readonly type: 'V3';
3844 }3846 }
38453847
3846 /** @name PalletXcmRemoteLockedFungibleRecord (466) */3848 /** @name PalletXcmRemoteLockedFungibleRecord (468) */
3847 interface PalletXcmRemoteLockedFungibleRecord extends Struct {3849 interface PalletXcmRemoteLockedFungibleRecord extends Struct {
3848 readonly amount: u128;3850 readonly amount: u128;
3849 readonly owner: XcmVersionedMultiLocation;3851 readonly owner: XcmVersionedMultiLocation;
3850 readonly locker: XcmVersionedMultiLocation;3852 readonly locker: XcmVersionedMultiLocation;
3851 readonly consumers: Vec<ITuple<[Null, u128]>>;3853 readonly consumers: Vec<ITuple<[Null, u128]>>;
3852 }3854 }
38533855
3854 /** @name PalletXcmError (473) */3856 /** @name PalletXcmError (475) */
3855 interface PalletXcmError extends Enum {3857 interface PalletXcmError extends Enum {
3856 readonly isUnreachable: boolean;3858 readonly isUnreachable: boolean;
3857 readonly isSendFailure: boolean;3859 readonly isSendFailure: boolean;
3876 readonly type: 'Unreachable' | 'SendFailure' | 'Filtered' | 'UnweighableMessage' | 'DestinationNotInvertible' | 'Empty' | 'CannotReanchor' | 'TooManyAssets' | 'InvalidOrigin' | 'BadVersion' | 'BadLocation' | 'NoSubscription' | 'AlreadySubscribed' | 'InvalidAsset' | 'LowBalance' | 'TooManyLocks' | 'AccountNotSovereign' | 'FeesNotMet' | 'LockNotFound' | 'InUse';3878 readonly type: 'Unreachable' | 'SendFailure' | 'Filtered' | 'UnweighableMessage' | 'DestinationNotInvertible' | 'Empty' | 'CannotReanchor' | 'TooManyAssets' | 'InvalidOrigin' | 'BadVersion' | 'BadLocation' | 'NoSubscription' | 'AlreadySubscribed' | 'InvalidAsset' | 'LowBalance' | 'TooManyLocks' | 'AccountNotSovereign' | 'FeesNotMet' | 'LockNotFound' | 'InUse';
3877 }3879 }
38783880
3879 /** @name CumulusPalletXcmError (474) */3881 /** @name CumulusPalletXcmError (476) */
3880 type CumulusPalletXcmError = Null;3882 type CumulusPalletXcmError = Null;
38813883
3882 /** @name CumulusPalletDmpQueueConfigData (475) */3884 /** @name CumulusPalletDmpQueueConfigData (477) */
3883 interface CumulusPalletDmpQueueConfigData extends Struct {3885 interface CumulusPalletDmpQueueConfigData extends Struct {
3884 readonly maxIndividual: SpWeightsWeightV2Weight;3886 readonly maxIndividual: SpWeightsWeightV2Weight;
3885 }3887 }
38863888
3887 /** @name CumulusPalletDmpQueuePageIndexData (476) */3889 /** @name CumulusPalletDmpQueuePageIndexData (478) */
3888 interface CumulusPalletDmpQueuePageIndexData extends Struct {3890 interface CumulusPalletDmpQueuePageIndexData extends Struct {
3889 readonly beginUsed: u32;3891 readonly beginUsed: u32;
3890 readonly endUsed: u32;3892 readonly endUsed: u32;
3891 readonly overweightCount: u64;3893 readonly overweightCount: u64;
3892 }3894 }
38933895
3894 /** @name CumulusPalletDmpQueueError (479) */3896 /** @name CumulusPalletDmpQueueError (481) */
3895 interface CumulusPalletDmpQueueError extends Enum {3897 interface CumulusPalletDmpQueueError extends Enum {
3896 readonly isUnknown: boolean;3898 readonly isUnknown: boolean;
3897 readonly isOverLimit: boolean;3899 readonly isOverLimit: boolean;
3898 readonly type: 'Unknown' | 'OverLimit';3900 readonly type: 'Unknown' | 'OverLimit';
3899 }3901 }
39003902
3901 /** @name PalletUniqueError (483) */3903 /** @name PalletUniqueError (485) */
3902 interface PalletUniqueError extends Enum {3904 interface PalletUniqueError extends Enum {
3903 readonly isCollectionDecimalPointLimitExceeded: boolean;3905 readonly isCollectionDecimalPointLimitExceeded: boolean;
3904 readonly isEmptyArgument: boolean;3906 readonly isEmptyArgument: boolean;
3905 readonly isRepartitionCalledOnNonRefungibleCollection: boolean;3907 readonly isRepartitionCalledOnNonRefungibleCollection: boolean;
3906 readonly type: 'CollectionDecimalPointLimitExceeded' | 'EmptyArgument' | 'RepartitionCalledOnNonRefungibleCollection';3908 readonly type: 'CollectionDecimalPointLimitExceeded' | 'EmptyArgument' | 'RepartitionCalledOnNonRefungibleCollection';
3907 }3909 }
39083910
3909 /** @name PalletConfigurationError (484) */3911 /** @name PalletConfigurationError (486) */
3910 interface PalletConfigurationError extends Enum {3912 interface PalletConfigurationError extends Enum {
3911 readonly isInconsistentConfiguration: boolean;3913 readonly isInconsistentConfiguration: boolean;
3912 readonly type: 'InconsistentConfiguration';3914 readonly type: 'InconsistentConfiguration';
3913 }3915 }
39143916
3915 /** @name UpDataStructsCollection (485) */3917 /** @name UpDataStructsCollection (487) */
3916 interface UpDataStructsCollection extends Struct {3918 interface UpDataStructsCollection extends Struct {
3917 readonly owner: AccountId32;3919 readonly owner: AccountId32;
3918 readonly mode: UpDataStructsCollectionMode;3920 readonly mode: UpDataStructsCollectionMode;
3925 readonly flags: U8aFixed;3927 readonly flags: U8aFixed;
3926 }3928 }
39273929
3928 /** @name UpDataStructsSponsorshipStateAccountId32 (486) */3930 /** @name UpDataStructsSponsorshipStateAccountId32 (488) */
3929 interface UpDataStructsSponsorshipStateAccountId32 extends Enum {3931 interface UpDataStructsSponsorshipStateAccountId32 extends Enum {
3930 readonly isDisabled: boolean;3932 readonly isDisabled: boolean;
3931 readonly isUnconfirmed: boolean;3933 readonly isUnconfirmed: boolean;
3935 readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed';3937 readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed';
3936 }3938 }
39373939
3938 /** @name UpDataStructsProperties (487) */3940 /** @name UpDataStructsProperties (489) */
3939 interface UpDataStructsProperties extends Struct {3941 interface UpDataStructsProperties extends Struct {
3940 readonly map: UpDataStructsPropertiesMapBoundedVec;3942 readonly map: UpDataStructsPropertiesMapBoundedVec;
3941 readonly consumedSpace: u32;3943 readonly consumedSpace: u32;
3942 readonly reserved: u32;3944 readonly reserved: u32;
3943 }3945 }
39443946
3945 /** @name UpDataStructsPropertiesMapBoundedVec (488) */3947 /** @name UpDataStructsPropertiesMapBoundedVec (490) */
3946 interface UpDataStructsPropertiesMapBoundedVec extends BTreeMap<Bytes, Bytes> {}3948 interface UpDataStructsPropertiesMapBoundedVec extends BTreeMap<Bytes, Bytes> {}
39473949
3948 /** @name UpDataStructsPropertiesMapPropertyPermission (493) */3950 /** @name UpDataStructsPropertiesMapPropertyPermission (495) */
3949 interface UpDataStructsPropertiesMapPropertyPermission extends BTreeMap<Bytes, UpDataStructsPropertyPermission> {}3951 interface UpDataStructsPropertiesMapPropertyPermission extends BTreeMap<Bytes, UpDataStructsPropertyPermission> {}
39503952
3951 /** @name UpDataStructsCollectionStats (500) */3953 /** @name UpDataStructsCollectionStats (502) */
3952 interface UpDataStructsCollectionStats extends Struct {3954 interface UpDataStructsCollectionStats extends Struct {
3953 readonly created: u32;3955 readonly created: u32;
3954 readonly destroyed: u32;3956 readonly destroyed: u32;
3955 readonly alive: u32;3957 readonly alive: u32;
3956 }3958 }
39573959
3958 /** @name UpDataStructsTokenChild (501) */3960 /** @name UpDataStructsTokenChild (503) */
3959 interface UpDataStructsTokenChild extends Struct {3961 interface UpDataStructsTokenChild extends Struct {
3960 readonly token: u32;3962 readonly token: u32;
3961 readonly collection: u32;3963 readonly collection: u32;
3962 }3964 }
39633965
3964 /** @name PhantomTypeUpDataStructs (502) */3966 /** @name PhantomTypeUpDataStructs (504) */
3965 interface PhantomTypeUpDataStructs extends Vec<ITuple<[UpDataStructsTokenData, UpDataStructsRpcCollection, UpPovEstimateRpcPovInfo]>> {}3967 interface PhantomTypeUpDataStructs extends Vec<ITuple<[UpDataStructsTokenData, UpDataStructsRpcCollection, UpPovEstimateRpcPovInfo]>> {}
39663968
3967 /** @name UpDataStructsTokenData (504) */3969 /** @name UpDataStructsTokenData (506) */
3968 interface UpDataStructsTokenData extends Struct {3970 interface UpDataStructsTokenData extends Struct {
3969 readonly properties: Vec<UpDataStructsProperty>;3971 readonly properties: Vec<UpDataStructsProperty>;
3970 readonly owner: Option<PalletEvmAccountBasicCrossAccountIdRepr>;3972 readonly owner: Option<PalletEvmAccountBasicCrossAccountIdRepr>;
3971 readonly pieces: u128;3973 readonly pieces: u128;
3972 }3974 }
39733975
3974 /** @name UpDataStructsRpcCollection (506) */3976 /** @name UpDataStructsRpcCollection (507) */
3975 interface UpDataStructsRpcCollection extends Struct {3977 interface UpDataStructsRpcCollection extends Struct {
3976 readonly owner: AccountId32;3978 readonly owner: AccountId32;
3977 readonly mode: UpDataStructsCollectionMode;3979 readonly mode: UpDataStructsCollectionMode;
3987 readonly flags: UpDataStructsRpcCollectionFlags;3989 readonly flags: UpDataStructsRpcCollectionFlags;
3988 }3990 }
39893991
3990 /** @name UpDataStructsRpcCollectionFlags (507) */3992 /** @name UpDataStructsRpcCollectionFlags (508) */
3991 interface UpDataStructsRpcCollectionFlags extends Struct {3993 interface UpDataStructsRpcCollectionFlags extends Struct {
3992 readonly foreign: bool;3994 readonly foreign: bool;
3993 readonly erc721metadata: bool;3995 readonly erc721metadata: bool;
3994 }3996 }
39953997
3996 /** @name UpPovEstimateRpcPovInfo (508) */3998 /** @name UpPovEstimateRpcPovInfo (509) */
3997 interface UpPovEstimateRpcPovInfo extends Struct {3999 interface UpPovEstimateRpcPovInfo extends Struct {
3998 readonly proofSize: u64;4000 readonly proofSize: u64;
3999 readonly compactProofSize: u64;4001 readonly compactProofSize: u64;
4002 readonly keyValues: Vec<UpPovEstimateRpcTrieKeyValue>;4004 readonly keyValues: Vec<UpPovEstimateRpcTrieKeyValue>;
4003 }4005 }
40044006
4005 /** @name SpRuntimeTransactionValidityTransactionValidityError (511) */4007 /** @name SpRuntimeTransactionValidityTransactionValidityError (512) */
4006 interface SpRuntimeTransactionValidityTransactionValidityError extends Enum {4008 interface SpRuntimeTransactionValidityTransactionValidityError extends Enum {
4007 readonly isInvalid: boolean;4009 readonly isInvalid: boolean;
4008 readonly asInvalid: SpRuntimeTransactionValidityInvalidTransaction;4010 readonly asInvalid: SpRuntimeTransactionValidityInvalidTransaction;
4011 readonly type: 'Invalid' | 'Unknown';4013 readonly type: 'Invalid' | 'Unknown';
4012 }4014 }
40134015
4014 /** @name SpRuntimeTransactionValidityInvalidTransaction (512) */4016 /** @name SpRuntimeTransactionValidityInvalidTransaction (513) */
4015 interface SpRuntimeTransactionValidityInvalidTransaction extends Enum {4017 interface SpRuntimeTransactionValidityInvalidTransaction extends Enum {
4016 readonly isCall: boolean;4018 readonly isCall: boolean;
4017 readonly isPayment: boolean;4019 readonly isPayment: boolean;
4028 readonly type: 'Call' | 'Payment' | 'Future' | 'Stale' | 'BadProof' | 'AncientBirthBlock' | 'ExhaustsResources' | 'Custom' | 'BadMandatory' | 'MandatoryValidation' | 'BadSigner';4030 readonly type: 'Call' | 'Payment' | 'Future' | 'Stale' | 'BadProof' | 'AncientBirthBlock' | 'ExhaustsResources' | 'Custom' | 'BadMandatory' | 'MandatoryValidation' | 'BadSigner';
4029 }4031 }
40304032
4031 /** @name SpRuntimeTransactionValidityUnknownTransaction (513) */4033 /** @name SpRuntimeTransactionValidityUnknownTransaction (514) */
4032 interface SpRuntimeTransactionValidityUnknownTransaction extends Enum {4034 interface SpRuntimeTransactionValidityUnknownTransaction extends Enum {
4033 readonly isCannotLookup: boolean;4035 readonly isCannotLookup: boolean;
4034 readonly isNoUnsignedValidator: boolean;4036 readonly isNoUnsignedValidator: boolean;
4037 readonly type: 'CannotLookup' | 'NoUnsignedValidator' | 'Custom';4039 readonly type: 'CannotLookup' | 'NoUnsignedValidator' | 'Custom';
4038 }4040 }
40394041
4040 /** @name UpPovEstimateRpcTrieKeyValue (515) */4042 /** @name UpPovEstimateRpcTrieKeyValue (516) */
4041 interface UpPovEstimateRpcTrieKeyValue extends Struct {4043 interface UpPovEstimateRpcTrieKeyValue extends Struct {
4042 readonly key: Bytes;4044 readonly key: Bytes;
4043 readonly value: Bytes;4045 readonly value: Bytes;
4044 }4046 }
40454047
4046 /** @name PalletCommonError (517) */4048 /** @name PalletCommonError (518) */
4047 interface PalletCommonError extends Enum {4049 interface PalletCommonError extends Enum {
4048 readonly isCollectionNotFound: boolean;4050 readonly isCollectionNotFound: boolean;
4049 readonly isMustBeTokenOwner: boolean;4051 readonly isMustBeTokenOwner: boolean;
4085 readonly type: 'CollectionNotFound' | 'MustBeTokenOwner' | 'NoPermission' | 'CantDestroyNotEmptyCollection' | 'PublicMintingNotAllowed' | 'AddressNotInAllowlist' | 'CollectionNameLimitExceeded' | 'CollectionDescriptionLimitExceeded' | 'CollectionTokenPrefixLimitExceeded' | 'TotalCollectionsLimitExceeded' | 'CollectionAdminCountExceeded' | 'CollectionLimitBoundsExceeded' | 'OwnerPermissionsCantBeReverted' | 'TransferNotAllowed' | 'AccountTokenLimitExceeded' | 'CollectionTokenLimitExceeded' | 'MetadataFlagFrozen' | 'TokenNotFound' | 'TokenValueTooLow' | 'ApprovedValueTooLow' | 'CantApproveMoreThanOwned' | 'AddressIsNotEthMirror' | 'AddressIsZero' | 'UnsupportedOperation' | 'NotSufficientFounds' | 'UserIsNotAllowedToNest' | 'SourceCollectionIsNotAllowedToNest' | 'CollectionFieldSizeExceeded' | 'NoSpaceForProperty' | 'PropertyLimitReached' | 'PropertyKeyIsTooLong' | 'InvalidCharacterInPropertyKey' | 'EmptyPropertyKey' | 'CollectionIsExternal' | 'CollectionIsInternal' | 'ConfirmSponsorshipFail' | 'UserIsNotCollectionAdmin';4087 readonly type: 'CollectionNotFound' | 'MustBeTokenOwner' | 'NoPermission' | 'CantDestroyNotEmptyCollection' | 'PublicMintingNotAllowed' | 'AddressNotInAllowlist' | 'CollectionNameLimitExceeded' | 'CollectionDescriptionLimitExceeded' | 'CollectionTokenPrefixLimitExceeded' | 'TotalCollectionsLimitExceeded' | 'CollectionAdminCountExceeded' | 'CollectionLimitBoundsExceeded' | 'OwnerPermissionsCantBeReverted' | 'TransferNotAllowed' | 'AccountTokenLimitExceeded' | 'CollectionTokenLimitExceeded' | 'MetadataFlagFrozen' | 'TokenNotFound' | 'TokenValueTooLow' | 'ApprovedValueTooLow' | 'CantApproveMoreThanOwned' | 'AddressIsNotEthMirror' | 'AddressIsZero' | 'UnsupportedOperation' | 'NotSufficientFounds' | 'UserIsNotAllowedToNest' | 'SourceCollectionIsNotAllowedToNest' | 'CollectionFieldSizeExceeded' | 'NoSpaceForProperty' | 'PropertyLimitReached' | 'PropertyKeyIsTooLong' | 'InvalidCharacterInPropertyKey' | 'EmptyPropertyKey' | 'CollectionIsExternal' | 'CollectionIsInternal' | 'ConfirmSponsorshipFail' | 'UserIsNotCollectionAdmin';
4086 }4088 }
40874089
4088 /** @name PalletFungibleError (519) */4090 /** @name PalletFungibleError (520) */
4089 interface PalletFungibleError extends Enum {4091 interface PalletFungibleError extends Enum {
4090 readonly isNotFungibleDataUsedToMintFungibleCollectionToken: boolean;4092 readonly isNotFungibleDataUsedToMintFungibleCollectionToken: boolean;
4091 readonly isFungibleItemsHaveNoId: boolean;4093 readonly isFungibleItemsHaveNoId: boolean;
4097 readonly type: 'NotFungibleDataUsedToMintFungibleCollectionToken' | 'FungibleItemsHaveNoId' | 'FungibleItemsDontHaveData' | 'FungibleDisallowsNesting' | 'SettingPropertiesNotAllowed' | 'SettingAllowanceForAllNotAllowed' | 'FungibleTokensAreAlwaysValid';4099 readonly type: 'NotFungibleDataUsedToMintFungibleCollectionToken' | 'FungibleItemsHaveNoId' | 'FungibleItemsDontHaveData' | 'FungibleDisallowsNesting' | 'SettingPropertiesNotAllowed' | 'SettingAllowanceForAllNotAllowed' | 'FungibleTokensAreAlwaysValid';
4098 }4100 }
40994101
4100 /** @name PalletRefungibleError (524) */4102 /** @name PalletRefungibleError (525) */
4101 interface PalletRefungibleError extends Enum {4103 interface PalletRefungibleError extends Enum {
4102 readonly isNotRefungibleDataUsedToMintFungibleCollectionToken: boolean;4104 readonly isNotRefungibleDataUsedToMintFungibleCollectionToken: boolean;
4103 readonly isWrongRefungiblePieces: boolean;4105 readonly isWrongRefungiblePieces: boolean;
4107 readonly type: 'NotRefungibleDataUsedToMintFungibleCollectionToken' | 'WrongRefungiblePieces' | 'RepartitionWhileNotOwningAllPieces' | 'RefungibleDisallowsNesting' | 'SettingPropertiesNotAllowed';4109 readonly type: 'NotRefungibleDataUsedToMintFungibleCollectionToken' | 'WrongRefungiblePieces' | 'RepartitionWhileNotOwningAllPieces' | 'RefungibleDisallowsNesting' | 'SettingPropertiesNotAllowed';
4108 }4110 }
41094111
4110 /** @name PalletNonfungibleItemData (525) */4112 /** @name PalletNonfungibleItemData (526) */
4111 interface PalletNonfungibleItemData extends Struct {4113 interface PalletNonfungibleItemData extends Struct {
4112 readonly owner: PalletEvmAccountBasicCrossAccountIdRepr;4114 readonly owner: PalletEvmAccountBasicCrossAccountIdRepr;
4113 }4115 }
41144116
4115 /** @name UpDataStructsPropertyScope (527) */4117 /** @name UpDataStructsPropertyScope (528) */
4116 interface UpDataStructsPropertyScope extends Enum {4118 interface UpDataStructsPropertyScope extends Enum {
4117 readonly isNone: boolean;4119 readonly isNone: boolean;
4118 readonly isRmrk: boolean;4120 readonly isRmrk: boolean;
4119 readonly type: 'None' | 'Rmrk';4121 readonly type: 'None' | 'Rmrk';
4120 }4122 }
41214123
4122 /** @name PalletNonfungibleError (530) */4124 /** @name PalletNonfungibleError (531) */
4123 interface PalletNonfungibleError extends Enum {4125 interface PalletNonfungibleError extends Enum {
4124 readonly isNotNonfungibleDataUsedToMintFungibleCollectionToken: boolean;4126 readonly isNotNonfungibleDataUsedToMintFungibleCollectionToken: boolean;
4125 readonly isNonfungibleItemsHaveNoAmount: boolean;4127 readonly isNonfungibleItemsHaveNoAmount: boolean;
4126 readonly isCantBurnNftWithChildren: boolean;4128 readonly isCantBurnNftWithChildren: boolean;
4127 readonly type: 'NotNonfungibleDataUsedToMintFungibleCollectionToken' | 'NonfungibleItemsHaveNoAmount' | 'CantBurnNftWithChildren';4129 readonly type: 'NotNonfungibleDataUsedToMintFungibleCollectionToken' | 'NonfungibleItemsHaveNoAmount' | 'CantBurnNftWithChildren';
4128 }4130 }
41294131
4130 /** @name PalletStructureError (531) */4132 /** @name PalletStructureError (532) */
4131 interface PalletStructureError extends Enum {4133 interface PalletStructureError extends Enum {
4132 readonly isOuroborosDetected: boolean;4134 readonly isOuroborosDetected: boolean;
4133 readonly isDepthLimit: boolean;4135 readonly isDepthLimit: boolean;
4137 readonly type: 'OuroborosDetected' | 'DepthLimit' | 'BreadthLimit' | 'TokenNotFound' | 'CantNestTokenUnderCollection';4139 readonly type: 'OuroborosDetected' | 'DepthLimit' | 'BreadthLimit' | 'TokenNotFound' | 'CantNestTokenUnderCollection';
4138 }4140 }
41394141
4140 /** @name PalletAppPromotionError (536) */4142 /** @name PalletAppPromotionError (537) */
4141 interface PalletAppPromotionError extends Enum {4143 interface PalletAppPromotionError extends Enum {
4142 readonly isAdminNotSet: boolean;4144 readonly isAdminNotSet: boolean;
4143 readonly isNoPermission: boolean;4145 readonly isNoPermission: boolean;
4149 readonly type: 'AdminNotSet' | 'NoPermission' | 'NotSufficientFunds' | 'PendingForBlockOverflow' | 'SponsorNotSet' | 'InsufficientStakedBalance' | 'InconsistencyState';4151 readonly type: 'AdminNotSet' | 'NoPermission' | 'NotSufficientFunds' | 'PendingForBlockOverflow' | 'SponsorNotSet' | 'InsufficientStakedBalance' | 'InconsistencyState';
4150 }4152 }
41514153
4152 /** @name PalletForeignAssetsModuleError (537) */4154 /** @name PalletForeignAssetsModuleError (538) */
4153 interface PalletForeignAssetsModuleError extends Enum {4155 interface PalletForeignAssetsModuleError extends Enum {
4154 readonly isBadLocation: boolean;4156 readonly isBadLocation: boolean;
4155 readonly isMultiLocationExisted: boolean;4157 readonly isMultiLocationExisted: boolean;
4158 readonly type: 'BadLocation' | 'MultiLocationExisted' | 'AssetIdNotExists' | 'AssetIdExisted';4160 readonly type: 'BadLocation' | 'MultiLocationExisted' | 'AssetIdNotExists' | 'AssetIdExisted';
4159 }4161 }
41604162
4161 /** @name PalletEvmCodeMetadata (538) */4163 /** @name PalletEvmCodeMetadata (539) */
4162 interface PalletEvmCodeMetadata extends Struct {4164 interface PalletEvmCodeMetadata extends Struct {
4163 readonly size_: u64;4165 readonly size_: u64;
4164 readonly hash_: H256;4166 readonly hash_: H256;
4165 }4167 }
41664168
4167 /** @name PalletEvmError (540) */4169 /** @name PalletEvmError (541) */
4168 interface PalletEvmError extends Enum {4170 interface PalletEvmError extends Enum {
4169 readonly isBalanceLow: boolean;4171 readonly isBalanceLow: boolean;
4170 readonly isFeeOverflow: boolean;4172 readonly isFeeOverflow: boolean;
4180 readonly type: 'BalanceLow' | 'FeeOverflow' | 'PaymentOverflow' | 'WithdrawFailed' | 'GasPriceTooLow' | 'InvalidNonce' | 'GasLimitTooLow' | 'GasLimitTooHigh' | 'Undefined' | 'Reentrancy' | 'TransactionMustComeFromEOA';4182 readonly type: 'BalanceLow' | 'FeeOverflow' | 'PaymentOverflow' | 'WithdrawFailed' | 'GasPriceTooLow' | 'InvalidNonce' | 'GasLimitTooLow' | 'GasLimitTooHigh' | 'Undefined' | 'Reentrancy' | 'TransactionMustComeFromEOA';
4181 }4183 }
41824184
4183 /** @name FpRpcTransactionStatus (543) */4185 /** @name FpRpcTransactionStatus (544) */
4184 interface FpRpcTransactionStatus extends Struct {4186 interface FpRpcTransactionStatus extends Struct {
4185 readonly transactionHash: H256;4187 readonly transactionHash: H256;
4186 readonly transactionIndex: u32;4188 readonly transactionIndex: u32;
4191 readonly logsBloom: EthbloomBloom;4193 readonly logsBloom: EthbloomBloom;
4192 }4194 }
41934195
4194 /** @name EthbloomBloom (545) */4196 /** @name EthbloomBloom (546) */
4195 interface EthbloomBloom extends U8aFixed {}4197 interface EthbloomBloom extends U8aFixed {}
41964198
4197 /** @name EthereumReceiptReceiptV3 (547) */4199 /** @name EthereumReceiptReceiptV3 (548) */
4198 interface EthereumReceiptReceiptV3 extends Enum {4200 interface EthereumReceiptReceiptV3 extends Enum {
4199 readonly isLegacy: boolean;4201 readonly isLegacy: boolean;
4200 readonly asLegacy: EthereumReceiptEip658ReceiptData;4202 readonly asLegacy: EthereumReceiptEip658ReceiptData;
4205 readonly type: 'Legacy' | 'Eip2930' | 'Eip1559';4207 readonly type: 'Legacy' | 'Eip2930' | 'Eip1559';
4206 }4208 }
42074209
4208 /** @name EthereumReceiptEip658ReceiptData (548) */4210 /** @name EthereumReceiptEip658ReceiptData (549) */
4209 interface EthereumReceiptEip658ReceiptData extends Struct {4211 interface EthereumReceiptEip658ReceiptData extends Struct {
4210 readonly statusCode: u8;4212 readonly statusCode: u8;
4211 readonly usedGas: U256;4213 readonly usedGas: U256;
4212 readonly logsBloom: EthbloomBloom;4214 readonly logsBloom: EthbloomBloom;
4213 readonly logs: Vec<EthereumLog>;4215 readonly logs: Vec<EthereumLog>;
4214 }4216 }
42154217
4216 /** @name EthereumBlock (549) */4218 /** @name EthereumBlock (550) */
4217 interface EthereumBlock extends Struct {4219 interface EthereumBlock extends Struct {
4218 readonly header: EthereumHeader;4220 readonly header: EthereumHeader;
4219 readonly transactions: Vec<EthereumTransactionTransactionV2>;4221 readonly transactions: Vec<EthereumTransactionTransactionV2>;
4220 readonly ommers: Vec<EthereumHeader>;4222 readonly ommers: Vec<EthereumHeader>;
4221 }4223 }
42224224
4223 /** @name EthereumHeader (550) */4225 /** @name EthereumHeader (551) */
4224 interface EthereumHeader extends Struct {4226 interface EthereumHeader extends Struct {
4225 readonly parentHash: H256;4227 readonly parentHash: H256;
4226 readonly ommersHash: H256;4228 readonly ommersHash: H256;
4239 readonly nonce: EthereumTypesHashH64;4241 readonly nonce: EthereumTypesHashH64;
4240 }4242 }
42414243
4242 /** @name EthereumTypesHashH64 (551) */4244 /** @name EthereumTypesHashH64 (552) */
4243 interface EthereumTypesHashH64 extends U8aFixed {}4245 interface EthereumTypesHashH64 extends U8aFixed {}
42444246
4245 /** @name PalletEthereumError (556) */4247 /** @name PalletEthereumError (557) */
4246 interface PalletEthereumError extends Enum {4248 interface PalletEthereumError extends Enum {
4247 readonly isInvalidSignature: boolean;4249 readonly isInvalidSignature: boolean;
4248 readonly isPreLogExists: boolean;4250 readonly isPreLogExists: boolean;
4249 readonly type: 'InvalidSignature' | 'PreLogExists';4251 readonly type: 'InvalidSignature' | 'PreLogExists';
4250 }4252 }
42514253
4252 /** @name PalletEvmCoderSubstrateError (557) */4254 /** @name PalletEvmCoderSubstrateError (558) */
4253 interface PalletEvmCoderSubstrateError extends Enum {4255 interface PalletEvmCoderSubstrateError extends Enum {
4254 readonly isOutOfGas: boolean;4256 readonly isOutOfGas: boolean;
4255 readonly isOutOfFund: boolean;4257 readonly isOutOfFund: boolean;
4256 readonly type: 'OutOfGas' | 'OutOfFund';4258 readonly type: 'OutOfGas' | 'OutOfFund';
4257 }4259 }
42584260
4259 /** @name UpDataStructsSponsorshipStateBasicCrossAccountIdRepr (558) */4261 /** @name UpDataStructsSponsorshipStateBasicCrossAccountIdRepr (559) */
4260 interface UpDataStructsSponsorshipStateBasicCrossAccountIdRepr extends Enum {4262 interface UpDataStructsSponsorshipStateBasicCrossAccountIdRepr extends Enum {
4261 readonly isDisabled: boolean;4263 readonly isDisabled: boolean;
4262 readonly isUnconfirmed: boolean;4264 readonly isUnconfirmed: boolean;
4266 readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed';4268 readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed';
4267 }4269 }
42684270
4269 /** @name PalletEvmContractHelpersSponsoringModeT (559) */4271 /** @name PalletEvmContractHelpersSponsoringModeT (560) */
4270 interface PalletEvmContractHelpersSponsoringModeT extends Enum {4272 interface PalletEvmContractHelpersSponsoringModeT extends Enum {
4271 readonly isDisabled: boolean;4273 readonly isDisabled: boolean;
4272 readonly isAllowlisted: boolean;4274 readonly isAllowlisted: boolean;
4273 readonly isGenerous: boolean;4275 readonly isGenerous: boolean;
4274 readonly type: 'Disabled' | 'Allowlisted' | 'Generous';4276 readonly type: 'Disabled' | 'Allowlisted' | 'Generous';
4275 }4277 }
42764278
4277 /** @name PalletEvmContractHelpersError (565) */4279 /** @name PalletEvmContractHelpersError (566) */
4278 interface PalletEvmContractHelpersError extends Enum {4280 interface PalletEvmContractHelpersError extends Enum {
4279 readonly isNoPermission: boolean;4281 readonly isNoPermission: boolean;
4280 readonly isNoPendingSponsor: boolean;4282 readonly isNoPendingSponsor: boolean;
4281 readonly isTooManyMethodsHaveSponsoredLimit: boolean;4283 readonly isTooManyMethodsHaveSponsoredLimit: boolean;
4282 readonly type: 'NoPermission' | 'NoPendingSponsor' | 'TooManyMethodsHaveSponsoredLimit';4284 readonly type: 'NoPermission' | 'NoPendingSponsor' | 'TooManyMethodsHaveSponsoredLimit';
4283 }4285 }
42844286
4285 /** @name PalletEvmMigrationError (566) */4287 /** @name PalletEvmMigrationError (567) */
4286 interface PalletEvmMigrationError extends Enum {4288 interface PalletEvmMigrationError extends Enum {
4287 readonly isAccountNotEmpty: boolean;4289 readonly isAccountNotEmpty: boolean;
4288 readonly isAccountIsNotMigrating: boolean;4290 readonly isAccountIsNotMigrating: boolean;
4289 readonly isBadEvent: boolean;4291 readonly isBadEvent: boolean;
4290 readonly type: 'AccountNotEmpty' | 'AccountIsNotMigrating' | 'BadEvent';4292 readonly type: 'AccountNotEmpty' | 'AccountIsNotMigrating' | 'BadEvent';
4291 }4293 }
42924294
4293 /** @name PalletMaintenanceError (567) */4295 /** @name PalletMaintenanceError (568) */
4294 type PalletMaintenanceError = Null;4296 type PalletMaintenanceError = Null;
42954297
4296 /** @name PalletTestUtilsError (568) */4298 /** @name PalletTestUtilsError (569) */
4297 interface PalletTestUtilsError extends Enum {4299 interface PalletTestUtilsError extends Enum {
4298 readonly isTestPalletDisabled: boolean;4300 readonly isTestPalletDisabled: boolean;
4299 readonly isTriggerRollback: boolean;4301 readonly isTriggerRollback: boolean;
4300 readonly type: 'TestPalletDisabled' | 'TriggerRollback';4302 readonly type: 'TestPalletDisabled' | 'TriggerRollback';
4301 }4303 }
43024304
4303 /** @name SpRuntimeMultiSignature (570) */4305 /** @name SpRuntimeMultiSignature (571) */
4304 interface SpRuntimeMultiSignature extends Enum {4306 interface SpRuntimeMultiSignature extends Enum {
4305 readonly isEd25519: boolean;4307 readonly isEd25519: boolean;
4306 readonly asEd25519: SpCoreEd25519Signature;4308 readonly asEd25519: SpCoreEd25519Signature;
4311 readonly type: 'Ed25519' | 'Sr25519' | 'Ecdsa';4313 readonly type: 'Ed25519' | 'Sr25519' | 'Ecdsa';
4312 }4314 }
43134315
4314 /** @name SpCoreEd25519Signature (571) */4316 /** @name SpCoreEd25519Signature (572) */
4315 interface SpCoreEd25519Signature extends U8aFixed {}4317 interface SpCoreEd25519Signature extends U8aFixed {}
43164318
4317 /** @name SpCoreSr25519Signature (573) */4319 /** @name SpCoreSr25519Signature (574) */
4318 interface SpCoreSr25519Signature extends U8aFixed {}4320 interface SpCoreSr25519Signature extends U8aFixed {}
43194321
4320 /** @name SpCoreEcdsaSignature (574) */4322 /** @name SpCoreEcdsaSignature (575) */
4321 interface SpCoreEcdsaSignature extends U8aFixed {}4323 interface SpCoreEcdsaSignature extends U8aFixed {}
43224324
4323 /** @name FrameSystemExtensionsCheckSpecVersion (577) */4325 /** @name FrameSystemExtensionsCheckSpecVersion (578) */
4324 type FrameSystemExtensionsCheckSpecVersion = Null;4326 type FrameSystemExtensionsCheckSpecVersion = Null;
43254327
4326 /** @name FrameSystemExtensionsCheckTxVersion (578) */4328 /** @name FrameSystemExtensionsCheckTxVersion (579) */
4327 type FrameSystemExtensionsCheckTxVersion = Null;4329 type FrameSystemExtensionsCheckTxVersion = Null;
43284330
4329 /** @name FrameSystemExtensionsCheckGenesis (579) */4331 /** @name FrameSystemExtensionsCheckGenesis (580) */
4330 type FrameSystemExtensionsCheckGenesis = Null;4332 type FrameSystemExtensionsCheckGenesis = Null;
43314333
4332 /** @name FrameSystemExtensionsCheckNonce (582) */4334 /** @name FrameSystemExtensionsCheckNonce (583) */
4333 interface FrameSystemExtensionsCheckNonce extends Compact<u32> {}4335 interface FrameSystemExtensionsCheckNonce extends Compact<u32> {}
43344336
4335 /** @name FrameSystemExtensionsCheckWeight (583) */4337 /** @name FrameSystemExtensionsCheckWeight (584) */
4336 type FrameSystemExtensionsCheckWeight = Null;4338 type FrameSystemExtensionsCheckWeight = Null;
43374339
4338 /** @name OpalRuntimeRuntimeCommonMaintenanceCheckMaintenance (584) */4340 /** @name OpalRuntimeRuntimeCommonMaintenanceCheckMaintenance (585) */
4339 type OpalRuntimeRuntimeCommonMaintenanceCheckMaintenance = Null;4341 type OpalRuntimeRuntimeCommonMaintenanceCheckMaintenance = Null;
43404342
4341 /** @name OpalRuntimeRuntimeCommonIdentityDisableIdentityCalls (585) */4343 /** @name OpalRuntimeRuntimeCommonIdentityDisableIdentityCalls (586) */
4342 type OpalRuntimeRuntimeCommonIdentityDisableIdentityCalls = Null;4344 type OpalRuntimeRuntimeCommonIdentityDisableIdentityCalls = Null;
43434345
4344 /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (586) */4346 /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (587) */
4345 interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact<u128> {}4347 interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact<u128> {}
43464348
4347 /** @name OpalRuntimeRuntime (587) */4349 /** @name OpalRuntimeRuntime (588) */
4348 type OpalRuntimeRuntime = Null;4350 type OpalRuntimeRuntime = Null;
43494351
4350 /** @name PalletEthereumFakeTransactionFinalizer (588) */4352 /** @name PalletEthereumFakeTransactionFinalizer (589) */
4351 type PalletEthereumFakeTransactionFinalizer = Null;4353 type PalletEthereumFakeTransactionFinalizer = Null;
43524354
4353} // declare module4355} // declare module
modifiedtests/src/sub/appPromotion/appPromotion.test.tsdiffbeforeafterboth
497 expect((await collectionWithoutSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress});497 expect((await collectionWithoutSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress});
498498
499 // Can set sponsoring for collection with unconfirmed sponsor499 // Can set sponsoring for collection with unconfirmed sponsor
500 const collectionWithUnconfirmedSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'Unconfirmed', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: oldSponsor.address});500 const collectionWithUnconfirmedSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'Unconfirmed', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: {Substrate: oldSponsor.address}});
501 expect((await collectionWithUnconfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Unconfirmed: oldSponsor.address});501 expect((await collectionWithUnconfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Unconfirmed: oldSponsor.address});
502 await expect(helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorCollection(collectionWithUnconfirmedSponsor.collectionId))).to.be.fulfilled;502 await expect(helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorCollection(collectionWithUnconfirmedSponsor.collectionId))).to.be.fulfilled;
503 expect((await collectionWithUnconfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress});503 expect((await collectionWithUnconfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress});
504504
505 // Can set sponsoring for collection with confirmed sponsor505 // Can set sponsoring for collection with confirmed sponsor
506 const collectionWithConfirmedSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'Confirmed', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: oldSponsor.address});506 const collectionWithConfirmedSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'Confirmed', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: {Substrate: oldSponsor.address}});
507 await collectionWithConfirmedSponsor.confirmSponsorship(oldSponsor);507 await collectionWithConfirmedSponsor.confirmSponsorship(oldSponsor);
508 await expect(helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorCollection(collectionWithConfirmedSponsor.collectionId))).to.be.fulfilled;508 await expect(helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorCollection(collectionWithConfirmedSponsor.collectionId))).to.be.fulfilled;
509 expect((await collectionWithConfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress});509 expect((await collectionWithConfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress});
584 itSub('should not affect collection which is not sponsored by pallete', async ({helper}) => {584 itSub('should not affect collection which is not sponsored by pallete', async ({helper}) => {
585 const api = helper.getApi();585 const api = helper.getApi();
586 const [collectionOwner] = await getAccounts(1);586 const [collectionOwner] = await getAccounts(1);
587 const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: collectionOwner.address});587 const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: {Substrate: collectionOwner.address}});
588 await collection.confirmSponsorship(collectionOwner);588 await collection.confirmSponsorship(collectionOwner);
589589
590 await expect(helper.signTransaction(palletAdmin, api.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.rejected;590 await expect(helper.signTransaction(palletAdmin, api.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.rejected;
modifiedtests/src/util/playgrounds/types.tsdiffbeforeafterboth
142 }142 }
143}143}
144
145export interface ICollectionFlags {
146 foreign: boolean,
147 erc721metadata: boolean,
148}
149
150export enum CollectionFlag {
151 None = 0,
152 /// External collections can't be managed using `unique` api
153 External = 1,
154 /// Supports ERC721Metadata
155 Erc721metadata = 64,
156 /// Tokens in foreign collections can be transferred, but not burnt
157 Foreign = 128,
158}
144159
145export interface ICollectionCreationOptions {160export interface ICollectionCreationOptions {
146 name?: string | number[];161 name?: string | number[];
155 properties?: IProperty[];170 properties?: IProperty[];
156 tokenPropertyPermissions?: ITokenPropertyPermission[];171 tokenPropertyPermissions?: ITokenPropertyPermission[];
157 limits?: ICollectionLimits;172 limits?: ICollectionLimits;
158 pendingSponsor?: TSubstrateAccount;173 pendingSponsor?: ICrossAccountId;
174 adminList?: ICrossAccountId[];
175 flags?: number[] | CollectionFlag[] ,
159}176}
160177
161export interface IChainProperties {178export interface IChainProperties {
modifiedtests/src/util/playgrounds/unique.tsdiffbeforeafterboth
44 MoonbeamAssetInfo,44 MoonbeamAssetInfo,
45 DemocracyStandardAccountVote,45 DemocracyStandardAccountVote,
46 IEthCrossAccountId,46 IEthCrossAccountId,
47 CollectionFlag,
47} from './types';48} from './types';
48import {RuntimeDispatchInfo} from '@polkadot/types/interfaces';49import {RuntimeDispatchInfo} from '@polkadot/types/interfaces';
49import type {Vec} from '@polkadot/types-codec';50import type {Vec} from '@polkadot/types-codec';
50import {FrameSystemEventRecord, PalletBalancesIdAmount} from '@polkadot/types/lookup';51import {FrameSystemEventRecord, PalletBalancesIdAmount} from '@polkadot/types/lookup';
52import {arrayUnzip} from '@polkadot/util';
5153
52export class CrossAccountId {54export class CrossAccountId {
53 Substrate!: TSubstrateAccount;55 Substrate!: TSubstrateAccount;
1625 if(typeof collectionOptions[key as 'name' | 'description' | 'tokenPrefix'] === 'string') collectionOptions[key as 'name' | 'description' | 'tokenPrefix'] = this.helper.util.str2vec(collectionOptions[key as 'name' | 'description' | 'tokenPrefix'] as string);1627 if(typeof collectionOptions[key as 'name' | 'description' | 'tokenPrefix'] === 'string') collectionOptions[key as 'name' | 'description' | 'tokenPrefix'] = this.helper.util.str2vec(collectionOptions[key as 'name' | 'description' | 'tokenPrefix'] as string);
1626 }1628 }
1629
1630 let flags = 0;
1631 // convert CollectionFlags to number and join them in one number
1632 if(collectionOptions.flags) {
1633 for(let i = 0; i < collectionOptions.flags.length; i++){
1634 const flag = collectionOptions.flags[i];
1635 flags = flags | flag;
1636 }
1637 }
1638 collectionOptions.flags = [flags];
1639
1627 const creationResult = await this.helper.executeExtrinsic(1640 const creationResult = await this.helper.executeExtrinsic(
1628 signer,1641 signer,