mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 17:31:03 +00:00
NFTs 2.0 on Statemine (#2314)
* Add nfts pallet to statemine * Add missing trait * Add nfts pallet to SafeCallFilter * Re-use uniques deposits
This commit is contained in:
@@ -361,15 +361,11 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
|
||||
RuntimeCall::Assets(TrustBackedAssetsCall::clear_metadata { .. }) |
|
||||
RuntimeCall::Nfts(pallet_nfts::Call::create { .. }) |
|
||||
RuntimeCall::Nfts(pallet_nfts::Call::destroy { .. }) |
|
||||
RuntimeCall::Nfts(pallet_nfts::Call::redeposit { .. }) |
|
||||
RuntimeCall::Nfts(pallet_nfts::Call::transfer_ownership { .. }) |
|
||||
RuntimeCall::Nfts(pallet_nfts::Call::set_team { .. }) |
|
||||
RuntimeCall::Nfts(pallet_nfts::Call::lock_item_properties { .. }) |
|
||||
RuntimeCall::Nfts(pallet_nfts::Call::set_metadata { .. }) |
|
||||
RuntimeCall::Nfts(pallet_nfts::Call::set_collection_metadata { .. }) |
|
||||
RuntimeCall::Nfts(pallet_nfts::Call::clear_metadata { .. }) |
|
||||
RuntimeCall::Nfts(pallet_nfts::Call::clear_collection_metadata { .. }) |
|
||||
RuntimeCall::Nfts(pallet_nfts::Call::set_collection_max_supply { .. }) |
|
||||
RuntimeCall::Nfts(pallet_nfts::Call::update_mint_settings { .. }) |
|
||||
RuntimeCall::Nfts(pallet_nfts::Call::lock_collection { .. }) |
|
||||
RuntimeCall::Uniques(pallet_uniques::Call::create { .. }) |
|
||||
RuntimeCall::Uniques(pallet_uniques::Call::destroy { .. }) |
|
||||
RuntimeCall::Uniques(pallet_uniques::Call::transfer_ownership { .. }) |
|
||||
@@ -393,10 +389,16 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
|
||||
RuntimeCall::Assets(TrustBackedAssetsCall::freeze_asset { .. }) |
|
||||
RuntimeCall::Assets(TrustBackedAssetsCall::thaw_asset { .. }) |
|
||||
RuntimeCall::Nfts(pallet_nfts::Call::force_mint { .. }) |
|
||||
RuntimeCall::Nfts(pallet_nfts::Call::burn { .. }) |
|
||||
RuntimeCall::Nfts(pallet_nfts::Call::update_mint_settings { .. }) |
|
||||
RuntimeCall::Nfts(pallet_nfts::Call::mint_pre_signed { .. }) |
|
||||
RuntimeCall::Nfts(pallet_nfts::Call::set_attributes_pre_signed { .. }) |
|
||||
RuntimeCall::Nfts(pallet_nfts::Call::lock_item_transfer { .. }) |
|
||||
RuntimeCall::Nfts(pallet_nfts::Call::unlock_item_transfer { .. }) |
|
||||
RuntimeCall::Nfts(pallet_nfts::Call::lock_collection { .. }) |
|
||||
RuntimeCall::Nfts(pallet_nfts::Call::lock_item_properties { .. }) |
|
||||
RuntimeCall::Nfts(pallet_nfts::Call::set_metadata { .. }) |
|
||||
RuntimeCall::Nfts(pallet_nfts::Call::clear_metadata { .. }) |
|
||||
RuntimeCall::Nfts(pallet_nfts::Call::set_collection_metadata { .. }) |
|
||||
RuntimeCall::Nfts(pallet_nfts::Call::clear_collection_metadata { .. }) |
|
||||
RuntimeCall::Uniques(pallet_uniques::Call::mint { .. }) |
|
||||
RuntimeCall::Uniques(pallet_uniques::Call::burn { .. }) |
|
||||
RuntimeCall::Uniques(pallet_uniques::Call::freeze { .. }) |
|
||||
@@ -548,14 +550,11 @@ impl pallet_asset_tx_payment::Config for Runtime {
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
pub const CollectionDeposit: Balance = UNITS / 10; // 1 / 10 UNIT deposit to create asset class
|
||||
pub const ItemDeposit: Balance = UNITS / 1_000; // 1 / 1000 UNIT deposit to create asset instance
|
||||
pub const KeyLimit: u32 = 32; // Max 32 bytes per key
|
||||
pub const ValueLimit: u32 = 64; // Max 64 bytes per value
|
||||
pub const UniquesCollectionDeposit: Balance = UNITS / 10; // 1 / 10 UNIT deposit to create a collection
|
||||
pub const UniquesItemDeposit: Balance = UNITS / 1_000; // 1 / 1000 UNIT deposit to mint an item
|
||||
pub const UniquesMetadataDepositBase: Balance = deposit(1, 129);
|
||||
pub const AttributeDepositBase: Balance = deposit(1, 0);
|
||||
pub const DepositPerByte: Balance = deposit(0, 1);
|
||||
pub const UniquesStringLimit: u32 = 128;
|
||||
pub const UniquesAttributeDepositBase: Balance = deposit(1, 0);
|
||||
pub const UniquesDepositPerByte: Balance = deposit(0, 1);
|
||||
}
|
||||
|
||||
impl pallet_uniques::Config for Runtime {
|
||||
@@ -564,14 +563,14 @@ impl pallet_uniques::Config for Runtime {
|
||||
type ItemId = u32;
|
||||
type Currency = Balances;
|
||||
type ForceOrigin = AssetsForceOrigin;
|
||||
type CollectionDeposit = CollectionDeposit;
|
||||
type ItemDeposit = ItemDeposit;
|
||||
type CollectionDeposit = UniquesCollectionDeposit;
|
||||
type ItemDeposit = UniquesItemDeposit;
|
||||
type MetadataDepositBase = UniquesMetadataDepositBase;
|
||||
type AttributeDepositBase = AttributeDepositBase;
|
||||
type DepositPerByte = DepositPerByte;
|
||||
type StringLimit = UniquesStringLimit;
|
||||
type KeyLimit = KeyLimit;
|
||||
type ValueLimit = ValueLimit;
|
||||
type AttributeDepositBase = UniquesAttributeDepositBase;
|
||||
type DepositPerByte = UniquesDepositPerByte;
|
||||
type StringLimit = ConstU32<128>;
|
||||
type KeyLimit = ConstU32<32>;
|
||||
type ValueLimit = ConstU32<64>;
|
||||
type WeightInfo = weights::pallet_uniques::WeightInfo<Runtime>;
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
type Helper = ();
|
||||
@@ -582,6 +581,12 @@ impl pallet_uniques::Config for Runtime {
|
||||
parameter_types! {
|
||||
pub NftsPalletFeatures: PalletFeatures = PalletFeatures::all_enabled();
|
||||
pub const NftsMaxDeadlineDuration: BlockNumber = 12 * 30 * DAYS;
|
||||
// re-use the Uniques deposits
|
||||
pub const NftsCollectionDeposit: Balance = UniquesCollectionDeposit::get();
|
||||
pub const NftsItemDeposit: Balance = UniquesItemDeposit::get();
|
||||
pub const NftsMetadataDepositBase: Balance = UniquesMetadataDepositBase::get();
|
||||
pub const NftsAttributeDepositBase: Balance = UniquesAttributeDepositBase::get();
|
||||
pub const NftsDepositPerByte: Balance = UniquesDepositPerByte::get();
|
||||
}
|
||||
|
||||
impl pallet_nfts::Config for Runtime {
|
||||
@@ -592,14 +597,14 @@ impl pallet_nfts::Config for Runtime {
|
||||
type CreateOrigin = AsEnsureOriginWithArg<EnsureSigned<AccountId>>;
|
||||
type ForceOrigin = AssetsForceOrigin;
|
||||
type Locker = ();
|
||||
type CollectionDeposit = CollectionDeposit;
|
||||
type ItemDeposit = ItemDeposit;
|
||||
type MetadataDepositBase = UniquesMetadataDepositBase;
|
||||
type AttributeDepositBase = AttributeDepositBase;
|
||||
type DepositPerByte = DepositPerByte;
|
||||
type StringLimit = UniquesStringLimit;
|
||||
type KeyLimit = KeyLimit;
|
||||
type ValueLimit = ValueLimit;
|
||||
type CollectionDeposit = NftsCollectionDeposit;
|
||||
type ItemDeposit = NftsItemDeposit;
|
||||
type MetadataDepositBase = NftsMetadataDepositBase;
|
||||
type AttributeDepositBase = NftsAttributeDepositBase;
|
||||
type DepositPerByte = NftsDepositPerByte;
|
||||
type StringLimit = ConstU32<256>;
|
||||
type KeyLimit = ConstU32<64>;
|
||||
type ValueLimit = ConstU32<256>;
|
||||
type ApprovalsLimit = ConstU32<20>;
|
||||
type ItemAttributesApprovalsLimit = ConstU32<30>;
|
||||
type MaxTips = ConstU32<10>;
|
||||
|
||||
Reference in New Issue
Block a user