git.delta.rocks / unique-network / refs/commits / ba782483735f

difftreelog

feat common construct_runtime, rmrk feature

Daniel Shiposha2022-08-01parent: #061bbd8.patch.diff
in: master

9 files changed

modifiedruntime/common/Cargo.tomldiffbeforeafterboth
--- a/runtime/common/Cargo.toml
+++ b/runtime/common/Cargo.toml
@@ -32,8 +32,10 @@
     'frame-support/runtime-benchmarks',
     'frame-system/runtime-benchmarks',
 ]
+
+opal-runtime = []
+quartz-runtime = []
 unique-runtime = []
-quartz-runtime = []
 
 refungible = []
 
modifiedruntime/common/src/lib.rsdiffbeforeafterboth
--- a/runtime/common/src/lib.rs
+++ b/runtime/common/src/lib.rs
@@ -23,3 +23,4 @@
 pub mod sponsoring;
 pub mod types;
 pub mod weights;
+pub mod construct_runtime;
modifiedruntime/common/src/runtime_apis.rsdiffbeforeafterboth
before · runtime/common/src/runtime_apis.rs
1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617#[macro_export]18macro_rules! impl_common_runtime_apis {19    (20        $(21            #![custom_apis]2223            $($custom_apis:tt)+24        )?25    ) => {26        impl_runtime_apis! {27            $($($custom_apis)+)?2829            impl up_rpc::UniqueApi<Block, CrossAccountId, AccountId> for Runtime {30                fn account_tokens(collection: CollectionId, account: CrossAccountId) -> Result<Vec<TokenId>, DispatchError> {31                    dispatch_unique_runtime!(collection.account_tokens(account))32                }33                fn collection_tokens(collection: CollectionId) -> Result<Vec<TokenId>, DispatchError> {34                    dispatch_unique_runtime!(collection.collection_tokens())35                }36                fn token_exists(collection: CollectionId, token: TokenId) -> Result<bool, DispatchError> {37                    dispatch_unique_runtime!(collection.token_exists(token))38                }3940                fn token_owner(collection: CollectionId, token: TokenId) -> Result<Option<CrossAccountId>, DispatchError> {41                    dispatch_unique_runtime!(collection.token_owner(token))42                }4344                fn token_owners(collection: CollectionId, token: TokenId) -> Result<Vec::<CrossAccountId>, DispatchError>  {45                   dispatch_unique_runtime!(collection.token_owners(token))46                }4748                fn topmost_token_owner(collection: CollectionId, token: TokenId) -> Result<Option<CrossAccountId>, DispatchError> {49                    let budget = up_data_structs::budget::Value::new(10);5051                    Ok(Some(<pallet_structure::Pallet<Runtime>>::find_topmost_owner(collection, token, &budget)?))52                }53                fn token_children(collection: CollectionId, token: TokenId) -> Result<Vec<TokenChild>, DispatchError> {54                    Ok(<pallet_nonfungible::Pallet<Runtime>>::token_children_ids(collection, token))55                }56                fn collection_properties(57                    collection: CollectionId,58                    keys: Option<Vec<Vec<u8>>>59                ) -> Result<Vec<Property>, DispatchError> {60                    let keys = keys.map(61                        |keys| Common::bytes_keys_to_property_keys(keys)62                    ).transpose()?;6364                    Common::filter_collection_properties(collection, keys)65                }6667                fn token_properties(68                    collection: CollectionId,69                    token_id: TokenId,70                    keys: Option<Vec<Vec<u8>>>71                ) -> Result<Vec<Property>, DispatchError> {72                    let keys = keys.map(73                        |keys| Common::bytes_keys_to_property_keys(keys)74                    ).transpose()?;7576                    dispatch_unique_runtime!(collection.token_properties(token_id, keys))77                }7879                fn property_permissions(80                    collection: CollectionId,81                    keys: Option<Vec<Vec<u8>>>82                ) -> Result<Vec<PropertyKeyPermission>, DispatchError> {83                    let keys = keys.map(84                        |keys| Common::bytes_keys_to_property_keys(keys)85                    ).transpose()?;8687                    Common::filter_property_permissions(collection, keys)88                }8990                fn token_data(91                    collection: CollectionId,92                    token_id: TokenId,93                    keys: Option<Vec<Vec<u8>>>94                ) -> Result<TokenData<CrossAccountId>, DispatchError> {95                    let token_data = TokenData {96                        properties: Self::token_properties(collection, token_id, keys)?,97                        owner: Self::token_owner(collection, token_id)?,98                        pieces: Self::total_pieces(collection, token_id)?.unwrap_or(0),99                    };100101                    Ok(token_data)102                }103104                fn total_supply(collection: CollectionId) -> Result<u32, DispatchError> {105                    dispatch_unique_runtime!(collection.total_supply())106                }107                fn account_balance(collection: CollectionId, account: CrossAccountId) -> Result<u32, DispatchError> {108                    dispatch_unique_runtime!(collection.account_balance(account))109                }110                fn balance(collection: CollectionId, account: CrossAccountId, token: TokenId) -> Result<u128, DispatchError> {111                    dispatch_unique_runtime!(collection.balance(account, token))112                }113                fn allowance(114                    collection: CollectionId,115                    sender: CrossAccountId,116                    spender: CrossAccountId,117                    token: TokenId,118                ) -> Result<u128, DispatchError> {119                    dispatch_unique_runtime!(collection.allowance(sender, spender, token))120                }121122                fn adminlist(collection: CollectionId) -> Result<Vec<CrossAccountId>, DispatchError> {123                    Ok(<pallet_common::Pallet<Runtime>>::adminlist(collection))124                }125                fn allowlist(collection: CollectionId) -> Result<Vec<CrossAccountId>, DispatchError> {126                    Ok(<pallet_common::Pallet<Runtime>>::allowlist(collection))127                }128                fn allowed(collection: CollectionId, user: CrossAccountId) -> Result<bool, DispatchError> {129                    Ok(<pallet_common::Pallet<Runtime>>::allowed(collection, user))130                }131                fn last_token_id(collection: CollectionId) -> Result<TokenId, DispatchError> {132                    dispatch_unique_runtime!(collection.last_token_id())133                }134                fn collection_by_id(collection: CollectionId) -> Result<Option<RpcCollection<AccountId>>, DispatchError> {135                    Ok(<pallet_common::Pallet<Runtime>>::rpc_collection(collection))136                }137                fn collection_stats() -> Result<CollectionStats, DispatchError> {138                    Ok(<pallet_common::Pallet<Runtime>>::collection_stats())139                }140                fn next_sponsored(collection: CollectionId, account: CrossAccountId, token: TokenId) -> Result<Option<u64>, DispatchError> {141                    Ok(<$crate::sponsoring::UniqueSponsorshipPredict<Runtime> as142                            $crate::sponsoring::SponsorshipPredict<Runtime>>::predict(143                        collection,144                        account,145                        token))146                }147148                fn effective_collection_limits(collection: CollectionId) -> Result<Option<CollectionLimits>, DispatchError> {149                    Ok(<pallet_common::Pallet<Runtime>>::effective_collection_limits(collection))150                }151152                fn total_pieces(collection: CollectionId, token_id: TokenId) -> Result<Option<u128>, DispatchError> {153                    dispatch_unique_runtime!(collection.total_pieces(token_id))154                }155            }156157            impl sp_api::Core<Block> for Runtime {158                fn version() -> RuntimeVersion {159                    VERSION160                }161162                fn execute_block(block: Block) {163                    Executive::execute_block(block)164                }165166                fn initialize_block(header: &<Block as BlockT>::Header) {167                    Executive::initialize_block(header)168                }169            }170171            impl sp_api::Metadata<Block> for Runtime {172                fn metadata() -> OpaqueMetadata {173                    OpaqueMetadata::new(Runtime::metadata().into())174                }175            }176177            impl sp_block_builder::BlockBuilder<Block> for Runtime {178                fn apply_extrinsic(extrinsic: <Block as BlockT>::Extrinsic) -> ApplyExtrinsicResult {179                    Executive::apply_extrinsic(extrinsic)180                }181182                fn finalize_block() -> <Block as BlockT>::Header {183                    Executive::finalize_block()184                }185186                fn inherent_extrinsics(data: sp_inherents::InherentData) -> Vec<<Block as BlockT>::Extrinsic> {187                    data.create_extrinsics()188                }189190                fn check_inherents(191                    block: Block,192                    data: sp_inherents::InherentData,193                ) -> sp_inherents::CheckInherentsResult {194                    data.check_extrinsics(&block)195                }196197                // fn random_seed() -> <Block as BlockT>::Hash {198                //     RandomnessCollectiveFlip::random_seed().0199                // }200            }201202            impl sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block> for Runtime {203                fn validate_transaction(204                    source: TransactionSource,205                    tx: <Block as BlockT>::Extrinsic,206                    hash: <Block as BlockT>::Hash,207                ) -> TransactionValidity {208                    Executive::validate_transaction(source, tx, hash)209                }210            }211212            impl sp_offchain::OffchainWorkerApi<Block> for Runtime {213                fn offchain_worker(header: &<Block as BlockT>::Header) {214                    Executive::offchain_worker(header)215                }216            }217218            impl fp_rpc::EthereumRuntimeRPCApi<Block> for Runtime {219                fn chain_id() -> u64 {220                    <Runtime as pallet_evm::Config>::ChainId::get()221                }222223                fn account_basic(address: H160) -> EVMAccount {224                    let (account, _) = EVM::account_basic(&address);225                    account226                }227228                fn gas_price() -> U256 {229                    let (price, _) = <Runtime as pallet_evm::Config>::FeeCalculator::min_gas_price();230                    price231                }232233                fn account_code_at(address: H160) -> Vec<u8> {234                    EVM::account_codes(address)235                }236237                fn author() -> H160 {238                    <pallet_evm::Pallet<Runtime>>::find_author()239                }240241                fn storage_at(address: H160, index: U256) -> H256 {242                    let mut tmp = [0u8; 32];243                    index.to_big_endian(&mut tmp);244                    EVM::account_storages(address, H256::from_slice(&tmp[..]))245                }246247                #[allow(clippy::redundant_closure)]248                fn call(249                    from: H160,250                    to: H160,251                    data: Vec<u8>,252                    value: U256,253                    gas_limit: U256,254                    max_fee_per_gas: Option<U256>,255                    max_priority_fee_per_gas: Option<U256>,256                    nonce: Option<U256>,257                    estimate: bool,258                    access_list: Option<Vec<(H160, Vec<H256>)>>,259                ) -> Result<pallet_evm::CallInfo, sp_runtime::DispatchError> {260                    let config = if estimate {261                        let mut config = <Runtime as pallet_evm::Config>::config().clone();262                        config.estimate = true;263                        Some(config)264                    } else {265                        None266                    };267268                    let is_transactional = false;269                    <Runtime as pallet_evm::Config>::Runner::call(270                        CrossAccountId::from_eth(from),271                        to,272                        data,273                        value,274                        gas_limit.low_u64(),275                        max_fee_per_gas,276                        max_priority_fee_per_gas,277                        nonce,278                        access_list.unwrap_or_default(),279                        is_transactional,280                        config.as_ref().unwrap_or_else(|| <Runtime as pallet_evm::Config>::config()),281                    ).map_err(|err| err.error.into())282                }283284                #[allow(clippy::redundant_closure)]285                fn create(286                    from: H160,287                    data: Vec<u8>,288                    value: U256,289                    gas_limit: U256,290                    max_fee_per_gas: Option<U256>,291                    max_priority_fee_per_gas: Option<U256>,292                    nonce: Option<U256>,293                    estimate: bool,294                    access_list: Option<Vec<(H160, Vec<H256>)>>,295                ) -> Result<pallet_evm::CreateInfo, sp_runtime::DispatchError> {296                    let config = if estimate {297                        let mut config = <Runtime as pallet_evm::Config>::config().clone();298                        config.estimate = true;299                        Some(config)300                    } else {301                        None302                    };303304                    let is_transactional = false;305                    <Runtime as pallet_evm::Config>::Runner::create(306                        CrossAccountId::from_eth(from),307                        data,308                        value,309                        gas_limit.low_u64(),310                        max_fee_per_gas,311                        max_priority_fee_per_gas,312                        nonce,313                        access_list.unwrap_or_default(),314                        is_transactional,315                        config.as_ref().unwrap_or_else(|| <Runtime as pallet_evm::Config>::config()),316                    ).map_err(|err| err.error.into())317                }318319                fn current_transaction_statuses() -> Option<Vec<TransactionStatus>> {320                    Ethereum::current_transaction_statuses()321                }322323                fn current_block() -> Option<pallet_ethereum::Block> {324                    Ethereum::current_block()325                }326327                fn current_receipts() -> Option<Vec<pallet_ethereum::Receipt>> {328                    Ethereum::current_receipts()329                }330331                fn current_all() -> (332                    Option<pallet_ethereum::Block>,333                    Option<Vec<pallet_ethereum::Receipt>>,334                    Option<Vec<TransactionStatus>>335                ) {336                    (337                        Ethereum::current_block(),338                        Ethereum::current_receipts(),339                        Ethereum::current_transaction_statuses()340                    )341                }342343                fn extrinsic_filter(xts: Vec<<Block as sp_api::BlockT>::Extrinsic>) -> Vec<pallet_ethereum::Transaction> {344                    xts.into_iter().filter_map(|xt| match xt.0.function {345                        Call::Ethereum(pallet_ethereum::Call::transact { transaction }) => Some(transaction),346                        _ => None347                    }).collect()348                }349350                fn elasticity() -> Option<Permill> {351                    None352                }353            }354355            impl fp_rpc::ConvertTransactionRuntimeApi<Block> for Runtime {356                fn convert_transaction(transaction: pallet_ethereum::Transaction) -> <Block as BlockT>::Extrinsic  {357                    UncheckedExtrinsic::new_unsigned(358                        pallet_ethereum::Call::<Runtime>::transact { transaction }.into(),359                    )360                }361            }362363            impl sp_session::SessionKeys<Block> for Runtime {364                fn decode_session_keys(365                    encoded: Vec<u8>,366                ) -> Option<Vec<(Vec<u8>, KeyTypeId)>> {367                    SessionKeys::decode_into_raw_public_keys(&encoded)368                }369370                fn generate_session_keys(seed: Option<Vec<u8>>) -> Vec<u8> {371                    SessionKeys::generate(seed)372                }373            }374375            impl sp_consensus_aura::AuraApi<Block, AuraId> for Runtime {376                fn slot_duration() -> sp_consensus_aura::SlotDuration {377                    sp_consensus_aura::SlotDuration::from_millis(Aura::slot_duration())378                }379380                fn authorities() -> Vec<AuraId> {381                    Aura::authorities().to_vec()382                }383            }384385            impl cumulus_primitives_core::CollectCollationInfo<Block> for Runtime {386                fn collect_collation_info(header: &<Block as BlockT>::Header) -> cumulus_primitives_core::CollationInfo {387                    ParachainSystem::collect_collation_info(header)388                }389            }390391            impl frame_system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Index> for Runtime {392                fn account_nonce(account: AccountId) -> Index {393                    System::account_nonce(account)394                }395            }396397            impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance> for Runtime {398                fn query_info(uxt: <Block as BlockT>::Extrinsic, len: u32) -> RuntimeDispatchInfo<Balance> {399                    TransactionPayment::query_info(uxt, len)400                }401                fn query_fee_details(uxt: <Block as BlockT>::Extrinsic, len: u32) -> FeeDetails<Balance> {402                    TransactionPayment::query_fee_details(uxt, len)403                }404            }405406            /*407            impl pallet_contracts_rpc_runtime_api::ContractsApi<Block, AccountId, Balance, BlockNumber, Hash>408                for Runtime409            {410                fn call(411                    origin: AccountId,412                    dest: AccountId,413                    value: Balance,414                    gas_limit: u64,415                    input_data: Vec<u8>,416                ) -> pallet_contracts_primitives::ContractExecResult {417                    Contracts::bare_call(origin, dest, value, gas_limit, input_data, false)418                }419420                fn instantiate(421                    origin: AccountId,422                    endowment: Balance,423                    gas_limit: u64,424                    code: pallet_contracts_primitives::Code<Hash>,425                    data: Vec<u8>,426                    salt: Vec<u8>,427                ) -> pallet_contracts_primitives::ContractInstantiateResult<AccountId, BlockNumber>428                {429                    Contracts::bare_instantiate(origin, endowment, gas_limit, code, data, salt, true, false)430                }431432                fn get_storage(433                    address: AccountId,434                    key: [u8; 32],435                ) -> pallet_contracts_primitives::GetStorageResult {436                    Contracts::get_storage(address, key)437                }438439                fn rent_projection(440                    address: AccountId,441                ) -> pallet_contracts_primitives::RentProjectionResult<BlockNumber> {442                    Contracts::rent_projection(address)443                }444            }445            */446447            #[cfg(feature = "runtime-benchmarks")]448            impl frame_benchmarking::Benchmark<Block> for Runtime {449                fn benchmark_metadata(extra: bool) -> (450                    Vec<frame_benchmarking::BenchmarkList>,451                    Vec<frame_support::traits::StorageInfo>,452                ) {453                    use frame_benchmarking::{list_benchmark, Benchmarking, BenchmarkList};454                    use frame_support::traits::StorageInfoTrait;455456                    let mut list = Vec::<BenchmarkList>::new();457458                    list_benchmark!(list, extra, pallet_evm_migration, EvmMigration);459                    list_benchmark!(list, extra, pallet_common, Common);460                    list_benchmark!(list, extra, pallet_unique, Unique);461                    list_benchmark!(list, extra, pallet_structure, Structure);462                    list_benchmark!(list, extra, pallet_inflation, Inflation);463                    list_benchmark!(list, extra, pallet_fungible, Fungible);464                    list_benchmark!(list, extra, pallet_refungible, Refungible);465                    list_benchmark!(list, extra, pallet_nonfungible, Nonfungible);466                    list_benchmark!(list, extra, pallet_unique_scheduler, Scheduler);467468                    #[cfg(not(feature = "unique-runtime"))]469                    list_benchmark!(list, extra, pallet_proxy_rmrk_core, RmrkCore);470471                    #[cfg(not(feature = "unique-runtime"))]472                    list_benchmark!(list, extra, pallet_proxy_rmrk_equip, RmrkEquip);473474                    // list_benchmark!(list, extra, pallet_evm_coder_substrate, EvmCoderSubstrate);475476                    let storage_info = AllPalletsReversedWithSystemFirst::storage_info();477478                    return (list, storage_info)479                }480481                fn dispatch_benchmark(482                    config: frame_benchmarking::BenchmarkConfig483                ) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, sp_runtime::RuntimeString> {484                    use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey};485486                    let allowlist: Vec<TrackedStorageKey> = vec![487                        // Total Issuance488                        hex_literal::hex!("c2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80").to_vec().into(),489490                        // Block Number491                        hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac").to_vec().into(),492                        // Execution Phase493                        hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef7ff553b5a9862a516939d82b3d3d8661a").to_vec().into(),494                        // Event Count495                        hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850").to_vec().into(),496                        // System Events497                        hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7").to_vec().into(),498499                        // Evm CurrentLogs500                        hex_literal::hex!("1da53b775b270400e7e61ed5cbc5a146547f210cec367e9af919603343b9cb56").to_vec().into(),501502                        // Transactional depth503                        hex_literal::hex!("3a7472616e73616374696f6e5f6c6576656c3a").to_vec().into(),504                    ];505506                    let mut batches = Vec::<BenchmarkBatch>::new();507                    let params = (&config, &allowlist);508509                    add_benchmark!(params, batches, pallet_evm_migration, EvmMigration);510                    add_benchmark!(params, batches, pallet_common, Common);511                    add_benchmark!(params, batches, pallet_unique, Unique);512                    add_benchmark!(params, batches, pallet_structure, Structure);513                    add_benchmark!(params, batches, pallet_inflation, Inflation);514                    add_benchmark!(params, batches, pallet_fungible, Fungible);515                    add_benchmark!(params, batches, pallet_refungible, Refungible);516                    add_benchmark!(params, batches, pallet_nonfungible, Nonfungible);517                    add_benchmark!(params, batches, pallet_unique_scheduler, Scheduler);518519                    #[cfg(not(feature = "unique-runtime"))]520                    add_benchmark!(params, batches, pallet_proxy_rmrk_core, RmrkCore);521522                    #[cfg(not(feature = "unique-runtime"))]523                    add_benchmark!(params, batches, pallet_proxy_rmrk_equip, RmrkEquip);524525                    // add_benchmark!(params, batches, pallet_evm_coder_substrate, EvmCoderSubstrate);526527                    if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) }528                    Ok(batches)529                }530            }531532            #[cfg(feature = "try-runtime")]533            impl frame_try_runtime::TryRuntime<Block> for Runtime {534                fn on_runtime_upgrade() -> (Weight, Weight) {535                    log::info!("try-runtime::on_runtime_upgrade unique-chain.");536                    let weight = Executive::try_runtime_upgrade().unwrap();537                    (weight, RuntimeBlockWeights::get().max_block)538                }539540                fn execute_block_no_check(block: Block) -> Weight {541                    Executive::execute_block_no_check(block)542                }543            }544        }545    }546}
after · runtime/common/src/runtime_apis.rs
1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617#[macro_export]18macro_rules! impl_common_runtime_apis {19    (20        $(21            #![custom_apis]2223            $($custom_apis:tt)+24        )?25    ) => {26        impl_runtime_apis! {27            $($($custom_apis)+)?2829            impl up_rpc::UniqueApi<Block, CrossAccountId, AccountId> for Runtime {30                fn account_tokens(collection: CollectionId, account: CrossAccountId) -> Result<Vec<TokenId>, DispatchError> {31                    dispatch_unique_runtime!(collection.account_tokens(account))32                }33                fn collection_tokens(collection: CollectionId) -> Result<Vec<TokenId>, DispatchError> {34                    dispatch_unique_runtime!(collection.collection_tokens())35                }36                fn token_exists(collection: CollectionId, token: TokenId) -> Result<bool, DispatchError> {37                    dispatch_unique_runtime!(collection.token_exists(token))38                }3940                fn token_owner(collection: CollectionId, token: TokenId) -> Result<Option<CrossAccountId>, DispatchError> {41                    dispatch_unique_runtime!(collection.token_owner(token))42                }4344                fn token_owners(collection: CollectionId, token: TokenId) -> Result<Vec::<CrossAccountId>, DispatchError>  {45                   dispatch_unique_runtime!(collection.token_owners(token))46                }4748                fn topmost_token_owner(collection: CollectionId, token: TokenId) -> Result<Option<CrossAccountId>, DispatchError> {49                    let budget = up_data_structs::budget::Value::new(10);5051                    Ok(Some(<pallet_structure::Pallet<Runtime>>::find_topmost_owner(collection, token, &budget)?))52                }53                fn token_children(collection: CollectionId, token: TokenId) -> Result<Vec<TokenChild>, DispatchError> {54                    Ok(<pallet_nonfungible::Pallet<Runtime>>::token_children_ids(collection, token))55                }56                fn collection_properties(57                    collection: CollectionId,58                    keys: Option<Vec<Vec<u8>>>59                ) -> Result<Vec<Property>, DispatchError> {60                    let keys = keys.map(61                        |keys| Common::bytes_keys_to_property_keys(keys)62                    ).transpose()?;6364                    Common::filter_collection_properties(collection, keys)65                }6667                fn token_properties(68                    collection: CollectionId,69                    token_id: TokenId,70                    keys: Option<Vec<Vec<u8>>>71                ) -> Result<Vec<Property>, DispatchError> {72                    let keys = keys.map(73                        |keys| Common::bytes_keys_to_property_keys(keys)74                    ).transpose()?;7576                    dispatch_unique_runtime!(collection.token_properties(token_id, keys))77                }7879                fn property_permissions(80                    collection: CollectionId,81                    keys: Option<Vec<Vec<u8>>>82                ) -> Result<Vec<PropertyKeyPermission>, DispatchError> {83                    let keys = keys.map(84                        |keys| Common::bytes_keys_to_property_keys(keys)85                    ).transpose()?;8687                    Common::filter_property_permissions(collection, keys)88                }8990                fn token_data(91                    collection: CollectionId,92                    token_id: TokenId,93                    keys: Option<Vec<Vec<u8>>>94                ) -> Result<TokenData<CrossAccountId>, DispatchError> {95                    let token_data = TokenData {96                        properties: Self::token_properties(collection, token_id, keys)?,97                        owner: Self::token_owner(collection, token_id)?,98                        pieces: Self::total_pieces(collection, token_id)?.unwrap_or(0),99                    };100101                    Ok(token_data)102                }103104                fn total_supply(collection: CollectionId) -> Result<u32, DispatchError> {105                    dispatch_unique_runtime!(collection.total_supply())106                }107                fn account_balance(collection: CollectionId, account: CrossAccountId) -> Result<u32, DispatchError> {108                    dispatch_unique_runtime!(collection.account_balance(account))109                }110                fn balance(collection: CollectionId, account: CrossAccountId, token: TokenId) -> Result<u128, DispatchError> {111                    dispatch_unique_runtime!(collection.balance(account, token))112                }113                fn allowance(114                    collection: CollectionId,115                    sender: CrossAccountId,116                    spender: CrossAccountId,117                    token: TokenId,118                ) -> Result<u128, DispatchError> {119                    dispatch_unique_runtime!(collection.allowance(sender, spender, token))120                }121122                fn adminlist(collection: CollectionId) -> Result<Vec<CrossAccountId>, DispatchError> {123                    Ok(<pallet_common::Pallet<Runtime>>::adminlist(collection))124                }125                fn allowlist(collection: CollectionId) -> Result<Vec<CrossAccountId>, DispatchError> {126                    Ok(<pallet_common::Pallet<Runtime>>::allowlist(collection))127                }128                fn allowed(collection: CollectionId, user: CrossAccountId) -> Result<bool, DispatchError> {129                    Ok(<pallet_common::Pallet<Runtime>>::allowed(collection, user))130                }131                fn last_token_id(collection: CollectionId) -> Result<TokenId, DispatchError> {132                    dispatch_unique_runtime!(collection.last_token_id())133                }134                fn collection_by_id(collection: CollectionId) -> Result<Option<RpcCollection<AccountId>>, DispatchError> {135                    Ok(<pallet_common::Pallet<Runtime>>::rpc_collection(collection))136                }137                fn collection_stats() -> Result<CollectionStats, DispatchError> {138                    Ok(<pallet_common::Pallet<Runtime>>::collection_stats())139                }140                fn next_sponsored(collection: CollectionId, account: CrossAccountId, token: TokenId) -> Result<Option<u64>, DispatchError> {141                    Ok(<$crate::sponsoring::UniqueSponsorshipPredict<Runtime> as142                            $crate::sponsoring::SponsorshipPredict<Runtime>>::predict(143                        collection,144                        account,145                        token))146                }147148                fn effective_collection_limits(collection: CollectionId) -> Result<Option<CollectionLimits>, DispatchError> {149                    Ok(<pallet_common::Pallet<Runtime>>::effective_collection_limits(collection))150                }151152                fn total_pieces(collection: CollectionId, token_id: TokenId) -> Result<Option<u128>, DispatchError> {153                    dispatch_unique_runtime!(collection.total_pieces(token_id))154                }155            }156157            impl rmrk_rpc::RmrkApi<158                Block,159                AccountId,160                RmrkCollectionInfo<AccountId>,161                RmrkInstanceInfo<AccountId>,162                RmrkResourceInfo,163                RmrkPropertyInfo,164                RmrkBaseInfo<AccountId>,165                RmrkPartType,166                RmrkTheme167            > for Runtime {168                fn last_collection_idx() -> Result<RmrkCollectionId, DispatchError> {169                    #[cfg(feature = "rmrk")]170                    return pallet_proxy_rmrk_core::rpc::last_collection_idx::<Runtime>();171172                    #[cfg(not(feature = "rmrk"))]173                    return Ok(Default::default());174                }175176                fn collection_by_id(177                    #[allow(unused_variables)]178                    collection_id: RmrkCollectionId179                ) -> Result<Option<RmrkCollectionInfo<AccountId>>, DispatchError> {180                    #[cfg(feature = "rmrk")]181                    return pallet_proxy_rmrk_core::rpc::collection_by_id::<Runtime>(collection_id);182183                    #[cfg(not(feature = "rmrk"))]184                    return Ok(Default::default())185                }186187                fn nft_by_id(188                    #[allow(unused_variables)]189                    collection_id: RmrkCollectionId,190191                    #[allow(unused_variables)]192                    nft_by_id: RmrkNftId193                ) -> Result<Option<RmrkInstanceInfo<AccountId>>, DispatchError> {194                    #[cfg(feature = "rmrk")]195                    return pallet_proxy_rmrk_core::rpc::nft_by_id::<Runtime>(collection_id, nft_by_id);196197                    #[cfg(not(feature = "rmrk"))]198                    return Ok(Default::default())199                }200201                fn account_tokens(202                    #[allow(unused_variables)]203                    account_id: AccountId,204205                    #[allow(unused_variables)]206                    collection_id: RmrkCollectionId207                ) -> Result<Vec<RmrkNftId>, DispatchError> {208                    #[cfg(feature = "rmrk")]209                    return pallet_proxy_rmrk_core::rpc::account_tokens::<Runtime>(account_id, collection_id);210211                    #[cfg(not(feature = "rmrk"))]212                    return Ok(Default::default())213                }214215                fn nft_children(216                    #[allow(unused_variables)]217                    collection_id: RmrkCollectionId,218219                    #[allow(unused_variables)]220                    nft_id: RmrkNftId221                ) -> Result<Vec<RmrkNftChild>, DispatchError> {222                    #[cfg(feature = "rmrk")]223                    return pallet_proxy_rmrk_core::rpc::nft_children::<Runtime>(collection_id, nft_id);224225                    #[cfg(not(feature = "rmrk"))]226                    return Ok(Default::default())227                }228229                fn collection_properties(230                    #[allow(unused_variables)]231                    collection_id: RmrkCollectionId,232233                    #[allow(unused_variables)]234                    filter_keys: Option<Vec<RmrkPropertyKey>>235                ) -> Result<Vec<RmrkPropertyInfo>, DispatchError> {236                    #[cfg(feature = "rmrk")]237                    return pallet_proxy_rmrk_core::rpc::collection_properties::<Runtime>(collection_id, filter_keys);238239                    #[cfg(not(feature = "rmrk"))]240                    return Ok(Default::default())241                }242243                fn nft_properties(244                    #[allow(unused_variables)]245                    collection_id: RmrkCollectionId,246247                    #[allow(unused_variables)]248                    nft_id: RmrkNftId,249250                    #[allow(unused_variables)]251                    filter_keys: Option<Vec<RmrkPropertyKey>>252                ) -> Result<Vec<RmrkPropertyInfo>, DispatchError> {253                    #[cfg(feature = "rmrk")]254                    return pallet_proxy_rmrk_core::rpc::nft_properties::<Runtime>(collection_id, nft_id, filter_keys);255256                    #[cfg(not(feature = "rmrk"))]257                    return Ok(Default::default())258                }259260                fn nft_resources(261                    #[allow(unused_variables)]262                    collection_id: RmrkCollectionId,263264                    #[allow(unused_variables)]265                    nft_id: RmrkNftId266                ) -> Result<Vec<RmrkResourceInfo>, DispatchError> {267                    #[cfg(feature = "rmrk")]268                    return pallet_proxy_rmrk_core::rpc::nft_resources::<Runtime>(collection_id, nft_id);269270                    #[cfg(not(feature = "rmrk"))]271                    return Ok(Default::default())272                }273274                fn nft_resource_priority(275                    #[allow(unused_variables)]276                    collection_id: RmrkCollectionId,277278                    #[allow(unused_variables)]279                    nft_id: RmrkNftId,280281                    #[allow(unused_variables)]282                    resource_id: RmrkResourceId283                ) -> Result<Option<u32>, DispatchError> {284                    #[cfg(feature = "rmrk")]285                    return pallet_proxy_rmrk_core::rpc::nft_resource_priority::<Runtime>(collection_id, nft_id, resource_id);286287                    #[cfg(not(feature = "rmrk"))]288                    return Ok(Default::default())289                }290291                fn base(292                    #[allow(unused_variables)]293                    base_id: RmrkBaseId294                ) -> Result<Option<RmrkBaseInfo<AccountId>>, DispatchError> {295                    #[cfg(feature = "rmrk")]296                    return pallet_proxy_rmrk_equip::rpc::base::<Runtime>(base_id);297298                    #[cfg(not(feature = "rmrk"))]299                    return Ok(Default::default())300                }301302                fn base_parts(303                    #[allow(unused_variables)]304                    base_id: RmrkBaseId305                ) -> Result<Vec<RmrkPartType>, DispatchError> {306                    #[cfg(feature = "rmrk")]307                    return pallet_proxy_rmrk_equip::rpc::base_parts::<Runtime>(base_id);308309                    #[cfg(not(feature = "rmrk"))]310                    return Ok(Default::default())311                }312313                fn theme_names(314                    #[allow(unused_variables)]315                    base_id: RmrkBaseId316                ) -> Result<Vec<RmrkThemeName>, DispatchError> {317                    #[cfg(feature = "rmrk")]318                    return pallet_proxy_rmrk_equip::rpc::theme_names::<Runtime>(base_id);319320                    #[cfg(not(feature = "rmrk"))]321                    Ok(Default::default())322                }323324                fn theme(325                    #[allow(unused_variables)]326                    base_id: RmrkBaseId,327328                    #[allow(unused_variables)]329                    theme_name: RmrkThemeName,330331                    #[allow(unused_variables)]332                    filter_keys: Option<Vec<RmrkPropertyKey>>333                ) -> Result<Option<RmrkTheme>, DispatchError> {334                    #[cfg(feature = "rmrk")]335                    return pallet_proxy_rmrk_equip::rpc::theme::<Runtime>(base_id, theme_name, filter_keys);336337                    #[cfg(not(feature = "rmrk"))]338                    return Ok(Default::default())339                }340            }341342            impl sp_api::Core<Block> for Runtime {343                fn version() -> RuntimeVersion {344                    VERSION345                }346347                fn execute_block(block: Block) {348                    Executive::execute_block(block)349                }350351                fn initialize_block(header: &<Block as BlockT>::Header) {352                    Executive::initialize_block(header)353                }354            }355356            impl sp_api::Metadata<Block> for Runtime {357                fn metadata() -> OpaqueMetadata {358                    OpaqueMetadata::new(Runtime::metadata().into())359                }360            }361362            impl sp_block_builder::BlockBuilder<Block> for Runtime {363                fn apply_extrinsic(extrinsic: <Block as BlockT>::Extrinsic) -> ApplyExtrinsicResult {364                    Executive::apply_extrinsic(extrinsic)365                }366367                fn finalize_block() -> <Block as BlockT>::Header {368                    Executive::finalize_block()369                }370371                fn inherent_extrinsics(data: sp_inherents::InherentData) -> Vec<<Block as BlockT>::Extrinsic> {372                    data.create_extrinsics()373                }374375                fn check_inherents(376                    block: Block,377                    data: sp_inherents::InherentData,378                ) -> sp_inherents::CheckInherentsResult {379                    data.check_extrinsics(&block)380                }381382                // fn random_seed() -> <Block as BlockT>::Hash {383                //     RandomnessCollectiveFlip::random_seed().0384                // }385            }386387            impl sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block> for Runtime {388                fn validate_transaction(389                    source: TransactionSource,390                    tx: <Block as BlockT>::Extrinsic,391                    hash: <Block as BlockT>::Hash,392                ) -> TransactionValidity {393                    Executive::validate_transaction(source, tx, hash)394                }395            }396397            impl sp_offchain::OffchainWorkerApi<Block> for Runtime {398                fn offchain_worker(header: &<Block as BlockT>::Header) {399                    Executive::offchain_worker(header)400                }401            }402403            impl fp_rpc::EthereumRuntimeRPCApi<Block> for Runtime {404                fn chain_id() -> u64 {405                    <Runtime as pallet_evm::Config>::ChainId::get()406                }407408                fn account_basic(address: H160) -> EVMAccount {409                    let (account, _) = EVM::account_basic(&address);410                    account411                }412413                fn gas_price() -> U256 {414                    let (price, _) = <Runtime as pallet_evm::Config>::FeeCalculator::min_gas_price();415                    price416                }417418                fn account_code_at(address: H160) -> Vec<u8> {419                    EVM::account_codes(address)420                }421422                fn author() -> H160 {423                    <pallet_evm::Pallet<Runtime>>::find_author()424                }425426                fn storage_at(address: H160, index: U256) -> H256 {427                    let mut tmp = [0u8; 32];428                    index.to_big_endian(&mut tmp);429                    EVM::account_storages(address, H256::from_slice(&tmp[..]))430                }431432                #[allow(clippy::redundant_closure)]433                fn call(434                    from: H160,435                    to: H160,436                    data: Vec<u8>,437                    value: U256,438                    gas_limit: U256,439                    max_fee_per_gas: Option<U256>,440                    max_priority_fee_per_gas: Option<U256>,441                    nonce: Option<U256>,442                    estimate: bool,443                    access_list: Option<Vec<(H160, Vec<H256>)>>,444                ) -> Result<pallet_evm::CallInfo, sp_runtime::DispatchError> {445                    let config = if estimate {446                        let mut config = <Runtime as pallet_evm::Config>::config().clone();447                        config.estimate = true;448                        Some(config)449                    } else {450                        None451                    };452453                    let is_transactional = false;454                    <Runtime as pallet_evm::Config>::Runner::call(455                        CrossAccountId::from_eth(from),456                        to,457                        data,458                        value,459                        gas_limit.low_u64(),460                        max_fee_per_gas,461                        max_priority_fee_per_gas,462                        nonce,463                        access_list.unwrap_or_default(),464                        is_transactional,465                        config.as_ref().unwrap_or_else(|| <Runtime as pallet_evm::Config>::config()),466                    ).map_err(|err| err.error.into())467                }468469                #[allow(clippy::redundant_closure)]470                fn create(471                    from: H160,472                    data: Vec<u8>,473                    value: U256,474                    gas_limit: U256,475                    max_fee_per_gas: Option<U256>,476                    max_priority_fee_per_gas: Option<U256>,477                    nonce: Option<U256>,478                    estimate: bool,479                    access_list: Option<Vec<(H160, Vec<H256>)>>,480                ) -> Result<pallet_evm::CreateInfo, sp_runtime::DispatchError> {481                    let config = if estimate {482                        let mut config = <Runtime as pallet_evm::Config>::config().clone();483                        config.estimate = true;484                        Some(config)485                    } else {486                        None487                    };488489                    let is_transactional = false;490                    <Runtime as pallet_evm::Config>::Runner::create(491                        CrossAccountId::from_eth(from),492                        data,493                        value,494                        gas_limit.low_u64(),495                        max_fee_per_gas,496                        max_priority_fee_per_gas,497                        nonce,498                        access_list.unwrap_or_default(),499                        is_transactional,500                        config.as_ref().unwrap_or_else(|| <Runtime as pallet_evm::Config>::config()),501                    ).map_err(|err| err.error.into())502                }503504                fn current_transaction_statuses() -> Option<Vec<TransactionStatus>> {505                    Ethereum::current_transaction_statuses()506                }507508                fn current_block() -> Option<pallet_ethereum::Block> {509                    Ethereum::current_block()510                }511512                fn current_receipts() -> Option<Vec<pallet_ethereum::Receipt>> {513                    Ethereum::current_receipts()514                }515516                fn current_all() -> (517                    Option<pallet_ethereum::Block>,518                    Option<Vec<pallet_ethereum::Receipt>>,519                    Option<Vec<TransactionStatus>>520                ) {521                    (522                        Ethereum::current_block(),523                        Ethereum::current_receipts(),524                        Ethereum::current_transaction_statuses()525                    )526                }527528                fn extrinsic_filter(xts: Vec<<Block as sp_api::BlockT>::Extrinsic>) -> Vec<pallet_ethereum::Transaction> {529                    xts.into_iter().filter_map(|xt| match xt.0.function {530                        Call::Ethereum(pallet_ethereum::Call::transact { transaction }) => Some(transaction),531                        _ => None532                    }).collect()533                }534535                fn elasticity() -> Option<Permill> {536                    None537                }538            }539540            impl fp_rpc::ConvertTransactionRuntimeApi<Block> for Runtime {541                fn convert_transaction(transaction: pallet_ethereum::Transaction) -> <Block as BlockT>::Extrinsic  {542                    UncheckedExtrinsic::new_unsigned(543                        pallet_ethereum::Call::<Runtime>::transact { transaction }.into(),544                    )545                }546            }547548            impl sp_session::SessionKeys<Block> for Runtime {549                fn decode_session_keys(550                    encoded: Vec<u8>,551                ) -> Option<Vec<(Vec<u8>, KeyTypeId)>> {552                    SessionKeys::decode_into_raw_public_keys(&encoded)553                }554555                fn generate_session_keys(seed: Option<Vec<u8>>) -> Vec<u8> {556                    SessionKeys::generate(seed)557                }558            }559560            impl sp_consensus_aura::AuraApi<Block, AuraId> for Runtime {561                fn slot_duration() -> sp_consensus_aura::SlotDuration {562                    sp_consensus_aura::SlotDuration::from_millis(Aura::slot_duration())563                }564565                fn authorities() -> Vec<AuraId> {566                    Aura::authorities().to_vec()567                }568            }569570            impl cumulus_primitives_core::CollectCollationInfo<Block> for Runtime {571                fn collect_collation_info(header: &<Block as BlockT>::Header) -> cumulus_primitives_core::CollationInfo {572                    ParachainSystem::collect_collation_info(header)573                }574            }575576            impl frame_system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Index> for Runtime {577                fn account_nonce(account: AccountId) -> Index {578                    System::account_nonce(account)579                }580            }581582            impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance> for Runtime {583                fn query_info(uxt: <Block as BlockT>::Extrinsic, len: u32) -> RuntimeDispatchInfo<Balance> {584                    TransactionPayment::query_info(uxt, len)585                }586                fn query_fee_details(uxt: <Block as BlockT>::Extrinsic, len: u32) -> FeeDetails<Balance> {587                    TransactionPayment::query_fee_details(uxt, len)588                }589            }590591            /*592            impl pallet_contracts_rpc_runtime_api::ContractsApi<Block, AccountId, Balance, BlockNumber, Hash>593                for Runtime594            {595                fn call(596                    origin: AccountId,597                    dest: AccountId,598                    value: Balance,599                    gas_limit: u64,600                    input_data: Vec<u8>,601                ) -> pallet_contracts_primitives::ContractExecResult {602                    Contracts::bare_call(origin, dest, value, gas_limit, input_data, false)603                }604605                fn instantiate(606                    origin: AccountId,607                    endowment: Balance,608                    gas_limit: u64,609                    code: pallet_contracts_primitives::Code<Hash>,610                    data: Vec<u8>,611                    salt: Vec<u8>,612                ) -> pallet_contracts_primitives::ContractInstantiateResult<AccountId, BlockNumber>613                {614                    Contracts::bare_instantiate(origin, endowment, gas_limit, code, data, salt, true, false)615                }616617                fn get_storage(618                    address: AccountId,619                    key: [u8; 32],620                ) -> pallet_contracts_primitives::GetStorageResult {621                    Contracts::get_storage(address, key)622                }623624                fn rent_projection(625                    address: AccountId,626                ) -> pallet_contracts_primitives::RentProjectionResult<BlockNumber> {627                    Contracts::rent_projection(address)628                }629            }630            */631632            #[cfg(feature = "runtime-benchmarks")]633            impl frame_benchmarking::Benchmark<Block> for Runtime {634                fn benchmark_metadata(extra: bool) -> (635                    Vec<frame_benchmarking::BenchmarkList>,636                    Vec<frame_support::traits::StorageInfo>,637                ) {638                    use frame_benchmarking::{list_benchmark, Benchmarking, BenchmarkList};639                    use frame_support::traits::StorageInfoTrait;640641                    let mut list = Vec::<BenchmarkList>::new();642643                    list_benchmark!(list, extra, pallet_evm_migration, EvmMigration);644                    list_benchmark!(list, extra, pallet_common, Common);645                    list_benchmark!(list, extra, pallet_unique, Unique);646                    list_benchmark!(list, extra, pallet_structure, Structure);647                    list_benchmark!(list, extra, pallet_inflation, Inflation);648                    list_benchmark!(list, extra, pallet_fungible, Fungible);649                    list_benchmark!(list, extra, pallet_refungible, Refungible);650                    list_benchmark!(list, extra, pallet_nonfungible, Nonfungible);651                    list_benchmark!(list, extra, pallet_unique_scheduler, Scheduler);652653                    #[cfg(not(feature = "unique-runtime"))]654                    list_benchmark!(list, extra, pallet_proxy_rmrk_core, RmrkCore);655656                    #[cfg(not(feature = "unique-runtime"))]657                    list_benchmark!(list, extra, pallet_proxy_rmrk_equip, RmrkEquip);658659                    // list_benchmark!(list, extra, pallet_evm_coder_substrate, EvmCoderSubstrate);660661                    let storage_info = AllPalletsReversedWithSystemFirst::storage_info();662663                    return (list, storage_info)664                }665666                fn dispatch_benchmark(667                    config: frame_benchmarking::BenchmarkConfig668                ) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, sp_runtime::RuntimeString> {669                    use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey};670671                    let allowlist: Vec<TrackedStorageKey> = vec![672                        // Total Issuance673                        hex_literal::hex!("c2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80").to_vec().into(),674675                        // Block Number676                        hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac").to_vec().into(),677                        // Execution Phase678                        hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef7ff553b5a9862a516939d82b3d3d8661a").to_vec().into(),679                        // Event Count680                        hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850").to_vec().into(),681                        // System Events682                        hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7").to_vec().into(),683684                        // Evm CurrentLogs685                        hex_literal::hex!("1da53b775b270400e7e61ed5cbc5a146547f210cec367e9af919603343b9cb56").to_vec().into(),686687                        // Transactional depth688                        hex_literal::hex!("3a7472616e73616374696f6e5f6c6576656c3a").to_vec().into(),689                    ];690691                    let mut batches = Vec::<BenchmarkBatch>::new();692                    let params = (&config, &allowlist);693694                    add_benchmark!(params, batches, pallet_evm_migration, EvmMigration);695                    add_benchmark!(params, batches, pallet_common, Common);696                    add_benchmark!(params, batches, pallet_unique, Unique);697                    add_benchmark!(params, batches, pallet_structure, Structure);698                    add_benchmark!(params, batches, pallet_inflation, Inflation);699                    add_benchmark!(params, batches, pallet_fungible, Fungible);700                    add_benchmark!(params, batches, pallet_refungible, Refungible);701                    add_benchmark!(params, batches, pallet_nonfungible, Nonfungible);702                    add_benchmark!(params, batches, pallet_unique_scheduler, Scheduler);703704                    #[cfg(not(feature = "unique-runtime"))]705                    add_benchmark!(params, batches, pallet_proxy_rmrk_core, RmrkCore);706707                    #[cfg(not(feature = "unique-runtime"))]708                    add_benchmark!(params, batches, pallet_proxy_rmrk_equip, RmrkEquip);709710                    // add_benchmark!(params, batches, pallet_evm_coder_substrate, EvmCoderSubstrate);711712                    if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) }713                    Ok(batches)714                }715            }716717            #[cfg(feature = "try-runtime")]718            impl frame_try_runtime::TryRuntime<Block> for Runtime {719                fn on_runtime_upgrade() -> (Weight, Weight) {720                    log::info!("try-runtime::on_runtime_upgrade unique-chain.");721                    let weight = Executive::try_runtime_upgrade().unwrap();722                    (weight, RuntimeBlockWeights::get().max_block)723                }724725                fn execute_block_no_check(block: Block) -> Weight {726                    Executive::execute_block_no_check(block)727                }728            }729        }730    }731}
modifiedruntime/opal/Cargo.tomldiffbeforeafterboth
--- a/runtime/opal/Cargo.toml
+++ b/runtime/opal/Cargo.toml
@@ -16,7 +16,7 @@
 targets = ['x86_64-unknown-linux-gnu']
 
 [features]
-default = ['std', 'new-functionality']
+default = ['std', 'opal-runtime']
 runtime-benchmarks = [
     'hex-literal',
     'frame-benchmarking',
@@ -119,9 +119,9 @@
     "orml-vesting/std",
 ]
 limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']
-new-functionality = [
-    'unique-runtime-common/refungible',
-]
+opal-runtime = ['rmrk']
+
+rmrk = []
 
 ################################################################################
 # Substrate Dependencies
@@ -399,7 +399,7 @@
 
 [dependencies]
 log = { version = "0.4.16", default-features = false }
-unique-runtime-common = { path = "../common", default-features = false }
+unique-runtime-common = { path = "../common", default-features = false, features = ['refungible'] }
 scale-info = { version = "2.0.1", default-features = false, features = [
     "derive",
 ] }
modifiedruntime/opal/src/lib.rsdiffbeforeafterboth
--- a/runtime/opal/src/lib.rs
+++ b/runtime/opal/src/lib.rs
@@ -54,7 +54,7 @@
 	OnMethodCall, Account as EVMAccount, FeeCalculator, GasWeightMapping,
 };
 pub use frame_support::{
-	construct_runtime, match_types,
+	match_types,
 	dispatch::DispatchResult,
 	PalletId, parameter_types, StorageValue, ConsensusEngineId,
 	traits::{
@@ -130,6 +130,7 @@
 //use xcm_executor::traits::MatchesFungible;
 
 use unique_runtime_common::{
+	construct_runtime,
 	impl_common_runtime_apis,
 	types::*,
 	constants::*,
@@ -910,11 +911,13 @@
 	type WeightInfo = pallet_nonfungible::weights::SubstrateWeight<Self>;
 }
 
+#[cfg(feature = "rmrk")]
 impl pallet_proxy_rmrk_core::Config for Runtime {
 	type WeightInfo = pallet_proxy_rmrk_core::weights::SubstrateWeight<Self>;
 	type Event = Event;
 }
 
+#[cfg(feature = "rmrk")]
 impl pallet_proxy_rmrk_equip::Config for Runtime {
 	type WeightInfo = pallet_proxy_rmrk_equip::weights::SubstrateWeight<Self>;
 	type Event = Event;
@@ -1120,60 +1123,7 @@
 	type DefaultSponsoringRateLimit = DefaultSponsoringRateLimit;
 }
 
-construct_runtime!(
-	pub enum Runtime where
-		Block = Block,
-		NodeBlock = opaque::Block,
-		UncheckedExtrinsic = UncheckedExtrinsic
-	{
-		ParachainSystem: cumulus_pallet_parachain_system::{Pallet, Call, Config, Storage, Inherent, Event<T>, ValidateUnsigned} = 20,
-		ParachainInfo: parachain_info::{Pallet, Storage, Config} = 21,
-
-		Aura: pallet_aura::{Pallet, Config<T>} = 22,
-		AuraExt: cumulus_pallet_aura_ext::{Pallet, Config} = 23,
-
-		Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>} = 30,
-		RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Storage} = 31,
-		Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 32,
-		TransactionPayment: pallet_transaction_payment::{Pallet, Storage} = 33,
-		Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event<T>} = 34,
-		Sudo: pallet_sudo::{Pallet, Call, Storage, Config<T>, Event<T>} = 35,
-		System: frame_system::{Pallet, Call, Storage, Config, Event<T>} = 36,
-		Vesting: orml_vesting::{Pallet, Storage, Call, Event<T>, Config<T>} = 37,
-		// Vesting: pallet_vesting::{Pallet, Call, Config<T>, Storage, Event<T>} = 37,
-		// Contracts: pallet_contracts::{Pallet, Call, Storage, Event<T>} = 38,
-
-		// XCM helpers.
-		XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event<T>} = 50,
-		PolkadotXcm: pallet_xcm::{Pallet, Call, Event<T>, Origin} = 51,
-		CumulusXcm: cumulus_pallet_xcm::{Pallet, Call, Event<T>, Origin} = 52,
-		DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>} = 53,
-
-		// Unique Pallets
-		Inflation: pallet_inflation::{Pallet, Call, Storage} = 60,
-		Unique: pallet_unique::{Pallet, Call, Storage, Event<T>} = 61,
-		Scheduler: pallet_unique_scheduler::{Pallet, Call, Storage, Event<T>} = 62,
-		// free = 63
-		Charging: pallet_charge_transaction::{Pallet, Call, Storage } = 64,
-		// ContractHelpers: pallet_contract_helpers::{Pallet, Call, Storage} = 65,
-		Common: pallet_common::{Pallet, Storage, Event<T>} = 66,
-		Fungible: pallet_fungible::{Pallet, Storage} = 67,
-		Refungible: pallet_refungible::{Pallet, Storage} = 68,
-		Nonfungible: pallet_nonfungible::{Pallet, Storage} = 69,
-		Structure: pallet_structure::{Pallet, Call, Storage, Event<T>} = 70,
-		RmrkCore: pallet_proxy_rmrk_core::{Pallet, Call, Storage, Event<T>} = 71,
-		RmrkEquip: pallet_proxy_rmrk_equip::{Pallet, Call, Storage, Event<T>} = 72,
-
-		// Frontier
-		EVM: pallet_evm::{Pallet, Config, Call, Storage, Event<T>} = 100,
-		Ethereum: pallet_ethereum::{Pallet, Config, Call, Storage, Event, Origin} = 101,
-
-		EvmCoderSubstrate: pallet_evm_coder_substrate::{Pallet, Storage} = 150,
-		EvmContractHelpers: pallet_evm_contract_helpers::{Pallet, Storage} = 151,
-		EvmTransactionPayment: pallet_evm_transaction_payment::{Pallet} = 152,
-		EvmMigration: pallet_evm_migration::{Pallet, Call, Storage} = 153,
-	}
-);
+construct_runtime!();
 
 pub struct TransactionConverter;
 
@@ -1309,73 +1259,7 @@
 	}};
 }
 
-impl_common_runtime_apis! {
-	#![custom_apis]
-
-	impl rmrk_rpc::RmrkApi<
-		Block,
-		AccountId,
-		RmrkCollectionInfo<AccountId>,
-		RmrkInstanceInfo<AccountId>,
-		RmrkResourceInfo,
-		RmrkPropertyInfo,
-		RmrkBaseInfo<AccountId>,
-		RmrkPartType,
-		RmrkTheme
-	> for Runtime {
-		fn last_collection_idx() -> Result<RmrkCollectionId, DispatchError> {
-			pallet_proxy_rmrk_core::rpc::last_collection_idx::<Runtime>()
-		}
-
-		fn collection_by_id(collection_id: RmrkCollectionId) -> Result<Option<RmrkCollectionInfo<AccountId>>, DispatchError> {
-			pallet_proxy_rmrk_core::rpc::collection_by_id::<Runtime>(collection_id)
-		}
-
-		fn nft_by_id(collection_id: RmrkCollectionId, nft_by_id: RmrkNftId) -> Result<Option<RmrkInstanceInfo<AccountId>>, DispatchError> {
-			pallet_proxy_rmrk_core::rpc::nft_by_id::<Runtime>(collection_id, nft_by_id)
-		}
-
-		fn account_tokens(account_id: AccountId, collection_id: RmrkCollectionId) -> Result<Vec<RmrkNftId>, DispatchError> {
-			pallet_proxy_rmrk_core::rpc::account_tokens::<Runtime>(account_id, collection_id)
-		}
-
-		fn nft_children(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Result<Vec<RmrkNftChild>, DispatchError> {
-			pallet_proxy_rmrk_core::rpc::nft_children::<Runtime>(collection_id, nft_id)
-		}
-
-		fn collection_properties(collection_id: RmrkCollectionId, filter_keys: Option<Vec<RmrkPropertyKey>>) -> Result<Vec<RmrkPropertyInfo>, DispatchError> {
-			pallet_proxy_rmrk_core::rpc::collection_properties::<Runtime>(collection_id, filter_keys)
-		}
-
-		fn nft_properties(collection_id: RmrkCollectionId, nft_id: RmrkNftId, filter_keys: Option<Vec<RmrkPropertyKey>>) -> Result<Vec<RmrkPropertyInfo>, DispatchError> {
-			pallet_proxy_rmrk_core::rpc::nft_properties::<Runtime>(collection_id, nft_id, filter_keys)
-		}
-
-		fn nft_resources(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Result<Vec<RmrkResourceInfo>, DispatchError> {
-			pallet_proxy_rmrk_core::rpc::nft_resources::<Runtime>(collection_id, nft_id)
-		}
-
-		fn nft_resource_priority(collection_id: RmrkCollectionId, nft_id: RmrkNftId, resource_id: RmrkResourceId) -> Result<Option<u32>, DispatchError> {
-			pallet_proxy_rmrk_core::rpc::nft_resource_priority::<Runtime>(collection_id, nft_id, resource_id)
-		}
-
-		fn base(base_id: RmrkBaseId) -> Result<Option<RmrkBaseInfo<AccountId>>, DispatchError> {
-			pallet_proxy_rmrk_equip::rpc::base::<Runtime>(base_id)
-		}
-
-		fn base_parts(base_id: RmrkBaseId) -> Result<Vec<RmrkPartType>, DispatchError> {
-			pallet_proxy_rmrk_equip::rpc::base_parts::<Runtime>(base_id)
-		}
-
-		fn theme_names(base_id: RmrkBaseId) -> Result<Vec<RmrkThemeName>, DispatchError> {
-			pallet_proxy_rmrk_equip::rpc::theme_names::<Runtime>(base_id)
-		}
-
-		fn theme(base_id: RmrkBaseId, theme_name: RmrkThemeName, filter_keys: Option<Vec<RmrkPropertyKey>>) -> Result<Option<RmrkTheme>, DispatchError> {
-			pallet_proxy_rmrk_equip::rpc::theme::<Runtime>(base_id, theme_name, filter_keys)
-		}
-	}
-}
+impl_common_runtime_apis!();
 
 struct CheckInherents;
 
modifiedruntime/quartz/Cargo.tomldiffbeforeafterboth
--- a/runtime/quartz/Cargo.toml
+++ b/runtime/quartz/Cargo.toml
@@ -16,7 +16,7 @@
 targets = ['x86_64-unknown-linux-gnu']
 
 [features]
-default = ['std', 'new-functionality']
+default = ['std', 'quartz-runtime']
 runtime-benchmarks = [
     'hex-literal',
     'frame-benchmarking',
@@ -118,7 +118,9 @@
     "orml-vesting/std",
 ]
 limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']
-new-functionality = []
+quartz-runtime = []
+
+rmrk = []
 
 ################################################################################
 # Substrate Dependencies
modifiedruntime/quartz/src/lib.rsdiffbeforeafterboth
--- a/runtime/quartz/src/lib.rs
+++ b/runtime/quartz/src/lib.rs
@@ -54,7 +54,7 @@
 	OnMethodCall, Account as EVMAccount, FeeCalculator, GasWeightMapping,
 };
 pub use frame_support::{
-	construct_runtime, match_types,
+	match_types,
 	dispatch::DispatchResult,
 	PalletId, parameter_types, StorageValue, ConsensusEngineId,
 	traits::{
@@ -128,6 +128,7 @@
 use xcm_executor::traits::{MatchesFungible, WeightTrader};
 
 use unique_runtime_common::{
+	construct_runtime,
 	impl_common_runtime_apis,
 	types::*,
 	constants::*,
@@ -909,15 +910,17 @@
 	type WeightInfo = pallet_nonfungible::weights::SubstrateWeight<Self>;
 }
 
-// impl pallet_proxy_rmrk_core::Config for Runtime {
-// 	type WeightInfo = pallet_proxy_rmrk_core::weights::SubstrateWeight<Self>;
-// 	type Event = Event;
-// }
+#[cfg(feature = "rmrk")]
+impl pallet_proxy_rmrk_core::Config for Runtime {
+	type WeightInfo = pallet_proxy_rmrk_core::weights::SubstrateWeight<Self>;
+	type Event = Event;
+}
 
-// impl pallet_proxy_rmrk_equip::Config for Runtime {
-// 	type WeightInfo = pallet_proxy_rmrk_equip::weights::SubstrateWeight<Self>;
-// 	type Event = Event;
-// }
+#[cfg(feature = "rmrk")]
+impl pallet_proxy_rmrk_equip::Config for Runtime {
+	type WeightInfo = pallet_proxy_rmrk_equip::weights::SubstrateWeight<Self>;
+	type Event = Event;
+}
 
 impl pallet_unique::Config for Runtime {
 	type Event = Event;
@@ -1118,61 +1121,8 @@
 	type DefaultSponsoringRateLimit = DefaultSponsoringRateLimit;
 }
 
-construct_runtime!(
-	pub enum Runtime where
-		Block = Block,
-		NodeBlock = opaque::Block,
-		UncheckedExtrinsic = UncheckedExtrinsic
-	{
-		ParachainSystem: cumulus_pallet_parachain_system::{Pallet, Call, Config, Storage, Inherent, Event<T>, ValidateUnsigned} = 20,
-		ParachainInfo: parachain_info::{Pallet, Storage, Config} = 21,
-
-		Aura: pallet_aura::{Pallet, Config<T>} = 22,
-		AuraExt: cumulus_pallet_aura_ext::{Pallet, Config} = 23,
-
-		Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>} = 30,
-		RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Storage} = 31,
-		Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 32,
-		TransactionPayment: pallet_transaction_payment::{Pallet, Storage} = 33,
-		Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event<T>} = 34,
-		Sudo: pallet_sudo::{Pallet, Call, Storage, Config<T>, Event<T>} = 35,
-		System: frame_system::{Pallet, Call, Storage, Config, Event<T>} = 36,
-		Vesting: orml_vesting::{Pallet, Storage, Call, Event<T>, Config<T>} = 37,
-		// Vesting: pallet_vesting::{Pallet, Call, Config<T>, Storage, Event<T>} = 37,
-		// Contracts: pallet_contracts::{Pallet, Call, Storage, Event<T>} = 38,
-
-		// XCM helpers.
-		XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event<T>} = 50,
-		PolkadotXcm: pallet_xcm::{Pallet, Call, Event<T>, Origin} = 51,
-		CumulusXcm: cumulus_pallet_xcm::{Pallet, Call, Event<T>, Origin} = 52,
-		DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>} = 53,
+construct_runtime!();
 
-		// Unique Pallets
-		Inflation: pallet_inflation::{Pallet, Call, Storage} = 60,
-		Unique: pallet_unique::{Pallet, Call, Storage, Event<T>} = 61,
-		// Scheduler: pallet_unique_scheduler::{Pallet, Call, Storage, Event<T>} = 62,
-		// free = 63
-		Charging: pallet_charge_transaction::{Pallet, Call, Storage } = 64,
-		// ContractHelpers: pallet_contract_helpers::{Pallet, Call, Storage} = 65,
-		Common: pallet_common::{Pallet, Storage, Event<T>} = 66,
-		Fungible: pallet_fungible::{Pallet, Storage} = 67,
-		// Refungible: pallet_refungible::{Pallet, Storage} = 68,
-		Nonfungible: pallet_nonfungible::{Pallet, Storage} = 69,
-		Structure: pallet_structure::{Pallet, Call, Storage, Event<T>} = 70,
-		// RmrkCore: pallet_proxy_rmrk_core::{Pallet, Call, Storage, Event<T>} = 71,
-		// RmrkEquip: pallet_proxy_rmrk_equip::{Pallet, Call, Storage, Event<T>} = 72,
-
-		// Frontier
-		EVM: pallet_evm::{Pallet, Config, Call, Storage, Event<T>} = 100,
-		Ethereum: pallet_ethereum::{Pallet, Config, Call, Storage, Event, Origin} = 101,
-
-		EvmCoderSubstrate: pallet_evm_coder_substrate::{Pallet, Storage} = 150,
-		EvmContractHelpers: pallet_evm_contract_helpers::{Pallet, Storage} = 151,
-		EvmTransactionPayment: pallet_evm_transaction_payment::{Pallet} = 152,
-		EvmMigration: pallet_evm_migration::{Pallet, Call, Storage} = 153,
-	}
-);
-
 pub struct TransactionConverter;
 
 impl fp_rpc::ConvertTransaction<UncheckedExtrinsic> for TransactionConverter {
@@ -1308,129 +1258,8 @@
 		Ok::<_, DispatchError>(dispatch.$method($($name),*))
 	}};
 }
-
-impl_common_runtime_apis! {
-	#![custom_apis]
 
-	impl rmrk_rpc::RmrkApi<
-		Block,
-		AccountId,
-		RmrkCollectionInfo<AccountId>,
-		RmrkInstanceInfo<AccountId>,
-		RmrkResourceInfo,
-		RmrkPropertyInfo,
-		RmrkBaseInfo<AccountId>,
-		RmrkPartType,
-		RmrkTheme
-	> for Runtime {
-		
-		// fn last_collection_idx() -> Result<RmrkCollectionId, DispatchError> {
-		// 	pallet_proxy_rmrk_core::rpc::last_collection_idx::<Runtime>()
-		// }
-
-		// fn collection_by_id(collection_id: RmrkCollectionId) -> Result<Option<RmrkCollectionInfo<AccountId>>, DispatchError> {
-		// 	pallet_proxy_rmrk_core::rpc::collection_by_id::<Runtime>(collection_id)
-		// }
-
-		// fn nft_by_id(collection_id: RmrkCollectionId, nft_by_id: RmrkNftId) -> Result<Option<RmrkInstanceInfo<AccountId>>, DispatchError> {
-		// 	pallet_proxy_rmrk_core::rpc::nft_by_id::<Runtime>(collection_id, nft_by_id)
-		// }
-
-		// fn account_tokens(account_id: AccountId, collection_id: RmrkCollectionId) -> Result<Vec<RmrkNftId>, DispatchError> {
-		// 	pallet_proxy_rmrk_core::rpc::account_tokens::<Runtime>(account_id, collection_id)
-		// }
-
-		// fn nft_children(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Result<Vec<RmrkNftChild>, DispatchError> {
-		// 	pallet_proxy_rmrk_core::rpc::nft_children::<Runtime>(collection_id, nft_id)
-		// }
-
-		// fn collection_properties(collection_id: RmrkCollectionId, filter_keys: Option<Vec<RmrkPropertyKey>>) -> Result<Vec<RmrkPropertyInfo>, DispatchError> {
-		// 	pallet_proxy_rmrk_core::rpc::collection_properties::<Runtime>(collection_id, filter_keys)
-		// }
-
-		// fn nft_properties(collection_id: RmrkCollectionId, nft_id: RmrkNftId, filter_keys: Option<Vec<RmrkPropertyKey>>) -> Result<Vec<RmrkPropertyInfo>, DispatchError> {
-		// 	pallet_proxy_rmrk_core::rpc::nft_properties::<Runtime>(collection_id, nft_id, filter_keys)
-		// }
-
-		// fn nft_resources(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Result<Vec<RmrkResourceInfo>, DispatchError> {
-		// 	pallet_proxy_rmrk_core::rpc::nft_resources::<Runtime>(collection_id, nft_id)
-		// }
-
-		// fn nft_resource_priority(collection_id: RmrkCollectionId, nft_id: RmrkNftId, resource_id: RmrkResourceId) -> Result<Option<u32>, DispatchError> {
-		// 	pallet_proxy_rmrk_core::rpc::nft_resource_priority::<Runtime>(collection_id, nft_id, resource_id)
-		// }
-
-		// fn base(base_id: RmrkBaseId) -> Result<Option<RmrkBaseInfo<AccountId>>, DispatchError> {
-		// 	pallet_proxy_rmrk_equip::rpc::base::<Runtime>(base_id)
-		// }
-
-		// fn base_parts(base_id: RmrkBaseId) -> Result<Vec<RmrkPartType>, DispatchError> {
-		// 	pallet_proxy_rmrk_equip::rpc::base_parts::<Runtime>(base_id)
-		// }
-
-		// fn theme_names(base_id: RmrkBaseId) -> Result<Vec<RmrkThemeName>, DispatchError> {
-		// 	pallet_proxy_rmrk_equip::rpc::theme_names::<Runtime>(base_id)
-		// }
-
-		// fn theme(base_id: RmrkBaseId, theme_name: RmrkThemeName, filter_keys: Option<Vec<RmrkPropertyKey>>) -> Result<Option<RmrkTheme>, DispatchError> {
-		// 	pallet_proxy_rmrk_equip::rpc::theme::<Runtime>(base_id, theme_name, filter_keys)
-		// }
-		
-		fn last_collection_idx() -> Result<RmrkCollectionId, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn collection_by_id(_collection_id: RmrkCollectionId) -> Result<Option<RmrkCollectionInfo<AccountId>>, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn nft_by_id(_collection_id: RmrkCollectionId, _nft_by_id: RmrkNftId) -> Result<Option<RmrkInstanceInfo<AccountId>>, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn account_tokens(_account_id: AccountId, _collection_id: RmrkCollectionId) -> Result<Vec<RmrkNftId>, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn nft_children(_collection_id: RmrkCollectionId, _nft_id: RmrkNftId) -> Result<Vec<RmrkNftChild>, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn collection_properties(_collection_id: RmrkCollectionId, _filter_keys: Option<Vec<RmrkPropertyKey>>) -> Result<Vec<RmrkPropertyInfo>, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn nft_properties(_collection_id: RmrkCollectionId, _nft_id: RmrkNftId, _filter_keys: Option<Vec<RmrkPropertyKey>>) -> Result<Vec<RmrkPropertyInfo>, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn nft_resources(_collection_id: RmrkCollectionId, _nft_id: RmrkNftId) -> Result<Vec<RmrkResourceInfo>, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn nft_resource_priority(_collection_id: RmrkCollectionId, _nft_id: RmrkNftId, _resource_id: RmrkResourceId) -> Result<Option<u32>, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn base(_base_id: RmrkBaseId) -> Result<Option<RmrkBaseInfo<AccountId>>, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn base_parts(_base_id: RmrkBaseId) -> Result<Vec<RmrkPartType>, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn theme_names(_base_id: RmrkBaseId) -> Result<Vec<RmrkThemeName>, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn theme(_base_id: RmrkBaseId, _theme_name: RmrkThemeName, _filter_keys: Option<Vec<RmrkPropertyKey>>) -> Result<Option<RmrkTheme>, DispatchError> {
-			Ok(Default::default())
-		}
-		
-		
-	}
-}
+impl_common_runtime_apis!();
 
 struct CheckInherents;
 
modifiedruntime/unique/Cargo.tomldiffbeforeafterboth
--- a/runtime/unique/Cargo.toml
+++ b/runtime/unique/Cargo.toml
@@ -16,7 +16,7 @@
 targets = ['x86_64-unknown-linux-gnu']
 
 [features]
-default = ['std', 'new-functionality']
+default = ['std', 'unique-runtime']
 runtime-benchmarks = [
     'hex-literal',
     'frame-benchmarking',
@@ -119,7 +119,7 @@
     "orml-vesting/std",
 ]
 limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']
-new-functionality = []
+unique-runtime = []
 
 ################################################################################
 # Substrate Dependencies
modifiedruntime/unique/src/lib.rsdiffbeforeafterboth
--- a/runtime/unique/src/lib.rs
+++ b/runtime/unique/src/lib.rs
@@ -54,7 +54,7 @@
 	OnMethodCall, Account as EVMAccount, FeeCalculator, GasWeightMapping,
 };
 pub use frame_support::{
-	construct_runtime, match_types,
+	match_types,
 	dispatch::DispatchResult,
 	PalletId, parameter_types, StorageValue, ConsensusEngineId,
 	traits::{
@@ -128,6 +128,7 @@
 use xcm_executor::traits::{MatchesFungible, WeightTrader};
 
 use unique_runtime_common::{
+	construct_runtime,
 	impl_common_runtime_apis,
 	types::*,
 	constants::*,
@@ -910,6 +911,18 @@
 	type WeightInfo = pallet_nonfungible::weights::SubstrateWeight<Self>;
 }
 
+#[cfg(feature = "rmrk")]
+impl pallet_proxy_rmrk_core::Config for Runtime {
+	type WeightInfo = pallet_proxy_rmrk_core::weights::SubstrateWeight<Self>;
+	type Event = Event;
+}
+
+#[cfg(feature = "rmrk")]
+impl pallet_proxy_rmrk_equip::Config for Runtime {
+	type WeightInfo = pallet_proxy_rmrk_equip::weights::SubstrateWeight<Self>;
+	type Event = Event;
+}
+
 impl pallet_unique::Config for Runtime {
 	type Event = Event;
 	type WeightInfo = pallet_unique::weights::SubstrateWeight<Self>;
@@ -1109,58 +1122,7 @@
 	type DefaultSponsoringRateLimit = DefaultSponsoringRateLimit;
 }
 
-construct_runtime!(
-	pub enum Runtime where
-		Block = Block,
-		NodeBlock = opaque::Block,
-		UncheckedExtrinsic = UncheckedExtrinsic
-	{
-		ParachainSystem: cumulus_pallet_parachain_system::{Pallet, Call, Config, Storage, Inherent, Event<T>, ValidateUnsigned} = 20,
-		ParachainInfo: parachain_info::{Pallet, Storage, Config} = 21,
-
-		Aura: pallet_aura::{Pallet, Config<T>} = 22,
-		AuraExt: cumulus_pallet_aura_ext::{Pallet, Config} = 23,
-
-		Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>} = 30,
-		RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Storage} = 31,
-		Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 32,
-		TransactionPayment: pallet_transaction_payment::{Pallet, Storage} = 33,
-		Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event<T>} = 34,
-		Sudo: pallet_sudo::{Pallet, Call, Storage, Config<T>, Event<T>} = 35,
-		System: frame_system::{Pallet, Call, Storage, Config, Event<T>} = 36,
-		Vesting: orml_vesting::{Pallet, Storage, Call, Event<T>, Config<T>} = 37,
-		// Vesting: pallet_vesting::{Pallet, Call, Config<T>, Storage, Event<T>} = 37,
-		// Contracts: pallet_contracts::{Pallet, Call, Storage, Event<T>} = 38,
-
-		// XCM helpers.
-		XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event<T>} = 50,
-		PolkadotXcm: pallet_xcm::{Pallet, Call, Event<T>, Origin} = 51,
-		CumulusXcm: cumulus_pallet_xcm::{Pallet, Call, Event<T>, Origin} = 52,
-		DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>} = 53,
-
-		// Unique Pallets
-		Inflation: pallet_inflation::{Pallet, Call, Storage} = 60,
-		Unique: pallet_unique::{Pallet, Call, Storage, Event<T>} = 61,
-		// Scheduler: pallet_unique_scheduler::{Pallet, Call, Storage, Event<T>} = 62,
-		// free = 63
-		Charging: pallet_charge_transaction::{Pallet, Call, Storage } = 64,
-		// ContractHelpers: pallet_contract_helpers::{Pallet, Call, Storage} = 65,
-		Common: pallet_common::{Pallet, Storage, Event<T>} = 66,
-		Fungible: pallet_fungible::{Pallet, Storage} = 67,
-		// Refungible: pallet_refungible::{Pallet, Storage} = 68,
-		Nonfungible: pallet_nonfungible::{Pallet, Storage} = 69,
-		Structure: pallet_structure::{Pallet, Call, Storage, Event<T>} = 70,
-
-		// Frontier
-		EVM: pallet_evm::{Pallet, Config, Call, Storage, Event<T>} = 100,
-		Ethereum: pallet_ethereum::{Pallet, Config, Call, Storage, Event, Origin} = 101,
-
-		EvmCoderSubstrate: pallet_evm_coder_substrate::{Pallet, Storage} = 150,
-		EvmContractHelpers: pallet_evm_contract_helpers::{Pallet, Storage} = 151,
-		EvmTransactionPayment: pallet_evm_transaction_payment::{Pallet} = 152,
-		EvmMigration: pallet_evm_migration::{Pallet, Call, Storage} = 153,
-	}
-);
+construct_runtime!();
 
 pub struct TransactionConverter;
 
@@ -1297,73 +1259,7 @@
 	}};
 }
 
-impl_common_runtime_apis! {
-	#![custom_apis]
-
-	impl rmrk_rpc::RmrkApi<
-		Block,
-		AccountId,
-		RmrkCollectionInfo<AccountId>,
-		RmrkInstanceInfo<AccountId>,
-		RmrkResourceInfo,
-		RmrkPropertyInfo,
-		RmrkBaseInfo<AccountId>,
-		RmrkPartType,
-		RmrkTheme
-	> for Runtime {
-		fn last_collection_idx() -> Result<RmrkCollectionId, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn collection_by_id(_collection_id: RmrkCollectionId) -> Result<Option<RmrkCollectionInfo<AccountId>>, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn nft_by_id(_collection_id: RmrkCollectionId, _nft_by_id: RmrkNftId) -> Result<Option<RmrkInstanceInfo<AccountId>>, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn account_tokens(_account_id: AccountId, _collection_id: RmrkCollectionId) -> Result<Vec<RmrkNftId>, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn nft_children(_collection_id: RmrkCollectionId, _nft_id: RmrkNftId) -> Result<Vec<RmrkNftChild>, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn collection_properties(_collection_id: RmrkCollectionId, _filter_keys: Option<Vec<RmrkPropertyKey>>) -> Result<Vec<RmrkPropertyInfo>, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn nft_properties(_collection_id: RmrkCollectionId, _nft_id: RmrkNftId, _filter_keys: Option<Vec<RmrkPropertyKey>>) -> Result<Vec<RmrkPropertyInfo>, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn nft_resources(_collection_id: RmrkCollectionId, _nft_id: RmrkNftId) -> Result<Vec<RmrkResourceInfo>, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn nft_resource_priority(_collection_id: RmrkCollectionId, _nft_id: RmrkNftId, _resource_id: RmrkResourceId) -> Result<Option<u32>, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn base(_base_id: RmrkBaseId) -> Result<Option<RmrkBaseInfo<AccountId>>, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn base_parts(_base_id: RmrkBaseId) -> Result<Vec<RmrkPartType>, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn theme_names(_base_id: RmrkBaseId) -> Result<Vec<RmrkThemeName>, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn theme(_base_id: RmrkBaseId, _theme_name: RmrkThemeName, _filter_keys: Option<Vec<RmrkPropertyKey>>) -> Result<Option<RmrkTheme>, DispatchError> {
-			Ok(Default::default())
-		}
-	}
-}
+impl_common_runtime_apis!();
 
 struct CheckInherents;