difftreelog
rename: use rmrk-core as proxy-rmrk-core in runtime
in: master
12 files changed
pallets/proxy-rmrk-core/Cargo.tomldiffbeforeafterboth--- /dev/null
+++ b/pallets/proxy-rmrk-core/Cargo.toml
@@ -0,0 +1,49 @@
+[package]
+name = "pallet-rmrk-core"
+version = "0.1.0"
+license = "GPLv3"
+edition = "2021"
+
+[dependencies.codec]
+default-features = false
+features = ['derive']
+package = 'parity-scale-codec'
+version = '3.1.2'
+
+[dependencies]
+frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }
+frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }
+sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }
+sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }
+sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }
+pallet-common = { default-features = false, path = '../common' }
+pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }
+# pallet-structure = { default-features = false, path = '../structure' }
+up-data-structs = { default-features = false, path = '../../primitives/data-structs' }
+# evm-coder = { default-features = false, path = '../../crates/evm-coder' }
+# pallet-evm-coder-substrate = { default-features = false, path = '../evm-coder-substrate' }
+pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }
+frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }
+scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
+
+[features]
+default = ["std"]
+std = [
+ "frame-support/std",
+ "frame-system/std",
+ "sp-runtime/std",
+ "sp-std/std",
+ "up-data-structs/std",
+ "pallet-common/std",
+ "pallet-nonfungible/std",
+ "pallet-evm/std",
+ # "pallet-structure/std",
+ # "evm-coder/std",
+ # "pallet-evm-coder-substrate/std",
+ 'frame-benchmarking/std',
+]
+runtime-benchmarks = [
+ 'frame-benchmarking',
+ 'frame-support/runtime-benchmarks',
+ 'frame-system/runtime-benchmarks',
+]
pallets/proxy-rmrk-core/src/lib.rsdiffbeforeafterboth--- /dev/null
+++ b/pallets/proxy-rmrk-core/src/lib.rs
@@ -0,0 +1,235 @@
+// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
+// This file is part of Unique Network.
+
+// Unique Network is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Unique Network is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
+
+#![cfg_attr(not(feature = "std"), no_std)]
+
+use frame_support::{pallet_prelude::*, transactional, BoundedVec, traits::ConstU32, dispatch::DispatchResult};
+use frame_system::{pallet_prelude::*, ensure_signed};
+use sp_runtime::DispatchError;
+use up_data_structs::*;
+use pallet_common::{Pallet as PalletCommon, Error as CommonError, CollectionHandle, CommonCollectionOperations};
+use pallet_nonfungible::{Pallet as PalletNft, NonfungibleHandle};
+use pallet_evm::account::CrossAccountId;
+
+pub use pallet::*;
+
+pub mod misc;
+pub mod property;
+
+use misc::*;
+pub use property::*;
+
+#[frame_support::pallet]
+pub mod pallet {
+ use super::*;
+ use pallet_evm::account;
+
+ #[pallet::config]
+ pub trait Config: frame_system::Config
+ + pallet_common::Config
+ + pallet_nonfungible::Config
+ + account::Config {
+ type Event: From<Event<Self>> + IsType<<Self as frame_system::Config>::Event>;
+ }
+
+ #[pallet::pallet]
+ #[pallet::generate_store(pub(super) trait Store)]
+ pub struct Pallet<T>(_);
+
+ #[pallet::event]
+ #[pallet::generate_deposit(pub(super) fn deposit_event)]
+ pub enum Event<T: Config> {
+ CollectionCreated {
+ issuer: T::AccountId,
+ collection_id: CollectionId,
+ },
+ CollectionDestroyed {
+ issuer: T::AccountId,
+ collection_id: CollectionId,
+ },
+ CollectionLocked {
+ issuer: T::AccountId,
+ collection_id: CollectionId,
+ },
+ }
+
+ #[pallet::error]
+ pub enum Error<T> {
+ /* Unique-specific events */
+ CorruptedCollectionType,
+ NotRmrkCollection,
+ RmrkPropertyIsTooLong,
+
+ /* RMRK compatible events */
+ CollectionNotEmpty,
+ NoAvailableCollectionId,
+ CollectionUnknown,
+ }
+
+ #[pallet::call]
+ impl<T: Config> Pallet<T> {
+ #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]
+ #[transactional]
+ pub fn create_collection(
+ origin: OriginFor<T>,
+ metadata: PropertyValue,
+ max: Option<u32>,
+ symbol: BoundedVec<u8, ConstU32<MAX_TOKEN_PREFIX_LENGTH>>,
+ ) -> DispatchResult {
+ let sender = ensure_signed(origin)?;
+
+ let limits = max.map(|max| CollectionLimits {
+ token_limit: Some(max),
+ ..Default::default()
+ });
+
+ let data = CreateCollectionData {
+ limits,
+ token_prefix: symbol,
+ ..Default::default()
+ };
+
+ let collection_id_res = <PalletNft<T>>::init_collection(sender.clone(), data);
+
+ if let Err(DispatchError::Arithmetic(_)) = &collection_id_res {
+ return Err(<Error<T>>::NoAvailableCollectionId.into());
+ }
+
+ let collection_id = collection_id_res?;
+
+ let collection = Self::get_nft_collection(collection_id)?.into_inner();
+
+ <PalletCommon<T>>::set_scoped_collection_properties(
+ &collection,
+ PropertyScope::Rmrk,
+ [
+ rmrk_property!(Config=T, Metadata: metadata)?,
+ rmrk_property!(Config=T, CollectionType: CollectionType::Regular)?,
+ ].into_iter()
+ )?;
+
+ Self::deposit_event(Event::CollectionCreated { issuer: sender, collection_id });
+
+ Ok(())
+ }
+
+ #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]
+ #[transactional]
+ pub fn destroy_collection(
+ origin: OriginFor<T>,
+ collection_id: CollectionId,
+ ) -> DispatchResult {
+ let sender = ensure_signed(origin)?;
+ let cross_sender = T::CrossAccountId::from_sub(sender.clone());
+
+ let collection = Self::get_nft_collection(collection_id)?;
+
+ Self::check_collection_type(collection_id, CollectionType::Regular)?;
+
+ ensure!(collection.total_supply() == 0, <Error<T>>::CollectionNotEmpty);
+
+ <PalletNft<T>>::destroy_collection(collection, &cross_sender)?;
+
+ Self::deposit_event(Event::CollectionDestroyed { issuer: sender, collection_id });
+
+ Ok(())
+ }
+
+ #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]
+ #[transactional]
+ pub fn change_collection_issuer(
+ origin: OriginFor<T>,
+ collection_id: CollectionId,
+ new_issuer: T::AccountId,
+ ) -> DispatchResult {
+ let sender = ensure_signed(origin)?;
+
+ Self::change_collection_owner(
+ collection_id,
+ CollectionType::Regular,
+ sender,
+ new_issuer
+ )?;
+
+ Ok(())
+ }
+
+ #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]
+ #[transactional]
+ pub fn lock_collection(
+ origin: OriginFor<T>,
+ collection_id: CollectionId,
+ ) -> DispatchResult {
+ let sender = ensure_signed(origin)?;
+ let cross_sender = T::CrossAccountId::from_sub(sender.clone());
+
+ let collection = Self::get_nft_collection(collection_id)?;
+ collection.check_is_owner(&cross_sender)?;
+
+ let token_count = collection.total_supply();
+
+ let mut collection = collection.into_inner();
+ collection.limits.token_limit = Some(token_count);
+ collection.save()?;
+
+ Self::deposit_event(Event::CollectionLocked { issuer: sender, collection_id });
+
+ Ok(())
+ }
+ }
+}
+
+impl<T: Config> Pallet<T> {
+ fn change_collection_owner(
+ collection_id: CollectionId,
+ collection_type: CollectionType,
+ sender: T::AccountId,
+ new_owner: T::AccountId,
+ ) -> DispatchResult {
+ let mut collection = Self::get_nft_collection(collection_id)?.into_inner();
+ collection.check_is_owner(&T::CrossAccountId::from_sub(sender))?;
+
+ Self::check_collection_type(collection_id, collection_type)?;
+
+ collection.owner = new_owner;
+ collection.save()
+ }
+
+ fn get_nft_collection(collection_id: CollectionId) -> Result<NonfungibleHandle<T>, DispatchError> {
+ let collection = <CollectionHandle<T>>::try_get(collection_id)
+ .map_err(|_| <Error<T>>::CollectionUnknown)?
+ .into_nft_collection()?;
+
+ Ok(collection)
+ }
+
+ fn get_collection_type(collection_id: CollectionId) -> Result<CollectionType, DispatchError> {
+ let collection_type: CollectionType = <PalletCommon<T>>::collection_properties(collection_id)
+ .get(&rmrk_property!(Config=T, CollectionType)?)
+ .ok_or(<Error<T>>::NotRmrkCollection)?
+ .try_into()
+ .map_err(<Error<T>>::from)?;
+
+ Ok(collection_type)
+ }
+
+ fn check_collection_type(collection_id: CollectionId, collection_type: CollectionType) -> DispatchResult {
+ let actual_type = Self::get_collection_type(collection_id)?;
+ ensure!(actual_type == collection_type, <CommonError<T>>::NoPermission);
+
+ Ok(())
+ }
+}
pallets/proxy-rmrk-core/src/misc.rsdiffbeforeafterboth--- /dev/null
+++ b/pallets/proxy-rmrk-core/src/misc.rs
@@ -0,0 +1,59 @@
+use super::*;
+use codec::{Encode, Decode};
+use pallet_nonfungible::NonfungibleHandle;
+
+macro_rules! impl_rmrk_value {
+ ($enum_name:path, decode_error: $error:ident) => {
+ impl From<$enum_name> for PropertyValue {
+ fn from(e: $enum_name) -> Self {
+ e.encode().try_into().unwrap()
+ }
+ }
+
+ impl TryFrom<&PropertyValue> for $enum_name {
+ type Error = MiscError;
+
+ fn try_from(value: &PropertyValue) -> Result<Self, Self::Error> {
+ let mut value = value.as_slice();
+
+ <$enum_name>::decode(&mut value)
+ .map_err(|_| MiscError::$error)
+ }
+ }
+
+ };
+}
+
+pub enum MiscError {
+ CorruptedCollectionType,
+}
+
+impl<T: Config> From<MiscError> for Error<T> {
+ fn from(error: MiscError) -> Self {
+ match error {
+ MiscError::CorruptedCollectionType => Self::CorruptedCollectionType,
+ }
+ }
+}
+
+pub trait IntoNftCollection<T: Config> {
+ fn into_nft_collection(self) -> Result<NonfungibleHandle<T>, Error<T>>;
+}
+
+impl<T: Config> IntoNftCollection<T> for CollectionHandle<T> {
+ fn into_nft_collection(self) -> Result<NonfungibleHandle<T>, Error<T>> {
+ match self.mode {
+ CollectionMode::NFT => Ok(NonfungibleHandle::cast(self)),
+ _ => Err(<Error<T>>::NotRmrkCollection)
+ }
+ }
+}
+
+#[derive(Encode, Decode, PartialEq, Eq)]
+pub enum CollectionType {
+ Regular,
+ Resource,
+ Base,
+}
+
+impl_rmrk_value!(CollectionType, decode_error: CorruptedCollectionType);
pallets/proxy-rmrk-core/src/property.rsdiffbeforeafterboth--- /dev/null
+++ b/pallets/proxy-rmrk-core/src/property.rs
@@ -0,0 +1,92 @@
+use super::*;
+use core::convert::AsRef;
+
+pub enum RmrkProperty {
+ Metadata,
+ CollectionType,
+ Recipient,
+ Royalty,
+ Equipped,
+ Pending,
+ ResourceCollection,
+ ResourcePriorities,
+ PendingRemoval,
+ Parts,
+ Base,
+ Src,
+ Slot,
+ License,
+ Thumb,
+ EquippedNft,
+ BaseType,
+ // // RmrkPartId(/* Id type? */)
+ EquippableList,
+ ZIndex,
+ ThemeName,
+ ThemeProperty(RmrkString),
+ ThemeInherit,
+}
+
+impl RmrkProperty {
+ pub fn to_key<T: Config>(self) -> Result<PropertyKey, Error<T>> {
+ fn get_bytes<T: AsRef<[u8]>>(container: &T) -> &[u8] {
+ container.as_ref()
+ }
+
+ macro_rules! key {
+ ($($component:expr),+) => {
+ PropertyKey::try_from([$(key!(@ &$component)),+].concat())
+ .map_err(|_| <Error<T>>::RmrkPropertyIsTooLong)
+ };
+
+ (@ $key:expr) => {
+ get_bytes($key)
+ };
+ }
+
+ match self {
+ Self::Metadata => key!("metadata"),
+ Self::CollectionType => key!("collection-type"),
+ Self::Recipient => key!("recipient"),
+ Self::Royalty => key!("royalty"),
+ Self::Equipped => key!("equipped"),
+ Self::Pending => key!("pending"),
+ Self::ResourceCollection => key!("resource-collection"),
+ Self::ResourcePriorities => key!("resource-priorities"),
+ Self::PendingRemoval => key!("pending-removal"),
+ Self::Parts => key!("parts"),
+ Self::Base => key!("base"),
+ Self::Src => key!("src"),
+ Self::Slot => key!("slot"),
+ Self::License => key!("license"),
+ Self::Thumb => key!("thumb"),
+ Self::EquippedNft => key!("equipped-nft"),
+ Self::BaseType => key!("base-type"),
+ // RmrkPartId(/* Id type? */)
+ Self::EquippableList => key!("equippable-list"),
+ Self::ZIndex => key!("z-index"),
+ Self::ThemeName => key!("theme-name"),
+ Self::ThemeProperty(name) => key!("theme-property-", name),
+ Self::ThemeInherit => key!("theme-inherit"),
+ }
+ }
+}
+
+#[macro_export]
+macro_rules! rmrk_property {
+ (Config=$cfg:ty, $key:ident: $value:expr) => {
+ rmrk_property!(@$cfg, $key).map(|key| Property {
+ key,
+ value: $value.into()
+ })
+ };
+
+ (@$cfg:ty, $key:ident) => {
+ $crate::RmrkProperty::$key.to_key::<$cfg>()
+ };
+
+ (Config=$cfg:ty, $key:ident) => {
+ PropertyScope::Rmrk.apply(rmrk_property!(@$cfg, $key)?)
+ .map_err(|_| <$crate::Error<$cfg>>::RmrkPropertyIsTooLong)
+ };
+}
pallets/rmrk-core-proxy/Cargo.tomldiffbeforeafterboth--- a/pallets/rmrk-core-proxy/Cargo.toml
+++ /dev/null
@@ -1,49 +0,0 @@
-[package]
-name = "pallet-rmrk-core"
-version = "0.1.0"
-license = "GPLv3"
-edition = "2021"
-
-[dependencies.codec]
-default-features = false
-features = ['derive']
-package = 'parity-scale-codec'
-version = '3.1.2'
-
-[dependencies]
-frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }
-frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }
-sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }
-sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }
-sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }
-pallet-common = { default-features = false, path = '../common' }
-pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }
-# pallet-structure = { default-features = false, path = '../structure' }
-up-data-structs = { default-features = false, path = '../../primitives/data-structs' }
-# evm-coder = { default-features = false, path = '../../crates/evm-coder' }
-# pallet-evm-coder-substrate = { default-features = false, path = '../evm-coder-substrate' }
-pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }
-frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.21" }
-scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
-
-[features]
-default = ["std"]
-std = [
- "frame-support/std",
- "frame-system/std",
- "sp-runtime/std",
- "sp-std/std",
- "up-data-structs/std",
- "pallet-common/std",
- "pallet-nonfungible/std",
- "pallet-evm/std",
- # "pallet-structure/std",
- # "evm-coder/std",
- # "pallet-evm-coder-substrate/std",
- 'frame-benchmarking/std',
-]
-runtime-benchmarks = [
- 'frame-benchmarking',
- 'frame-support/runtime-benchmarks',
- 'frame-system/runtime-benchmarks',
-]
pallets/rmrk-core-proxy/src/lib.rsdiffbeforeafterboth--- a/pallets/rmrk-core-proxy/src/lib.rs
+++ /dev/null
@@ -1,235 +0,0 @@
-// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
-// This file is part of Unique Network.
-
-// Unique Network is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Unique Network is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
-
-#![cfg_attr(not(feature = "std"), no_std)]
-
-use frame_support::{pallet_prelude::*, transactional, BoundedVec, traits::ConstU32, dispatch::DispatchResult};
-use frame_system::{pallet_prelude::*, ensure_signed};
-use sp_runtime::DispatchError;
-use up_data_structs::*;
-use pallet_common::{Pallet as PalletCommon, Error as CommonError, CollectionHandle, CommonCollectionOperations};
-use pallet_nonfungible::{Pallet as PalletNft, NonfungibleHandle};
-use pallet_evm::account::CrossAccountId;
-
-pub use pallet::*;
-
-pub mod misc;
-pub mod property;
-
-use misc::*;
-pub use property::*;
-
-#[frame_support::pallet]
-pub mod pallet {
- use super::*;
- use pallet_evm::account;
-
- #[pallet::config]
- pub trait Config: frame_system::Config
- + pallet_common::Config
- + pallet_nonfungible::Config
- + account::Config {
- type Event: From<Event<Self>> + IsType<<Self as frame_system::Config>::Event>;
- }
-
- #[pallet::pallet]
- #[pallet::generate_store(pub(super) trait Store)]
- pub struct Pallet<T>(_);
-
- #[pallet::event]
- #[pallet::generate_deposit(pub(super) fn deposit_event)]
- pub enum Event<T: Config> {
- CollectionCreated {
- issuer: T::AccountId,
- collection_id: CollectionId,
- },
- CollectionDestroyed {
- issuer: T::AccountId,
- collection_id: CollectionId,
- },
- CollectionLocked {
- issuer: T::AccountId,
- collection_id: CollectionId,
- },
- }
-
- #[pallet::error]
- pub enum Error<T> {
- /* Unique-specific events */
- CorruptedCollectionType,
- NotRmrkCollection,
- RmrkPropertyIsTooLong,
-
- /* RMRK compatible events */
- CollectionNotEmpty,
- NoAvailableCollectionId,
- CollectionUnknown,
- }
-
- #[pallet::call]
- impl<T: Config> Pallet<T> {
- #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]
- #[transactional]
- pub fn create_collection(
- origin: OriginFor<T>,
- metadata: PropertyValue,
- max: Option<u32>,
- symbol: BoundedVec<u8, ConstU32<MAX_TOKEN_PREFIX_LENGTH>>,
- ) -> DispatchResult {
- let sender = ensure_signed(origin)?;
-
- let limits = max.map(|max| CollectionLimits {
- token_limit: Some(max),
- ..Default::default()
- });
-
- let data = CreateCollectionData {
- limits,
- token_prefix: symbol,
- ..Default::default()
- };
-
- let collection_id_res = <PalletNft<T>>::init_collection(sender.clone(), data);
-
- if let Err(DispatchError::Arithmetic(_)) = &collection_id_res {
- return Err(<Error<T>>::NoAvailableCollectionId.into());
- }
-
- let collection_id = collection_id_res?;
-
- let collection = Self::get_nft_collection(collection_id)?.into_inner();
-
- <PalletCommon<T>>::set_scoped_collection_properties(
- &collection,
- PropertyScope::Rmrk,
- [
- rmrk_property!(Config=T, Metadata: metadata)?,
- rmrk_property!(Config=T, CollectionType: CollectionType::Regular)?,
- ].into_iter()
- )?;
-
- Self::deposit_event(Event::CollectionCreated { issuer: sender, collection_id });
-
- Ok(())
- }
-
- #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]
- #[transactional]
- pub fn destroy_collection(
- origin: OriginFor<T>,
- collection_id: CollectionId,
- ) -> DispatchResult {
- let sender = ensure_signed(origin)?;
- let cross_sender = T::CrossAccountId::from_sub(sender.clone());
-
- let collection = Self::get_nft_collection(collection_id)?;
-
- Self::check_collection_type(collection_id, CollectionType::Regular)?;
-
- ensure!(collection.total_supply() == 0, <Error<T>>::CollectionNotEmpty);
-
- <PalletNft<T>>::destroy_collection(collection, &cross_sender)?;
-
- Self::deposit_event(Event::CollectionDestroyed { issuer: sender, collection_id });
-
- Ok(())
- }
-
- #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]
- #[transactional]
- pub fn change_collection_issuer(
- origin: OriginFor<T>,
- collection_id: CollectionId,
- new_issuer: T::AccountId,
- ) -> DispatchResult {
- let sender = ensure_signed(origin)?;
-
- Self::change_collection_owner(
- collection_id,
- CollectionType::Regular,
- sender,
- new_issuer
- )?;
-
- Ok(())
- }
-
- #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]
- #[transactional]
- pub fn lock_collection(
- origin: OriginFor<T>,
- collection_id: CollectionId,
- ) -> DispatchResult {
- let sender = ensure_signed(origin)?;
- let cross_sender = T::CrossAccountId::from_sub(sender.clone());
-
- let collection = Self::get_nft_collection(collection_id)?;
- collection.check_is_owner(&cross_sender)?;
-
- let token_count = collection.total_supply();
-
- let mut collection = collection.into_inner();
- collection.limits.token_limit = Some(token_count);
- collection.save()?;
-
- Self::deposit_event(Event::CollectionLocked { issuer: sender, collection_id });
-
- Ok(())
- }
- }
-}
-
-impl<T: Config> Pallet<T> {
- fn change_collection_owner(
- collection_id: CollectionId,
- collection_type: CollectionType,
- sender: T::AccountId,
- new_owner: T::AccountId,
- ) -> DispatchResult {
- let mut collection = Self::get_nft_collection(collection_id)?.into_inner();
- collection.check_is_owner(&T::CrossAccountId::from_sub(sender))?;
-
- Self::check_collection_type(collection_id, collection_type)?;
-
- collection.owner = new_owner;
- collection.save()
- }
-
- fn get_nft_collection(collection_id: CollectionId) -> Result<NonfungibleHandle<T>, DispatchError> {
- let collection = <CollectionHandle<T>>::try_get(collection_id)
- .map_err(|_| <Error<T>>::CollectionUnknown)?
- .into_nft_collection()?;
-
- Ok(collection)
- }
-
- fn get_collection_type(collection_id: CollectionId) -> Result<CollectionType, DispatchError> {
- let collection_type: CollectionType = <PalletCommon<T>>::collection_properties(collection_id)
- .get(&rmrk_property!(Config=T, CollectionType)?)
- .ok_or(<Error<T>>::NotRmrkCollection)?
- .try_into()
- .map_err(<Error<T>>::from)?;
-
- Ok(collection_type)
- }
-
- fn check_collection_type(collection_id: CollectionId, collection_type: CollectionType) -> DispatchResult {
- let actual_type = Self::get_collection_type(collection_id)?;
- ensure!(actual_type == collection_type, <CommonError<T>>::NoPermission);
-
- Ok(())
- }
-}
pallets/rmrk-core-proxy/src/misc.rsdiffbeforeafterboth--- a/pallets/rmrk-core-proxy/src/misc.rs
+++ /dev/null
@@ -1,59 +0,0 @@
-use super::*;
-use codec::{Encode, Decode};
-use pallet_nonfungible::NonfungibleHandle;
-
-macro_rules! impl_rmrk_value {
- ($enum_name:path, decode_error: $error:ident) => {
- impl From<$enum_name> for PropertyValue {
- fn from(e: $enum_name) -> Self {
- e.encode().try_into().unwrap()
- }
- }
-
- impl TryFrom<&PropertyValue> for $enum_name {
- type Error = MiscError;
-
- fn try_from(value: &PropertyValue) -> Result<Self, Self::Error> {
- let mut value = value.as_slice();
-
- <$enum_name>::decode(&mut value)
- .map_err(|_| MiscError::$error)
- }
- }
-
- };
-}
-
-pub enum MiscError {
- CorruptedCollectionType,
-}
-
-impl<T: Config> From<MiscError> for Error<T> {
- fn from(error: MiscError) -> Self {
- match error {
- MiscError::CorruptedCollectionType => Self::CorruptedCollectionType,
- }
- }
-}
-
-pub trait IntoNftCollection<T: Config> {
- fn into_nft_collection(self) -> Result<NonfungibleHandle<T>, Error<T>>;
-}
-
-impl<T: Config> IntoNftCollection<T> for CollectionHandle<T> {
- fn into_nft_collection(self) -> Result<NonfungibleHandle<T>, Error<T>> {
- match self.mode {
- CollectionMode::NFT => Ok(NonfungibleHandle::cast(self)),
- _ => Err(<Error<T>>::NotRmrkCollection)
- }
- }
-}
-
-#[derive(Encode, Decode, PartialEq, Eq)]
-pub enum CollectionType {
- Regular,
- Resource,
- Base,
-}
-
-impl_rmrk_value!(CollectionType, decode_error: CorruptedCollectionType);
pallets/rmrk-core-proxy/src/property.rsdiffbeforeafterboth--- a/pallets/rmrk-core-proxy/src/property.rs
+++ /dev/null
@@ -1,92 +0,0 @@
-use super::*;
-use core::convert::AsRef;
-
-pub enum RmrkProperty {
- Metadata,
- CollectionType,
- Recipient,
- Royalty,
- Equipped,
- Pending,
- ResourceCollection,
- ResourcePriorities,
- PendingRemoval,
- Parts,
- Base,
- Src,
- Slot,
- License,
- Thumb,
- EquippedNft,
- BaseType,
- // // RmrkPartId(/* Id type? */)
- EquippableList,
- ZIndex,
- ThemeName,
- ThemeProperty(RmrkString),
- ThemeInherit,
-}
-
-impl RmrkProperty {
- pub fn to_key<T: Config>(self) -> Result<PropertyKey, Error<T>> {
- fn get_bytes<T: AsRef<[u8]>>(container: &T) -> &[u8] {
- container.as_ref()
- }
-
- macro_rules! key {
- ($($component:expr),+) => {
- PropertyKey::try_from([$(key!(@ &$component)),+].concat())
- .map_err(|_| <Error<T>>::RmrkPropertyIsTooLong)
- };
-
- (@ $key:expr) => {
- get_bytes($key)
- };
- }
-
- match self {
- Self::Metadata => key!("metadata"),
- Self::CollectionType => key!("collection-type"),
- Self::Recipient => key!("recipient"),
- Self::Royalty => key!("royalty"),
- Self::Equipped => key!("equipped"),
- Self::Pending => key!("pending"),
- Self::ResourceCollection => key!("resource-collection"),
- Self::ResourcePriorities => key!("resource-priorities"),
- Self::PendingRemoval => key!("pending-removal"),
- Self::Parts => key!("parts"),
- Self::Base => key!("base"),
- Self::Src => key!("src"),
- Self::Slot => key!("slot"),
- Self::License => key!("license"),
- Self::Thumb => key!("thumb"),
- Self::EquippedNft => key!("equipped-nft"),
- Self::BaseType => key!("base-type"),
- // RmrkPartId(/* Id type? */)
- Self::EquippableList => key!("equippable-list"),
- Self::ZIndex => key!("z-index"),
- Self::ThemeName => key!("theme-name"),
- Self::ThemeProperty(name) => key!("theme-property-", name),
- Self::ThemeInherit => key!("theme-inherit"),
- }
- }
-}
-
-#[macro_export]
-macro_rules! rmrk_property {
- (Config=$cfg:ty, $key:ident: $value:expr) => {
- rmrk_property!(@$cfg, $key).map(|key| Property {
- key,
- value: $value.into()
- })
- };
-
- (@$cfg:ty, $key:ident) => {
- $crate::RmrkProperty::$key.to_key::<$cfg>()
- };
-
- (Config=$cfg:ty, $key:ident) => {
- PropertyScope::Rmrk.apply(rmrk_property!(@$cfg, $key)?)
- .map_err(|_| <$crate::Error<$cfg>>::RmrkPropertyIsTooLong)
- };
-}
runtime/opal/Cargo.tomldiffbeforeafterboth--- a/runtime/opal/Cargo.toml
+++ b/runtime/opal/Cargo.toml
@@ -33,7 +33,7 @@
'pallet-fungible/runtime-benchmarks',
'pallet-refungible/runtime-benchmarks',
'pallet-nonfungible/runtime-benchmarks',
- 'pallet-rmrk-proxy/runtime-benchmarks',
+ 'pallet-proxy-rmrk-core/runtime-benchmarks',
'pallet-unique/runtime-benchmarks',
'pallet-inflation/runtime-benchmarks',
'pallet-xcm/runtime-benchmarks',
@@ -90,7 +90,7 @@
'pallet-fungible/std',
'pallet-refungible/std',
'pallet-nonfungible/std',
- 'pallet-rmrk-proxy/std',
+ 'pallet-proxy-rmrk-core/std',
'pallet-unique/std',
'pallet-unq-scheduler/std',
'pallet-charge-transaction/std',
@@ -417,7 +417,7 @@
pallet-fungible = { default-features = false, path = "../../pallets/fungible" }
pallet-refungible = { default-features = false, path = "../../pallets/refungible" }
pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }
-pallet-rmrk-proxy = { default-features = false, path = "../../pallets/rmrk-core-proxy", package = "pallet-rmrk-core" }
+pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy-rmrk-core", package = "pallet-rmrk-core" }
pallet-unq-scheduler = { path = '../../pallets/scheduler', default-features = false }
# pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }
pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.21", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }
runtime/opal/src/lib.rsdiffbeforeafterboth--- a/runtime/opal/src/lib.rs
+++ b/runtime/opal/src/lib.rs
@@ -901,7 +901,7 @@
type WeightInfo = pallet_nonfungible::weights::SubstrateWeight<Self>;
}
-impl pallet_rmrk_proxy::Config for Runtime {
+impl pallet_proxy_rmrk_core::Config for Runtime {
type Event = Event;
}
@@ -1017,7 +1017,7 @@
Refungible: pallet_refungible::{Pallet, Storage} = 68,
Nonfungible: pallet_nonfungible::{Pallet, Storage} = 69,
Structure: pallet_structure::{Pallet, Call, Storage, Event<T>} = 70,
- RmrkProxy: pallet_rmrk_proxy::{Pallet, Call, Storage, Event<T>} = 71,
+ ProxyRmrkCore: pallet_proxy_rmrk_core::{Pallet, Call, Storage, Event<T>} = 71,
// Frontier
EVM: pallet_evm::{Pallet, Config, Call, Storage, Event<T>} = 100,
runtime/quartz/Cargo.tomldiffbeforeafterboth--- a/runtime/quartz/Cargo.toml
+++ b/runtime/quartz/Cargo.toml
@@ -33,6 +33,7 @@
'pallet-fungible/runtime-benchmarks',
'pallet-refungible/runtime-benchmarks',
'pallet-nonfungible/runtime-benchmarks',
+ 'pallet-proxy-rmrk-core/runtime-benchmarks',
'pallet-unique/runtime-benchmarks',
'pallet-inflation/runtime-benchmarks',
'pallet-xcm/runtime-benchmarks',
@@ -89,6 +90,7 @@
'pallet-fungible/std',
'pallet-refungible/std',
'pallet-nonfungible/std',
+ 'pallet-proxy-rmrk-core/std',
'pallet-unique/std',
'pallet-unq-scheduler/std',
'pallet-charge-transaction/std',
@@ -414,6 +416,7 @@
pallet-fungible = { default-features = false, path = "../../pallets/fungible" }
pallet-refungible = { default-features = false, path = "../../pallets/refungible" }
pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }
+pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy-rmrk-core", package = "pallet-rmrk-core" }
pallet-unq-scheduler = { path = '../../pallets/scheduler', default-features = false }
# pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }
pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.21", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }
runtime/unique/Cargo.tomldiffbeforeafterboth1################################################################################2# Package34[package]5authors = ['Unique Network <support@uniquenetwork.io>']6build = 'build.rs'7description = 'Unique Runtime'8edition = '2021'9homepage = 'https://unique.network'10license = 'GPLv3'11name = 'unique-runtime'12repository = 'https://github.com/UniqueNetwork/unique-chain'13version = '0.9.18'1415[package.metadata.docs.rs]16targets = ['x86_64-unknown-linux-gnu']1718[features]19default = ['std']20runtime-benchmarks = [21 'hex-literal',22 'frame-benchmarking',23 'frame-support/runtime-benchmarks',24 'frame-system-benchmarking',25 'frame-system/runtime-benchmarks',26 'pallet-ethereum/runtime-benchmarks',27 'pallet-evm-migration/runtime-benchmarks',28 'pallet-evm-coder-substrate/runtime-benchmarks',29 'pallet-balances/runtime-benchmarks',30 'pallet-timestamp/runtime-benchmarks',31 'pallet-common/runtime-benchmarks',32 'pallet-structure/runtime-benchmarks',33 'pallet-fungible/runtime-benchmarks',34 'pallet-refungible/runtime-benchmarks',35 'pallet-nonfungible/runtime-benchmarks',36 'pallet-unique/runtime-benchmarks',37 'pallet-inflation/runtime-benchmarks',38 'pallet-xcm/runtime-benchmarks',39 'sp-runtime/runtime-benchmarks',40 'xcm-builder/runtime-benchmarks',41]42try-runtime = [43 'frame-try-runtime',44 'frame-executive/try-runtime',45 'frame-system/try-runtime',46]47std = [48 'codec/std',49 'cumulus-pallet-aura-ext/std',50 'cumulus-pallet-parachain-system/std',51 'cumulus-pallet-xcm/std',52 'cumulus-pallet-xcmp-queue/std',53 'cumulus-primitives-core/std',54 'cumulus-primitives-utility/std',55 'frame-try-runtime/std',56 'frame-executive/std',57 'frame-support/std',58 'frame-system/std',59 'frame-system-rpc-runtime-api/std',60 'pallet-aura/std',61 'pallet-balances/std',62 # 'pallet-contracts/std',63 # 'pallet-contracts-primitives/std',64 # 'pallet-contracts-rpc-runtime-api/std',65 # 'pallet-contract-helpers/std',66 'pallet-randomness-collective-flip/std',67 'pallet-sudo/std',68 'pallet-timestamp/std',69 'pallet-transaction-payment/std',70 'pallet-transaction-payment-rpc-runtime-api/std',71 'pallet-treasury/std',72 # 'pallet-vesting/std',73 'pallet-evm/std',74 'pallet-evm-migration/std',75 'pallet-evm-contract-helpers/std',76 'pallet-evm-transaction-payment/std',77 'pallet-evm-coder-substrate/std',78 'pallet-ethereum/std',79 'pallet-base-fee/std',80 'fp-rpc/std',81 'up-rpc/std',82 'fp-evm-mapping/std',83 'fp-self-contained/std',84 'parachain-info/std',85 'serde',86 'pallet-inflation/std',87 'pallet-common/std',88 'pallet-structure/std',89 'pallet-fungible/std',90 'pallet-refungible/std',91 'pallet-nonfungible/std',92 'pallet-unique/std',93 'pallet-unq-scheduler/std',94 'pallet-charge-transaction/std',95 'up-data-structs/std',96 'sp-api/std',97 'sp-block-builder/std',98 "sp-consensus-aura/std",99 'sp-core/std',100 'sp-inherents/std',101 'sp-io/std',102 'sp-offchain/std',103 'sp-runtime/std',104 'sp-session/std',105 'sp-std/std',106 'sp-transaction-pool/std',107 'sp-version/std',108 'xcm/std',109 'xcm-builder/std',110 'xcm-executor/std',111 'unique-runtime-common/std',112113 "orml-vesting/std",114]115limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']116117################################################################################118# Substrate Dependencies119120[dependencies.codec]121default-features = false122features = ['derive']123package = 'parity-scale-codec'124version = '3.1.2'125126[dependencies.frame-benchmarking]127default-features = false128git = "https://github.com/paritytech/substrate"129optional = true130branch = "polkadot-v0.9.21"131132[dependencies.frame-try-runtime]133default-features = false134git = 'https://github.com/paritytech/substrate'135optional = true136branch = 'polkadot-v0.9.21'137138[dependencies.frame-executive]139default-features = false140git = "https://github.com/paritytech/substrate"141branch = "polkadot-v0.9.21"142143[dependencies.frame-support]144default-features = false145git = "https://github.com/paritytech/substrate"146branch = "polkadot-v0.9.21"147148[dependencies.frame-system]149default-features = false150git = "https://github.com/paritytech/substrate"151branch = "polkadot-v0.9.21"152153[dependencies.frame-system-benchmarking]154default-features = false155git = "https://github.com/paritytech/substrate"156optional = true157branch = "polkadot-v0.9.21"158159[dependencies.frame-system-rpc-runtime-api]160default-features = false161git = "https://github.com/paritytech/substrate"162branch = "polkadot-v0.9.21"163164[dependencies.hex-literal]165optional = true166version = '0.3.3'167168[dependencies.serde]169default-features = false170features = ['derive']171optional = true172version = '1.0.130'173174[dependencies.pallet-aura]175default-features = false176git = "https://github.com/paritytech/substrate"177branch = "polkadot-v0.9.21"178179[dependencies.pallet-balances]180default-features = false181git = "https://github.com/paritytech/substrate"182branch = "polkadot-v0.9.21"183184# Contracts specific packages185# [dependencies.pallet-contracts]186# git = 'https://github.com/paritytech/substrate'187# default-features = false188# branch = 'master'189# version = '4.0.0-dev'190191# [dependencies.pallet-contracts-primitives]192# git = 'https://github.com/paritytech/substrate'193# default-features = false194# branch = 'master'195# version = '4.0.0-dev'196197# [dependencies.pallet-contracts-rpc-runtime-api]198# git = 'https://github.com/paritytech/substrate'199# default-features = false200# branch = 'master'201# version = '4.0.0-dev'202203[dependencies.pallet-randomness-collective-flip]204default-features = false205git = "https://github.com/paritytech/substrate"206branch = "polkadot-v0.9.21"207208[dependencies.pallet-sudo]209default-features = false210git = "https://github.com/paritytech/substrate"211branch = "polkadot-v0.9.21"212213[dependencies.pallet-timestamp]214default-features = false215git = "https://github.com/paritytech/substrate"216branch = "polkadot-v0.9.21"217218[dependencies.pallet-transaction-payment]219default-features = false220git = "https://github.com/paritytech/substrate"221branch = "polkadot-v0.9.21"222223[dependencies.pallet-transaction-payment-rpc-runtime-api]224default-features = false225git = "https://github.com/paritytech/substrate"226branch = "polkadot-v0.9.21"227228[dependencies.pallet-treasury]229default-features = false230git = "https://github.com/paritytech/substrate"231branch = "polkadot-v0.9.21"232233# [dependencies.pallet-vesting]234# default-features = false235# git = 'https://github.com/paritytech/substrate'236# branch = 'master'237238[dependencies.sp-arithmetic]239default-features = false240git = "https://github.com/paritytech/substrate"241branch = "polkadot-v0.9.21"242243[dependencies.sp-api]244default-features = false245git = "https://github.com/paritytech/substrate"246branch = "polkadot-v0.9.21"247248[dependencies.sp-block-builder]249default-features = false250git = "https://github.com/paritytech/substrate"251branch = "polkadot-v0.9.21"252253[dependencies.sp-core]254default-features = false255git = "https://github.com/paritytech/substrate"256branch = "polkadot-v0.9.21"257258[dependencies.sp-consensus-aura]259default-features = false260git = "https://github.com/paritytech/substrate"261branch = "polkadot-v0.9.21"262263[dependencies.sp-inherents]264default-features = false265git = "https://github.com/paritytech/substrate"266branch = "polkadot-v0.9.21"267268[dependencies.sp-io]269default-features = false270git = "https://github.com/paritytech/substrate"271branch = "polkadot-v0.9.21"272273[dependencies.sp-offchain]274default-features = false275git = "https://github.com/paritytech/substrate"276branch = "polkadot-v0.9.21"277278[dependencies.sp-runtime]279default-features = false280git = "https://github.com/paritytech/substrate"281branch = "polkadot-v0.9.21"282283[dependencies.sp-session]284default-features = false285git = "https://github.com/paritytech/substrate"286branch = "polkadot-v0.9.21"287288[dependencies.sp-std]289default-features = false290git = "https://github.com/paritytech/substrate"291branch = "polkadot-v0.9.21"292293[dependencies.sp-transaction-pool]294default-features = false295git = "https://github.com/paritytech/substrate"296branch = "polkadot-v0.9.21"297298[dependencies.sp-version]299default-features = false300git = "https://github.com/paritytech/substrate"301branch = "polkadot-v0.9.21"302303[dependencies.smallvec]304version = '1.6.1'305306################################################################################307# Cumulus dependencies308309[dependencies.parachain-info]310default-features = false311git = "https://github.com/uniquenetwork/cumulus"312branch = "polkadot-v0.9.21"313314[dependencies.cumulus-pallet-aura-ext]315git = "https://github.com/uniquenetwork/cumulus"316branch = "polkadot-v0.9.21"317default-features = false318319[dependencies.cumulus-pallet-parachain-system]320git = "https://github.com/uniquenetwork/cumulus"321branch = "polkadot-v0.9.21"322default-features = false323324[dependencies.cumulus-primitives-core]325git = "https://github.com/uniquenetwork/cumulus"326branch = "polkadot-v0.9.21"327default-features = false328329[dependencies.cumulus-pallet-xcm]330git = "https://github.com/uniquenetwork/cumulus"331branch = "polkadot-v0.9.21"332default-features = false333334[dependencies.cumulus-pallet-dmp-queue]335git = "https://github.com/uniquenetwork/cumulus"336branch = "polkadot-v0.9.21"337default-features = false338339[dependencies.cumulus-pallet-xcmp-queue]340git = "https://github.com/uniquenetwork/cumulus"341branch = "polkadot-v0.9.21"342default-features = false343344[dependencies.cumulus-primitives-utility]345git = "https://github.com/uniquenetwork/cumulus"346branch = "polkadot-v0.9.21"347default-features = false348349[dependencies.cumulus-primitives-timestamp]350git = "https://github.com/uniquenetwork/cumulus"351branch = "polkadot-v0.9.21"352default-features = false353354################################################################################355# Polkadot dependencies356357[dependencies.polkadot-parachain]358git = "https://github.com/paritytech/polkadot"359branch = "release-v0.9.21"360default-features = false361362[dependencies.xcm]363git = "https://github.com/paritytech/polkadot"364branch = "release-v0.9.21"365default-features = false366367[dependencies.xcm-builder]368git = "https://github.com/paritytech/polkadot"369branch = "release-v0.9.21"370default-features = false371372[dependencies.xcm-executor]373git = "https://github.com/paritytech/polkadot"374branch = "release-v0.9.21"375default-features = false376377[dependencies.pallet-xcm]378git = "https://github.com/paritytech/polkadot"379branch = "release-v0.9.21"380default-features = false381382[dependencies.orml-vesting]383git = "https://github.com/uniquenetwork/open-runtime-module-library"384branch = "unique-polkadot-v0.9.21"385version = "0.4.1-dev"386default-features = false387388################################################################################389# RMRK dependencies390391# todo git392[dependencies.rmrk-rpc]393default-features = false394git = "https://github.com/UniqueNetwork/rmrk-substrate.git"395branch = "feature/separate-types-and-traits"396397################################################################################398# local dependencies399400[dependencies]401log = { version = "0.4.16", default-features = false }402unique-runtime-common = { path = "../common", default-features = false }403scale-info = { version = "2.0.1", default-features = false, features = [404 "derive",405] }406derivative = "2.2.0"407pallet-unique = { path = '../../pallets/unique', default-features = false }408up-rpc = { path = "../../primitives/rpc", default-features = false }409pallet-inflation = { path = '../../pallets/inflation', default-features = false }410up-data-structs = { path = '../../primitives/data-structs', default-features = false }411pallet-common = { default-features = false, path = "../../pallets/common" }412pallet-structure = { default-features = false, path = "../../pallets/structure" }413pallet-fungible = { default-features = false, path = "../../pallets/fungible" }414pallet-refungible = { default-features = false, path = "../../pallets/refungible" }415pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }416pallet-unq-scheduler = { path = '../../pallets/scheduler', default-features = false }417# pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }418pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.21", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }419pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false }420pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false }421pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false }422pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" }423pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }424pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }425pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }426fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }427fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }428fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }429430################################################################################431# Build Dependencies432433[build-dependencies.substrate-wasm-builder]434git = "https://github.com/paritytech/substrate"435branch = "polkadot-v0.9.21"1################################################################################2# Package34[package]5authors = ['Unique Network <support@uniquenetwork.io>']6build = 'build.rs'7description = 'Unique Runtime'8edition = '2021'9homepage = 'https://unique.network'10license = 'GPLv3'11name = 'unique-runtime'12repository = 'https://github.com/UniqueNetwork/unique-chain'13version = '0.9.18'1415[package.metadata.docs.rs]16targets = ['x86_64-unknown-linux-gnu']1718[features]19default = ['std']20runtime-benchmarks = [21 'hex-literal',22 'frame-benchmarking',23 'frame-support/runtime-benchmarks',24 'frame-system-benchmarking',25 'frame-system/runtime-benchmarks',26 'pallet-ethereum/runtime-benchmarks',27 'pallet-evm-migration/runtime-benchmarks',28 'pallet-evm-coder-substrate/runtime-benchmarks',29 'pallet-balances/runtime-benchmarks',30 'pallet-timestamp/runtime-benchmarks',31 'pallet-common/runtime-benchmarks',32 'pallet-structure/runtime-benchmarks',33 'pallet-fungible/runtime-benchmarks',34 'pallet-refungible/runtime-benchmarks',35 'pallet-nonfungible/runtime-benchmarks',36 'pallet-proxy-rmrk-core/runtime-benchmarks',37 'pallet-unique/runtime-benchmarks',38 'pallet-inflation/runtime-benchmarks',39 'pallet-xcm/runtime-benchmarks',40 'sp-runtime/runtime-benchmarks',41 'xcm-builder/runtime-benchmarks',42]43try-runtime = [44 'frame-try-runtime',45 'frame-executive/try-runtime',46 'frame-system/try-runtime',47]48std = [49 'codec/std',50 'cumulus-pallet-aura-ext/std',51 'cumulus-pallet-parachain-system/std',52 'cumulus-pallet-xcm/std',53 'cumulus-pallet-xcmp-queue/std',54 'cumulus-primitives-core/std',55 'cumulus-primitives-utility/std',56 'frame-try-runtime/std',57 'frame-executive/std',58 'frame-support/std',59 'frame-system/std',60 'frame-system-rpc-runtime-api/std',61 'pallet-aura/std',62 'pallet-balances/std',63 # 'pallet-contracts/std',64 # 'pallet-contracts-primitives/std',65 # 'pallet-contracts-rpc-runtime-api/std',66 # 'pallet-contract-helpers/std',67 'pallet-randomness-collective-flip/std',68 'pallet-sudo/std',69 'pallet-timestamp/std',70 'pallet-transaction-payment/std',71 'pallet-transaction-payment-rpc-runtime-api/std',72 'pallet-treasury/std',73 # 'pallet-vesting/std',74 'pallet-evm/std',75 'pallet-evm-migration/std',76 'pallet-evm-contract-helpers/std',77 'pallet-evm-transaction-payment/std',78 'pallet-evm-coder-substrate/std',79 'pallet-ethereum/std',80 'pallet-base-fee/std',81 'fp-rpc/std',82 'up-rpc/std',83 'fp-evm-mapping/std',84 'fp-self-contained/std',85 'parachain-info/std',86 'serde',87 'pallet-inflation/std',88 'pallet-common/std',89 'pallet-structure/std',90 'pallet-fungible/std',91 'pallet-refungible/std',92 'pallet-nonfungible/std',93 'pallet-proxy-rmrk-core/std',94 'pallet-unique/std',95 'pallet-unq-scheduler/std',96 'pallet-charge-transaction/std',97 'up-data-structs/std',98 'sp-api/std',99 'sp-block-builder/std',100 "sp-consensus-aura/std",101 'sp-core/std',102 'sp-inherents/std',103 'sp-io/std',104 'sp-offchain/std',105 'sp-runtime/std',106 'sp-session/std',107 'sp-std/std',108 'sp-transaction-pool/std',109 'sp-version/std',110 'xcm/std',111 'xcm-builder/std',112 'xcm-executor/std',113 'unique-runtime-common/std',114115 "orml-vesting/std",116]117limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']118119################################################################################120# Substrate Dependencies121122[dependencies.codec]123default-features = false124features = ['derive']125package = 'parity-scale-codec'126version = '3.1.2'127128[dependencies.frame-benchmarking]129default-features = false130git = "https://github.com/paritytech/substrate"131optional = true132branch = "polkadot-v0.9.21"133134[dependencies.frame-try-runtime]135default-features = false136git = 'https://github.com/paritytech/substrate'137optional = true138branch = 'polkadot-v0.9.21'139140[dependencies.frame-executive]141default-features = false142git = "https://github.com/paritytech/substrate"143branch = "polkadot-v0.9.21"144145[dependencies.frame-support]146default-features = false147git = "https://github.com/paritytech/substrate"148branch = "polkadot-v0.9.21"149150[dependencies.frame-system]151default-features = false152git = "https://github.com/paritytech/substrate"153branch = "polkadot-v0.9.21"154155[dependencies.frame-system-benchmarking]156default-features = false157git = "https://github.com/paritytech/substrate"158optional = true159branch = "polkadot-v0.9.21"160161[dependencies.frame-system-rpc-runtime-api]162default-features = false163git = "https://github.com/paritytech/substrate"164branch = "polkadot-v0.9.21"165166[dependencies.hex-literal]167optional = true168version = '0.3.3'169170[dependencies.serde]171default-features = false172features = ['derive']173optional = true174version = '1.0.130'175176[dependencies.pallet-aura]177default-features = false178git = "https://github.com/paritytech/substrate"179branch = "polkadot-v0.9.21"180181[dependencies.pallet-balances]182default-features = false183git = "https://github.com/paritytech/substrate"184branch = "polkadot-v0.9.21"185186# Contracts specific packages187# [dependencies.pallet-contracts]188# git = 'https://github.com/paritytech/substrate'189# default-features = false190# branch = 'master'191# version = '4.0.0-dev'192193# [dependencies.pallet-contracts-primitives]194# git = 'https://github.com/paritytech/substrate'195# default-features = false196# branch = 'master'197# version = '4.0.0-dev'198199# [dependencies.pallet-contracts-rpc-runtime-api]200# git = 'https://github.com/paritytech/substrate'201# default-features = false202# branch = 'master'203# version = '4.0.0-dev'204205[dependencies.pallet-randomness-collective-flip]206default-features = false207git = "https://github.com/paritytech/substrate"208branch = "polkadot-v0.9.21"209210[dependencies.pallet-sudo]211default-features = false212git = "https://github.com/paritytech/substrate"213branch = "polkadot-v0.9.21"214215[dependencies.pallet-timestamp]216default-features = false217git = "https://github.com/paritytech/substrate"218branch = "polkadot-v0.9.21"219220[dependencies.pallet-transaction-payment]221default-features = false222git = "https://github.com/paritytech/substrate"223branch = "polkadot-v0.9.21"224225[dependencies.pallet-transaction-payment-rpc-runtime-api]226default-features = false227git = "https://github.com/paritytech/substrate"228branch = "polkadot-v0.9.21"229230[dependencies.pallet-treasury]231default-features = false232git = "https://github.com/paritytech/substrate"233branch = "polkadot-v0.9.21"234235# [dependencies.pallet-vesting]236# default-features = false237# git = 'https://github.com/paritytech/substrate'238# branch = 'master'239240[dependencies.sp-arithmetic]241default-features = false242git = "https://github.com/paritytech/substrate"243branch = "polkadot-v0.9.21"244245[dependencies.sp-api]246default-features = false247git = "https://github.com/paritytech/substrate"248branch = "polkadot-v0.9.21"249250[dependencies.sp-block-builder]251default-features = false252git = "https://github.com/paritytech/substrate"253branch = "polkadot-v0.9.21"254255[dependencies.sp-core]256default-features = false257git = "https://github.com/paritytech/substrate"258branch = "polkadot-v0.9.21"259260[dependencies.sp-consensus-aura]261default-features = false262git = "https://github.com/paritytech/substrate"263branch = "polkadot-v0.9.21"264265[dependencies.sp-inherents]266default-features = false267git = "https://github.com/paritytech/substrate"268branch = "polkadot-v0.9.21"269270[dependencies.sp-io]271default-features = false272git = "https://github.com/paritytech/substrate"273branch = "polkadot-v0.9.21"274275[dependencies.sp-offchain]276default-features = false277git = "https://github.com/paritytech/substrate"278branch = "polkadot-v0.9.21"279280[dependencies.sp-runtime]281default-features = false282git = "https://github.com/paritytech/substrate"283branch = "polkadot-v0.9.21"284285[dependencies.sp-session]286default-features = false287git = "https://github.com/paritytech/substrate"288branch = "polkadot-v0.9.21"289290[dependencies.sp-std]291default-features = false292git = "https://github.com/paritytech/substrate"293branch = "polkadot-v0.9.21"294295[dependencies.sp-transaction-pool]296default-features = false297git = "https://github.com/paritytech/substrate"298branch = "polkadot-v0.9.21"299300[dependencies.sp-version]301default-features = false302git = "https://github.com/paritytech/substrate"303branch = "polkadot-v0.9.21"304305[dependencies.smallvec]306version = '1.6.1'307308################################################################################309# Cumulus dependencies310311[dependencies.parachain-info]312default-features = false313git = "https://github.com/uniquenetwork/cumulus"314branch = "polkadot-v0.9.21"315316[dependencies.cumulus-pallet-aura-ext]317git = "https://github.com/uniquenetwork/cumulus"318branch = "polkadot-v0.9.21"319default-features = false320321[dependencies.cumulus-pallet-parachain-system]322git = "https://github.com/uniquenetwork/cumulus"323branch = "polkadot-v0.9.21"324default-features = false325326[dependencies.cumulus-primitives-core]327git = "https://github.com/uniquenetwork/cumulus"328branch = "polkadot-v0.9.21"329default-features = false330331[dependencies.cumulus-pallet-xcm]332git = "https://github.com/uniquenetwork/cumulus"333branch = "polkadot-v0.9.21"334default-features = false335336[dependencies.cumulus-pallet-dmp-queue]337git = "https://github.com/uniquenetwork/cumulus"338branch = "polkadot-v0.9.21"339default-features = false340341[dependencies.cumulus-pallet-xcmp-queue]342git = "https://github.com/uniquenetwork/cumulus"343branch = "polkadot-v0.9.21"344default-features = false345346[dependencies.cumulus-primitives-utility]347git = "https://github.com/uniquenetwork/cumulus"348branch = "polkadot-v0.9.21"349default-features = false350351[dependencies.cumulus-primitives-timestamp]352git = "https://github.com/uniquenetwork/cumulus"353branch = "polkadot-v0.9.21"354default-features = false355356################################################################################357# Polkadot dependencies358359[dependencies.polkadot-parachain]360git = "https://github.com/paritytech/polkadot"361branch = "release-v0.9.21"362default-features = false363364[dependencies.xcm]365git = "https://github.com/paritytech/polkadot"366branch = "release-v0.9.21"367default-features = false368369[dependencies.xcm-builder]370git = "https://github.com/paritytech/polkadot"371branch = "release-v0.9.21"372default-features = false373374[dependencies.xcm-executor]375git = "https://github.com/paritytech/polkadot"376branch = "release-v0.9.21"377default-features = false378379[dependencies.pallet-xcm]380git = "https://github.com/paritytech/polkadot"381branch = "release-v0.9.21"382default-features = false383384[dependencies.orml-vesting]385git = "https://github.com/uniquenetwork/open-runtime-module-library"386branch = "unique-polkadot-v0.9.21"387version = "0.4.1-dev"388default-features = false389390################################################################################391# RMRK dependencies392393# todo git394[dependencies.rmrk-rpc]395default-features = false396git = "https://github.com/UniqueNetwork/rmrk-substrate.git"397branch = "feature/separate-types-and-traits"398399################################################################################400# local dependencies401402[dependencies]403log = { version = "0.4.16", default-features = false }404unique-runtime-common = { path = "../common", default-features = false }405scale-info = { version = "2.0.1", default-features = false, features = [406 "derive",407] }408derivative = "2.2.0"409pallet-unique = { path = '../../pallets/unique', default-features = false }410up-rpc = { path = "../../primitives/rpc", default-features = false }411pallet-inflation = { path = '../../pallets/inflation', default-features = false }412up-data-structs = { path = '../../primitives/data-structs', default-features = false }413pallet-common = { default-features = false, path = "../../pallets/common" }414pallet-structure = { default-features = false, path = "../../pallets/structure" }415pallet-fungible = { default-features = false, path = "../../pallets/fungible" }416pallet-refungible = { default-features = false, path = "../../pallets/refungible" }417pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }418pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy-rmrk-core", package = "pallet-rmrk-core" }419pallet-unq-scheduler = { path = '../../pallets/scheduler', default-features = false }420# pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }421pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.21", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }422pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false }423pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false }424pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false }425pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" }426pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }427pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }428pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }429fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }430fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }431fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.21-logs" }432433################################################################################434# Build Dependencies435436[build-dependencies.substrate-wasm-builder]437git = "https://github.com/paritytech/substrate"438branch = "polkadot-v0.9.21"