diff --git a/Cargo.lock b/Cargo.lock index 06a763e29..6476ca98b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1441,6 +1441,7 @@ dependencies = [ name = "bifrost-parachain-staking" version = "3.0.1" dependencies = [ + "bifrost-primitives", "frame-benchmarking", "frame-support", "frame-system", @@ -1620,6 +1621,7 @@ version = "0.8.0" dependencies = [ "bstringify", "frame-support", + "hex-literal 0.4.1", "orml-oracle", "orml-traits", "parity-scale-codec", diff --git a/pallets/bb-bnc/src/mock.rs b/pallets/bb-bnc/src/mock.rs index 0f5aff4bd..5bfd05d76 100644 --- a/pallets/bb-bnc/src/mock.rs +++ b/pallets/bb-bnc/src/mock.rs @@ -23,10 +23,13 @@ use crate as bb_bnc; use bifrost_asset_registry::AssetIdMaps; -use bifrost_primitives::MoonbeamChainId; pub use bifrost_primitives::{ currency::*, CurrencyId, CurrencyIdMapping, SlpxOperator, TokenSymbol, }; +use bifrost_primitives::{ + BifrostEntranceAccount, BifrostExitAccount, BifrostFeeAccount, BuyBackAccount, + IncentivePalletId, IncentivePoolAccount, MoonbeamChainId, +}; use bifrost_runtime_common::{micro, milli}; use bifrost_slp::{QueryId, QueryResponseManager}; pub use cumulus_primitives_core::ParaId; @@ -35,10 +38,8 @@ use frame_support::{ pallet_prelude::Get, parameter_types, traits::{Everything, Nothing}, - PalletId, }; use frame_system::{EnsureRoot, EnsureSignedBy}; -use hex_literal::hex; use orml_traits::{location::RelativeReserveProvider, parameter_type_with_key}; use sp_core::ConstU32; use sp_runtime::{ @@ -90,7 +91,7 @@ impl frame_system::Config for Runtime { } parameter_types! { - pub const NativeCurrencyId: CurrencyId = CurrencyId::Native(TokenSymbol::BNC); + pub const NativeCurrencyId: CurrencyId = BNC; } pub type AdaptedBasicCurrency = @@ -105,11 +106,8 @@ impl bifrost_currencies::Config for Runtime { parameter_types! { pub const ExistentialDeposit: Balance = 1; - // pub const NativeCurrencyId: CurrencyId = CurrencyId::Native(TokenSymbol::BNC); - // pub const RelayCurrencyId: CurrencyId = CurrencyId::Token(TokenSymbol::KSM); - pub const StableCurrencyId: CurrencyId = CurrencyId::Stable(TokenSymbol::KUSD); - // pub SelfParaId: u32 = ParachainInfo::parachain_id().into(); - pub const PolkadotCurrencyId: CurrencyId = CurrencyId::Token(TokenSymbol::DOT); + pub const StableCurrencyId: CurrencyId = KUSD; + pub const PolkadotCurrencyId: CurrencyId = DOT; } impl pallet_balances::Config for Runtime { @@ -192,15 +190,11 @@ impl orml_xtokens::Config for Runtime { parameter_types! { pub const MaximumUnlockIdOfUser: u32 = 1_000; pub const MaximumUnlockIdOfTimeUnit: u32 = 1_000; - pub BifrostEntranceAccount: PalletId = PalletId(*b"bf/vtkin"); - pub BifrostExitAccount: PalletId = PalletId(*b"bf/vtout"); - pub BifrostFeeAccount: AccountId = hex!["e4da05f08e89bf6c43260d96f26fffcfc7deae5b465da08669a9d008e64c2c63"].into(); - pub IncentivePoolAccount: PalletId = PalletId(*b"bf/inpoo"); } ord_parameter_types! { pub const One: AccountId = ALICE; - pub const RelayCurrencyId: CurrencyId = CurrencyId::Token(TokenSymbol::KSM); + pub const RelayCurrencyId: CurrencyId = KSM; } impl bifrost_vtoken_minting::Config for Runtime { @@ -240,9 +234,7 @@ impl bifrost_asset_registry::Config for Runtime { } parameter_types! { - pub const BbBNCTokenType: CurrencyId = CurrencyId::VToken(TokenSymbol::BNC); - pub IncentivePalletId: PalletId = PalletId(*b"bf/bbict"); - pub const BuyBackAccount: PalletId = PalletId(*b"bf/bybck"); + pub const BbBNCTokenType: CurrencyId = VBNC; pub const Week: BlockNumber = 50400; // a week pub const MaxBlock: BlockNumber = 10512000; // four years pub const Multiplier: Balance = 10_u128.pow(12); diff --git a/pallets/buy-back/src/mock.rs b/pallets/buy-back/src/mock.rs index ae4b9787a..ce98941ad 100644 --- a/pallets/buy-back/src/mock.rs +++ b/pallets/buy-back/src/mock.rs @@ -22,8 +22,11 @@ #![allow(non_upper_case_globals)] use bifrost_asset_registry::AssetIdMaps; -use bifrost_primitives::MoonbeamChainId; -pub use bifrost_primitives::{currency::*, CurrencyId, SlpxOperator, TokenSymbol}; +pub use bifrost_primitives::{currency::*, CurrencyId, SlpxOperator}; +use bifrost_primitives::{ + BifrostEntranceAccount, BifrostExitAccount, BifrostFeeAccount, BuyBackAccount, + IncentivePalletId, IncentivePoolAccount, LiquidityAccount, MoonbeamChainId, ZenlinkPalletId, +}; use bifrost_slp::{QueryId, QueryResponseManager}; pub use cumulus_primitives_core::ParaId; use frame_support::{ @@ -32,10 +35,8 @@ use frame_support::{ parameter_types, sp_runtime::{traits::ConvertInto, DispatchError, DispatchResult}, traits::{Everything, Nothing}, - PalletId, }; use frame_system::{EnsureRoot, EnsureSignedBy}; -use hex_literal::hex; use orml_traits::{location::RelativeReserveProvider, parameter_type_with_key, MultiCurrency}; use sp_core::ConstU32; use sp_runtime::{ @@ -104,7 +105,7 @@ impl frame_system::Config for Runtime { } parameter_types! { - pub const GetNativeCurrencyId: CurrencyId = CurrencyId::Native(TokenSymbol::BNC); + pub const GetNativeCurrencyId: CurrencyId = BNC; } pub type AdaptedBasicCurrency = @@ -158,14 +159,11 @@ impl orml_tokens::Config for Runtime { parameter_types! { pub const TreasuryAccount: AccountId32 = TREASURY_ACCOUNT; - pub BifrostVsbondAccount: PalletId = PalletId(*b"bf/salpb"); - pub const BuyBackAccount: PalletId = PalletId(*b"bf/bybck"); - pub const LiquidityAccount: PalletId = PalletId(*b"bf/liqdt"); } ord_parameter_types! { pub const One: AccountId = ALICE; - pub const RelayCurrencyId: CurrencyId = CurrencyId::Token(TokenSymbol::KSM); + pub const RelayCurrencyId: CurrencyId = KSM; } impl bifrost_buy_back::Config for Runtime { @@ -283,10 +281,6 @@ impl orml_xtokens::Config for Runtime { parameter_types! { pub const MaximumUnlockIdOfUser: u32 = 10; pub const MaximumUnlockIdOfTimeUnit: u32 = 50; - pub BifrostEntranceAccount: PalletId = PalletId(*b"bf/vtkin"); - pub BifrostExitAccount: PalletId = PalletId(*b"bf/vtout"); - pub BifrostFeeAccount: AccountId = hex!["e4da05f08e89bf6c43260d96f26fffcfc7deae5b465da08669a9d008e64c2c63"].into(); - pub IncentivePoolAccount: PalletId = PalletId(*b"bf/inpoo"); } impl bifrost_vtoken_minting::Config for Runtime { @@ -316,7 +310,6 @@ impl bifrost_vtoken_minting::Config for Runtime { } parameter_types! { - pub const ZenlinkPalletId: PalletId = PalletId(*b"/zenlink"); pub const GetExchangeFee: (u32, u32) = (3, 1000); // 0.3% pub const SelfParaId: u32 = 2001; } @@ -465,8 +458,7 @@ impl pallet_xcm::Config for Runtime { } parameter_types! { - pub const BbBNCTokenType: CurrencyId = CurrencyId::VToken(TokenSymbol::BNC); - pub IncentivePalletId: PalletId = PalletId(*b"bf/bbict"); + pub const BbBNCTokenType: CurrencyId = VBNC; pub const Week: BlockNumber = 50400; // a week pub const MaxBlock: BlockNumber = 10512000; // four years pub const Multiplier: Balance = 10_u128.pow(12); diff --git a/pallets/buy-back/src/tests.rs b/pallets/buy-back/src/tests.rs index 485d80d52..864c9dfd9 100644 --- a/pallets/buy-back/src/tests.rs +++ b/pallets/buy-back/src/tests.rs @@ -21,6 +21,7 @@ #![cfg(test)] use crate::{mock::*, *}; +use bifrost_primitives::IncentivePalletId; use frame_support::{assert_noop, assert_ok}; use sp_arithmetic::per_things::Permill; diff --git a/pallets/channel-commission/src/mock.rs b/pallets/channel-commission/src/mock.rs index 69ef466b2..aa9c70ae6 100644 --- a/pallets/channel-commission/src/mock.rs +++ b/pallets/channel-commission/src/mock.rs @@ -21,8 +21,8 @@ use crate::mock::sp_api_hidden_includes_construct_runtime::hidden_include::traits::OnInitialize; use bifrost_primitives::{ - currency::{BNC, KSM}, - CurrencyId, TokenSymbol, + currency::{ASG, BNC, KSM}, + CommissionPalletId, CurrencyId, }; use frame_support::{derive_impl, ord_parameter_types, parameter_types, traits::Nothing, PalletId}; use frame_system::EnsureSignedBy; @@ -66,7 +66,7 @@ impl frame_system::Config for Runtime { } parameter_types! { - pub const GetNativeCurrencyId: CurrencyId = CurrencyId::Native(TokenSymbol::ASG); + pub const GetNativeCurrencyId: CurrencyId = ASG; } pub type AdaptedBasicCurrency = @@ -127,10 +127,8 @@ ord_parameter_types! { } parameter_types! { - pub const CommissionPalletId: PalletId = PalletId(*b"bf/comms"); pub const ClearingDuration: u32 = 100; pub const NameLengthLimit: u32 = 20; - pub const FeeSharePalletId: PalletId = PalletId(*b"bf/feesh"); pub BifrostCommissionReceiver: AccountId = AccountId32::new([7u8; 32]); } diff --git a/pallets/clouds-convert/src/mock.rs b/pallets/clouds-convert/src/mock.rs index 72a89989b..b4b455135 100644 --- a/pallets/clouds-convert/src/mock.rs +++ b/pallets/clouds-convert/src/mock.rs @@ -24,9 +24,9 @@ use bifrost_asset_registry::AssetIdMaps; use bifrost_primitives::{ currency::{BNC, CLOUD, KSM, VBNC, VKSM}, - CurrencyId, CurrencyIdMapping, TokenSymbol, + BuyBackAccount, CloudsPalletId, CurrencyId, CurrencyIdMapping, IncentivePalletId, }; -use frame_support::{ord_parameter_types, parameter_types, traits::Nothing, PalletId}; +use frame_support::{ord_parameter_types, parameter_types, traits::Nothing}; use frame_system::EnsureSignedBy; use sp_core::H256; use sp_runtime::{ @@ -95,7 +95,7 @@ impl frame_system::Config for Runtime { } parameter_types! { - pub const NativeCurrencyId: CurrencyId = CurrencyId::Native(TokenSymbol::BNC); + pub const NativeCurrencyId: CurrencyId = BNC; } pub type AdaptedBasicCurrency = @@ -166,10 +166,6 @@ impl bifrost_asset_registry::Config for Runtime { type WeightInfo = (); } -parameter_types! { - pub const CloudsPalletId: PalletId = PalletId(*b"bf/cloud"); -} - impl bifrost_clouds_convert::Config for Runtime { type RuntimeEvent = RuntimeEvent; type MultiCurrency = Currencies; @@ -180,9 +176,7 @@ impl bifrost_clouds_convert::Config for Runtime { } parameter_types! { - pub const BbBNCTokenType: CurrencyId = CurrencyId::VToken(TokenSymbol::BNC); - pub IncentivePalletId: PalletId = PalletId(*b"bf/bbict"); - pub const BuyBackAccount: PalletId = PalletId(*b"bf/bybck"); + pub const BbBNCTokenType: CurrencyId = VBNC; pub const Week: BlockNumber = 50400; // a week pub const MaxBlock: BlockNumber = 10512000; // four years pub const Multiplier: Balance = 10_u128.pow(12); diff --git a/pallets/cross-in-out/src/mock.rs b/pallets/cross-in-out/src/mock.rs index 527975bec..c76374cf3 100644 --- a/pallets/cross-in-out/src/mock.rs +++ b/pallets/cross-in-out/src/mock.rs @@ -20,8 +20,8 @@ #![allow(non_upper_case_globals)] use bifrost_primitives::{ - currency::{BNC, DOT, KSM, VDOT}, - CurrencyId, TokenSymbol, + currency::{ASG, BNC, DOT, KSM, VDOT}, + CurrencyId, SlpEntrancePalletId, }; use frame_support::{derive_impl, ord_parameter_types, parameter_types, traits::Nothing, PalletId}; use frame_system::EnsureSignedBy; @@ -65,7 +65,7 @@ impl frame_system::Config for Runtime { } parameter_types! { - pub const GetNativeCurrencyId: CurrencyId = CurrencyId::Native(TokenSymbol::ASG); + pub const GetNativeCurrencyId: CurrencyId = ASG; } pub type AdaptedBasicCurrency = @@ -126,7 +126,6 @@ ord_parameter_types! { } parameter_types! { - pub const SlpEntrancePalletId: PalletId = PalletId(*b"bf/vtkin"); pub const MaxLengthLimit: u32 = 100; } diff --git a/pallets/deprecated/lightening-redeem/src/mock.rs b/pallets/deprecated/lightening-redeem/src/mock.rs index bdf14c461..a56b0d582 100644 --- a/pallets/deprecated/lightening-redeem/src/mock.rs +++ b/pallets/deprecated/lightening-redeem/src/mock.rs @@ -129,10 +129,6 @@ impl pallet_collective::Config for Runtime { type WeightInfo = pallet_collective::weights::SubstrateWeight; } -parameter_types! { - pub const LighteningRedeemPalletId: PalletId = PalletId(*b"lighten#"); -} - impl bifrost_lightening_redeem::Config for Runtime { type RuntimeEvent = RuntimeEvent; type MultiCurrency = Tokens; diff --git a/pallets/deprecated/liquidity-mining/src/mock.rs b/pallets/deprecated/liquidity-mining/src/mock.rs index bae62a103..8c9ac3b3f 100644 --- a/pallets/deprecated/liquidity-mining/src/mock.rs +++ b/pallets/deprecated/liquidity-mining/src/mock.rs @@ -180,7 +180,6 @@ parameter_types! { pub const MinimumDuration: BlockNumber = MINUTES; pub const MaximumApproved: u32 = 4; pub const MaximumOptionRewards: u32 = 7; - pub const LiquidityMiningPalletId: PalletId = PalletId(*b"mining##"); } impl lm::Config for Test { diff --git a/pallets/deprecated/salp-lite/src/mock.rs b/pallets/deprecated/salp-lite/src/mock.rs index 962f5232d..04a8bdafb 100644 --- a/pallets/deprecated/salp-lite/src/mock.rs +++ b/pallets/deprecated/salp-lite/src/mock.rs @@ -161,7 +161,6 @@ impl bifrost_currencies::Config for Test { parameter_types! { pub const MinContribution: Balance = 10; - pub const BifrostCrowdloanId: PalletId = PalletId(*b"bf/salp#"); pub const RemoveKeysLimit: u32 = 50; pub const SlotLength: BlockNumber = 8u32 as BlockNumber; pub const LeasePeriod: BlockNumber = 6 * WEEKS; diff --git a/pallets/deprecated/system-maker/src/mock.rs b/pallets/deprecated/system-maker/src/mock.rs index 756815e07..33f85fb4f 100644 --- a/pallets/deprecated/system-maker/src/mock.rs +++ b/pallets/deprecated/system-maker/src/mock.rs @@ -22,8 +22,11 @@ #![allow(non_upper_case_globals)] use bifrost_asset_registry::AssetIdMaps; -use bifrost_primitives::MoonbeamChainId; -pub use bifrost_primitives::{currency::*, CurrencyId, SlpxOperator, TokenSymbol}; +pub use bifrost_primitives::{currency::*, CurrencyId, SlpxOperator}; +use bifrost_primitives::{ + BifrostEntranceAccount, BifrostExitAccount, BifrostFeeAccount, IncentivePoolAccount, + MoonbeamChainId, SystemMakerPalletId, ZenlinkPalletId, +}; use bifrost_slp::{QueryId, QueryResponseManager}; pub use cumulus_primitives_core::ParaId; use frame_support::{ @@ -32,10 +35,8 @@ use frame_support::{ parameter_types, sp_runtime::{DispatchError, DispatchResult}, traits::{Everything, Nothing}, - PalletId, }; use frame_system::{EnsureRoot, EnsureSignedBy}; -use hex_literal::hex; use orml_traits::{location::RelativeReserveProvider, parameter_type_with_key, MultiCurrency}; use sp_core::ConstU32; use sp_runtime::{ @@ -103,7 +104,7 @@ impl frame_system::Config for Runtime { } parameter_types! { - pub const GetNativeCurrencyId: CurrencyId = CurrencyId::Native(TokenSymbol::ASG); + pub const GetNativeCurrencyId: CurrencyId = ASG; } pub type AdaptedBasicCurrency = @@ -157,14 +158,11 @@ impl orml_tokens::Config for Runtime { parameter_types! { pub const TreasuryAccount: AccountId32 = TREASURY_ACCOUNT; - pub BifrostVsbondAccount: PalletId = PalletId(*b"bf/salpb"); - pub const SystemMakerPalletId: PalletId = PalletId(*b"bf/sysmk"); } ord_parameter_types! { pub const One: AccountId = ALICE; - // pub const RelayChainTokenSymbolKSM: TokenSymbol = TokenSymbol::KSM; - pub const RelayCurrencyId: CurrencyId = CurrencyId::Token(TokenSymbol::KSM); + pub const RelayCurrencyId: CurrencyId = KSM; } impl bifrost_system_maker::Config for Runtime { @@ -282,10 +280,6 @@ impl orml_xtokens::Config for Runtime { parameter_types! { pub const MaximumUnlockIdOfUser: u32 = 10; pub const MaximumUnlockIdOfTimeUnit: u32 = 50; - pub BifrostEntranceAccount: PalletId = PalletId(*b"bf/vtkin"); - pub BifrostExitAccount: PalletId = PalletId(*b"bf/vtout"); - pub BifrostFeeAccount: AccountId = hex!["e4da05f08e89bf6c43260d96f26fffcfc7deae5b465da08669a9d008e64c2c63"].into(); - pub IncentivePoolAccount: PalletId = PalletId(*b"bf/inpoo"); } impl bifrost_vtoken_minting::Config for Runtime { @@ -315,7 +309,6 @@ impl bifrost_vtoken_minting::Config for Runtime { } parameter_types! { - pub const ZenlinkPalletId: PalletId = PalletId(*b"/zenlink"); pub const GetExchangeFee: (u32, u32) = (3, 1000); // 0.3% pub const SelfParaId: u32 = 2001; } diff --git a/pallets/farming/src/mock.rs b/pallets/farming/src/mock.rs index fe91ffb78..28a443f84 100644 --- a/pallets/farming/src/mock.rs +++ b/pallets/farming/src/mock.rs @@ -21,8 +21,13 @@ #![cfg(test)] #![allow(non_upper_case_globals)] -pub use bifrost_primitives::{currency::*, CurrencyId, TokenSymbol}; -use frame_support::{derive_impl, ord_parameter_types, parameter_types, traits::Nothing, PalletId}; +pub use bifrost_primitives::{currency::*, CurrencyId}; +use bifrost_primitives::{ + currency::{ASG, VBNC}, + BuyBackAccount, FarmingBoostPalletId, FarmingGaugeRewardIssuerPalletId, FarmingKeeperPalletId, + FarmingRewardIssuerPalletId, IncentivePalletId, +}; +use frame_support::{derive_impl, ord_parameter_types, parameter_types, traits::Nothing}; use frame_system::EnsureSignedBy; use sp_core::ConstU32; use sp_runtime::{ @@ -69,7 +74,7 @@ impl frame_system::Config for Runtime { } parameter_types! { - pub const GetNativeCurrencyId: CurrencyId = CurrencyId::Native(TokenSymbol::ASG); + pub const GetNativeCurrencyId: CurrencyId = ASG; } pub type AdaptedBasicCurrency = @@ -123,12 +128,8 @@ impl orml_tokens::Config for Runtime { } parameter_types! { - pub const FarmingKeeperPalletId: PalletId = PalletId(*b"bf/fmkpr"); - pub const FarmingRewardIssuerPalletId: PalletId = PalletId(*b"bf/fmrir"); - pub const FarmingBoostPalletId: PalletId = PalletId(*b"bf/fmbst"); pub const TreasuryAccount: AccountId32 = TREASURY_ACCOUNT; pub const WhitelistMaximumLimit: u32 = 10; - pub const FarmingGaugeRewardIssuerPalletId: PalletId = PalletId(*b"bf/fmgar"); } ord_parameter_types! { @@ -152,9 +153,7 @@ impl bifrost_farming::Config for Runtime { } parameter_types! { - pub const BbBNCTokenType: CurrencyId = CurrencyId::VToken(TokenSymbol::BNC); - pub IncentivePalletId: PalletId = PalletId(*b"bf/bbict"); - pub const BuyBackAccount: PalletId = PalletId(*b"bf/bybck"); + pub const BbBNCTokenType: CurrencyId = VBNC; pub const Week: BlockNumber = 50400; // a week pub const MaxBlock: BlockNumber = 10512000; // four years pub const Multiplier: Balance = 10_u128.pow(12); diff --git a/pallets/fee-share/src/mock.rs b/pallets/fee-share/src/mock.rs index 16945802b..5b404135b 100644 --- a/pallets/fee-share/src/mock.rs +++ b/pallets/fee-share/src/mock.rs @@ -23,8 +23,11 @@ pub use super::*; use bifrost_asset_registry::AssetIdMaps; -pub use bifrost_primitives::{currency::*, CurrencyId, Moment, SlpxOperator, TokenSymbol}; -use bifrost_primitives::{MoonbeamChainId, PriceDetail}; +pub use bifrost_primitives::{currency::*, CurrencyId, Moment, SlpxOperator}; +use bifrost_primitives::{ + BifrostEntranceAccount, BifrostExitAccount, BifrostFeeAccount, FeeSharePalletId, + IncentivePoolAccount, MoonbeamChainId, PriceDetail, ZenlinkPalletId, +}; use bifrost_slp::{QueryId, QueryResponseManager}; pub use cumulus_primitives_core::ParaId; use frame_support::{ @@ -33,10 +36,8 @@ use frame_support::{ parameter_types, sp_runtime::{DispatchError, DispatchResult, FixedPointNumber}, traits::{Everything, Nothing}, - PalletId, }; use frame_system::{EnsureRoot, EnsureSignedBy}; -use hex_literal::hex; use orml_traits::{ location::RelativeReserveProvider, parameter_type_with_key, DataFeeder, DataProvider, DataProviderExtended, MultiCurrency, @@ -113,7 +114,7 @@ impl frame_system::Config for Runtime { } parameter_types! { - pub const GetNativeCurrencyId: CurrencyId = CurrencyId::Native(TokenSymbol::ASG); + pub const GetNativeCurrencyId: CurrencyId = ASG; } pub type AdaptedBasicCurrency = @@ -167,13 +168,11 @@ impl orml_tokens::Config for Runtime { parameter_types! { pub const TreasuryAccount: AccountId32 = TREASURY_ACCOUNT; - pub BifrostVsbondAccount: PalletId = PalletId(*b"bf/salpb"); - pub const FeeSharePalletId: PalletId = PalletId(*b"bf/feesh"); } ord_parameter_types! { pub const One: AccountId = ALICE; - pub const RelayCurrencyId: CurrencyId = CurrencyId::Token(TokenSymbol::KSM); + pub const RelayCurrencyId: CurrencyId = KSM; } impl bifrost_fee_share::Config for Runtime { @@ -394,10 +393,6 @@ impl orml_xtokens::Config for Runtime { parameter_types! { pub const MaximumUnlockIdOfUser: u32 = 10; pub const MaximumUnlockIdOfTimeUnit: u32 = 50; - pub BifrostEntranceAccount: PalletId = PalletId(*b"bf/vtkin"); - pub BifrostExitAccount: PalletId = PalletId(*b"bf/vtout"); - pub BifrostFeeAccount: AccountId = hex!["e4da05f08e89bf6c43260d96f26fffcfc7deae5b465da08669a9d008e64c2c63"].into(); - pub IncentivePoolAccount: PalletId = PalletId(*b"bf/inpoo"); } impl bifrost_vtoken_minting::Config for Runtime { @@ -427,7 +422,6 @@ impl bifrost_vtoken_minting::Config for Runtime { } parameter_types! { - pub const ZenlinkPalletId: PalletId = PalletId(*b"/zenlink"); pub const GetExchangeFee: (u32, u32) = (3, 1000); // 0.3% pub const SelfParaId: u32 = 2001; } diff --git a/pallets/flexible-fee/src/mock.rs b/pallets/flexible-fee/src/mock.rs index d8ef4559d..7e061dcb0 100644 --- a/pallets/flexible-fee/src/mock.rs +++ b/pallets/flexible-fee/src/mock.rs @@ -21,7 +21,7 @@ use super::*; use crate::{self as flexible_fee, mock_price::MockOraclePriceProvider}; use bifrost_currencies::BasicCurrencyAdapter; -use bifrost_primitives::{Balance, CurrencyId, TokenSymbol}; +use bifrost_primitives::{Balance, CurrencyId, FlexibleFeePalletId, TokenSymbol, ZenlinkPalletId}; use cumulus_primitives_core::ParaId as Pid; use frame_support::{ derive_impl, parameter_types, @@ -149,7 +149,6 @@ impl orml_tokens::Config for Test { parameter_types! { pub const TreasuryAccount: AccountId32 = TREASURY_ACCOUNT; pub const MaxFeeCurrencyOrderListLen: u32 = 50; - pub const FlexibleFeePalletId: PalletId = PalletId(*b"bf/flexi"); } impl crate::Config for Test { @@ -196,7 +195,7 @@ impl Get for ParaInfo { } parameter_types! { - pub const GetNativeCurrencyId: CurrencyId = CurrencyId::Native(TokenSymbol::BNC); + pub const GetNativeCurrencyId: CurrencyId = BNC; } impl bifrost_currencies::Config for Test { @@ -207,7 +206,6 @@ impl bifrost_currencies::Config for Test { } parameter_types! { - pub const ZenlinkPalletId: PalletId = PalletId(*b"/zenlink"); pub const GetExchangeFee: (u32, u32) = (3, 1000); // 0.3% pub const SelfParaId: u32 = 2001; } diff --git a/pallets/lend-market/src/mock.rs b/pallets/lend-market/src/mock.rs index eecf3f21d..9e2ba4bb1 100644 --- a/pallets/lend-market/src/mock.rs +++ b/pallets/lend-market/src/mock.rs @@ -22,7 +22,6 @@ pub use bifrost_primitives::{currency::*, *}; use frame_support::{ construct_runtime, derive_impl, parameter_types, traits::{AsEnsureOriginWithArg, Nothing, SortedMembers}, - PalletId, }; use frame_system::{EnsureRoot, EnsureSigned, EnsureSignedBy}; use orml_traits::{DataFeeder, DataProvider, DataProviderExtended}; @@ -88,11 +87,6 @@ parameter_types! { pub const MaxLocks: u32 = 50; } -parameter_types! { - pub const StableCurrencyId: CurrencyId = CurrencyId::Stable(TokenSymbol::KUSD); - pub const PolkadotCurrencyId: CurrencyId = CurrencyId::Token(TokenSymbol::DOT); -} - impl pallet_balances::Config for Test { type AccountStore = frame_system::Pallet; type Balance = Balance; @@ -116,10 +110,6 @@ impl bifrost_asset_registry::Config for Test { type WeightInfo = (); } -parameter_types! { - pub const NativeCurrencyId: CurrencyId = CurrencyId::Native(TokenSymbol::BNC); -} - orml_traits::parameter_type_with_key! { pub ExistentialDeposits: |currency_id: CurrencyId| -> Balance { match currency_id { @@ -316,7 +306,6 @@ impl pallet_prices::Config for Test { } parameter_types! { - pub const LendMarketPalletId: PalletId = PalletId(*b"bf/ldmkt"); pub const RewardAssetId: CurrencyId = BNC; pub const LiquidationFreeAssetId: CurrencyId = DOT; } diff --git a/pallets/leverage-staking/src/mock.rs b/pallets/leverage-staking/src/mock.rs index f7ab5dd74..dc76e26b3 100644 --- a/pallets/leverage-staking/src/mock.rs +++ b/pallets/leverage-staking/src/mock.rs @@ -22,12 +22,14 @@ use bifrost_asset_registry::AssetIdMaps; pub use bifrost_primitives::{ currency::*, Balance, CurrencyId, CurrencyIdMapping, SlpOperator, SlpxOperator, TokenSymbol, }; -use bifrost_primitives::{Moment, MoonbeamChainId, OraclePriceProvider, Price, PriceDetail, Ratio}; +use bifrost_primitives::{ + BifrostEntranceAccount, BifrostExitAccount, IncentivePoolAccount, LendMarketPalletId, Moment, + MoonbeamChainId, OraclePriceProvider, Price, PriceDetail, Ratio, StableAssetPalletId, +}; use bifrost_runtime_common::milli; use frame_support::{ derive_impl, ord_parameter_types, parameter_types, traits::{ConstU128, ConstU32, Everything, Nothing}, - PalletId, }; use frame_system::{EnsureRoot, EnsureSignedBy}; use lend_market::{InterestRateModel, JumpModel, Market, MarketState}; @@ -77,7 +79,7 @@ impl frame_system::Config for Test { } parameter_types! { - pub const NativeCurrencyId: CurrencyId = CurrencyId::Native(TokenSymbol::BNC); + pub const NativeCurrencyId: CurrencyId = BNC; } orml_traits::parameter_type_with_key! { @@ -235,9 +237,6 @@ impl bifrost_stable_asset::traits::ValidateAssetId for EnsurePoolAss true } } -parameter_types! { - pub const StableAssetPalletId: PalletId = PalletId(*b"nuts/sta"); -} impl bifrost_stable_asset::Config for Test { type RuntimeEvent = RuntimeEvent; @@ -279,9 +278,6 @@ impl leverage_staking::Config for Test { parameter_types! { pub const MaximumUnlockIdOfUser: u32 = 1_000; pub const MaximumUnlockIdOfTimeUnit: u32 = 1_000; - pub BifrostEntranceAccount: PalletId = PalletId(*b"bf/vtkin"); - pub BifrostExitAccount: PalletId = PalletId(*b"bf/vtout"); - pub IncentivePoolAccount: PalletId = PalletId(*b"bf/inpoo"); } pub struct SlpxInterface; @@ -292,7 +288,7 @@ impl SlpxOperator for SlpxInterface { } ord_parameter_types! { - pub const RelayCurrencyId: CurrencyId = CurrencyId::Token(TokenSymbol::KSM); + pub const RelayCurrencyId: CurrencyId = KSM; } impl bifrost_vtoken_minting::Config for Test { @@ -439,7 +435,6 @@ impl OraclePriceProvider for MockOraclePriceProvider { } parameter_types! { - pub const LendMarketPalletId: PalletId = PalletId(*b"bf/ldmkt"); pub const RewardAssetId: CurrencyId = BNC; pub const LiquidationFreeAssetId: CurrencyId = DOT; } diff --git a/pallets/parachain-staking/Cargo.toml b/pallets/parachain-staking/Cargo.toml index c3e5089c3..c9a7d34b9 100644 --- a/pallets/parachain-staking/Cargo.toml +++ b/pallets/parachain-staking/Cargo.toml @@ -6,6 +6,7 @@ edition = "2021" version = "3.0.1" [dependencies] +bifrost-primitives = { workspace = true } log = { workspace = true } serde = { workspace = true, features = ["derive"] } diff --git a/pallets/parachain-staking/src/mock.rs b/pallets/parachain-staking/src/mock.rs index 29303a027..45acfb13b 100644 --- a/pallets/parachain-staking/src/mock.rs +++ b/pallets/parachain-staking/src/mock.rs @@ -18,7 +18,6 @@ use frame_support::{ construct_runtime, derive_impl, parameter_types, traits::{LockIdentifier, LockableCurrency, OnFinalize, OnInitialize, ReservableCurrency}, - PalletId, }; use sp_core::ConstU32; use sp_runtime::{traits::IdentityLookup, Perbill, Percent}; @@ -29,6 +28,7 @@ use crate::{ DelegatorReserveToLockMigrations, DelegatorState, InflationInfo, Points, Range, COLLATOR_LOCK_ID, DELEGATOR_LOCK_ID, }; +use bifrost_primitives::ParachainStakingPalletId; use sp_runtime::BuildStorage; pub type AccountId = u64; @@ -96,7 +96,6 @@ parameter_types! { pub const MinDelegation: u128 = 3; pub AllowInflation: bool = true; pub PaymentInRound: u128 = 10; - pub const ParachainStakingPalletId: PalletId = PalletId(*b"bf/stake"); pub ToMigrateInvulnables: Vec = vec![ 0,1 ]; diff --git a/pallets/salp/src/mock.rs b/pallets/salp/src/mock.rs index e2138c859..f377cbab3 100644 --- a/pallets/salp/src/mock.rs +++ b/pallets/salp/src/mock.rs @@ -22,8 +22,13 @@ use bifrost_asset_registry::AssetIdMaps; use bifrost_primitives::{ - Amount, Balance, CurrencyId, CurrencyId::*, MessageId, MockXcmExecutor, ParaId, SlpOperator, - SlpxOperator, TokenSymbol, TokenSymbol::*, VKSM, + Amount, Balance, BifrostCrowdloanId, BifrostEntranceAccount, BifrostExitAccount, + BuybackPalletId, + CurrencyId::{self, *}, + IncentivePoolAccount, MessageId, MockXcmExecutor, ParaId, SlpOperator, SlpxOperator, + StableAssetPalletId, + TokenSymbol::{self, *}, + ZenlinkPalletId, ASG, KSM, KUSD, VKSM, }; use bifrost_xcm_interface::traits::XcmHelper; use cumulus_primitives_core::ParaId as Pid; @@ -32,7 +37,6 @@ use frame_support::{ sp_runtime::{DispatchError, DispatchResult, SaturatedConversion}, traits::{ConstU128, ConstU64, EnsureOrigin, Everything, Get, LockIdentifier, Nothing}, weights::Weight, - PalletId, }; use frame_system::{EnsureRoot, EnsureSignedBy, RawOrigin}; use orml_traits::{location::RelativeReserveProvider, parameter_type_with_key, MultiCurrency}; @@ -80,9 +84,9 @@ construct_runtime!( ); parameter_types! { - pub const NativeCurrencyId: CurrencyId = CurrencyId::Native(TokenSymbol::ASG); - pub const RelayCurrencyId: CurrencyId = CurrencyId::Token(TokenSymbol::KSM); - pub const StableCurrencyId: CurrencyId = CurrencyId::Stable(TokenSymbol::KUSD); + pub const NativeCurrencyId: CurrencyId = ASG; + pub const RelayCurrencyId: CurrencyId = KSM; + pub const StableCurrencyId: CurrencyId = KUSD; } parameter_types! { @@ -177,7 +181,6 @@ impl bifrost_currencies::Config for Test { } parameter_types! { - pub const ZenlinkPalletId: PalletId = PalletId(*b"/zenlink"); pub const GetExchangeFee: (u32, u32) = (3, 1000); // 0.3% pub const SelfParaId: u32 = 2001; } @@ -268,7 +271,6 @@ pub const TREASURY_ACCOUNT: AccountId = AccountId::new([9u8; 32]); parameter_types! { pub const MinContribution: Balance = 10; - pub const BifrostCrowdloanId: PalletId = PalletId(*b"bf/salp#"); pub const RemoveKeysLimit: u32 = 50; pub const SlotLength: BlockNumber = 8u32 as BlockNumber; pub const LeasePeriod: BlockNumber = 6 * WEEKS; @@ -281,7 +283,6 @@ parameter_types! { CATHI ],2); pub const TreasuryAccount: AccountId = TREASURY_ACCOUNT; - pub const BuybackPalletId: PalletId = PalletId(*b"bf/salpc"); pub const BatchLimit: u32 = 50; } @@ -330,9 +331,6 @@ impl bifrost_stable_asset::traits::ValidateAssetId for EnsurePoolAss true } } -parameter_types! { - pub const StableAssetPalletId: PalletId = PalletId(*b"nuts/sta"); -} impl bifrost_stable_asset::Config for Test { type RuntimeEvent = RuntimeEvent; @@ -364,9 +362,6 @@ impl bifrost_stable_pool::Config for Test { parameter_types! { pub const MaximumUnlockIdOfUser: u32 = 1_000; pub const MaximumUnlockIdOfTimeUnit: u32 = 1_000; - pub BifrostEntranceAccount: PalletId = PalletId(*b"bf/vtkin"); - pub BifrostExitAccount: PalletId = PalletId(*b"bf/vtout"); - pub IncentivePoolAccount: PalletId = PalletId(*b"bf/inpoo"); } pub struct SlpxInterface; @@ -576,8 +571,8 @@ pub(crate) fn new_test_ext() -> sp_io::TestExternalities { let currency = vec![ (Native(BNC), DOLLARS / 100, None), - (Stable(KUSD), DOLLARS / 10_000, None), - (Token(KSM), DOLLARS / 10_000, None), + (Stable(TokenSymbol::KUSD), DOLLARS / 10_000, None), + (Token(TokenSymbol::KSM), DOLLARS / 10_000, None), (Token(ZLK), DOLLARS / 1000_000, None), (Token(KAR), DOLLARS / 10_000, None), (Token(RMRK), DOLLARS / 1000_000, None), @@ -585,7 +580,7 @@ pub(crate) fn new_test_ext() -> sp_io::TestExternalities { (Token(MOVR), DOLLARS / 1000_000, None), (Token(DOT), DOLLARS / 1000_000, None), ]; - let vcurrency = vec![Native(BNC), Token(KSM), Token(MOVR)]; + let vcurrency = vec![Native(BNC), Token(TokenSymbol::KSM), Token(MOVR)]; let vsbond = vec![]; bifrost_asset_registry::GenesisConfig:: { currency, diff --git a/pallets/salp/src/tests.rs b/pallets/salp/src/tests.rs index 40b486f12..b30fb0d16 100644 --- a/pallets/salp/src/tests.rs +++ b/pallets/salp/src/tests.rs @@ -19,7 +19,9 @@ // Ensure we're `no_std` when compiling for Wasm. use crate::{mock::*, Error, FundStatus, *}; -use bifrost_primitives::{CurrencyId, TokenSymbol, TryConvertFrom, KSM, VKSM, VSKSM}; +use bifrost_primitives::{ + BuybackPalletId, CurrencyId, TokenSymbol, TryConvertFrom, KSM, VKSM, VSKSM, +}; use bifrost_xcm_interface::SalpHelper; use frame_support::{assert_noop, assert_ok}; use frame_system::pallet_prelude::BlockNumberFor; diff --git a/pallets/slp-v2/src/mock.rs b/pallets/slp-v2/src/mock.rs index 8104a81e8..c4f8990eb 100644 --- a/pallets/slp-v2/src/mock.rs +++ b/pallets/slp-v2/src/mock.rs @@ -19,19 +19,18 @@ use crate as slp_v2; use bifrost_asset_registry::AssetIdMaps; use bifrost_primitives::{ - Amount, Balance, BlockNumber, CurrencyId, MockXcmRouter, MockXcmTransfer, SlpOperator, - SlpxOperator, BNC, DOT, + currency::DOT, Amount, Balance, BifrostEntranceAccount, BifrostExitAccount, BifrostFeeAccount, + BlockNumber, CommissionPalletId, CurrencyId, IncentivePoolAccount, MockXcmRouter, + MockXcmTransfer, SlpOperator, SlpxOperator, BNC, }; use frame_support::{ derive_impl, pallet_prelude::{ConstU32, Get}, parameter_types, traits::{Everything, Nothing}, - PalletId, }; use frame_system as system; use frame_system::EnsureRoot; -use hex_literal::hex; use pallet_xcm::EnsureResponse; use polkadot_parachain_primitives::primitives::Id as ParaId; use sp_core::{crypto::AccountId32, ConstU64}; @@ -142,7 +141,6 @@ parameter_types! { pub UnitWeightCost: Weight = Weight::from_parts(200_000_000, 0); pub const MaxInstructions: u32 = 100; pub UniversalLocation: InteriorLocation = Parachain(2030).into(); - pub CommissionPalletId: PalletId = PalletId(*b"bf/comms"); } pub struct XcmConfig; @@ -215,11 +213,7 @@ impl Get for ParachainId { parameter_types! { pub const MaximumUnlockIdOfUser: u32 = 10; pub const MaximumUnlockIdOfTimeUnit: u32 = 50; - pub BifrostEntranceAccount: PalletId = PalletId(*b"bf/vtkin"); - pub BifrostExitAccount: PalletId = PalletId(*b"bf/vtout"); - pub BifrostFeeAccount: AccountId = hex!["e4da05f08e89bf6c43260d96f26fffcfc7deae5b465da08669a9d008e64c2c63"].into(); pub const RelayCurrencyId: CurrencyId = DOT; - pub IncentivePoolAccount: PalletId = PalletId(*b"bf/inpoo"); } pub struct SlpxInterface; diff --git a/pallets/slp-v2/src/tests.rs b/pallets/slp-v2/src/tests.rs index d2649ecf2..2140d2364 100644 --- a/pallets/slp-v2/src/tests.rs +++ b/pallets/slp-v2/src/tests.rs @@ -31,7 +31,7 @@ use crate::{ LedgerByStakingProtocolAndDelegator, NextDelegatorIndexByStakingProtocol, ValidatorsByStakingProtocolAndDelegator, }; -use bifrost_primitives::{TimeUnit, VtokenMintingOperator, VASTR}; +use bifrost_primitives::{CommissionPalletId, TimeUnit, VtokenMintingOperator, VASTR}; use cumulus_primitives_core::Weight; use frame_support::{assert_noop, assert_ok, traits::fungibles::Mutate}; use orml_traits::MultiCurrency; diff --git a/pallets/slp/src/mocks/mock.rs b/pallets/slp/src/mocks/mock.rs index a5f893b27..4495ad6be 100644 --- a/pallets/slp/src/mocks/mock.rs +++ b/pallets/slp/src/mocks/mock.rs @@ -25,7 +25,9 @@ use crate::{Config, DispatchResult, QueryResponseManager, XcmDestWeightAndFeeHan use bifrost_asset_registry::AssetIdMaps; use bifrost_primitives::{ currency::{BNC, KSM}, - Amount, Balance, CurrencyId, MoonbeamChainId, SlpxOperator, TokenSymbol, XcmOperationType, + Amount, Balance, BifrostEntranceAccount, BifrostExitAccount, BifrostFeeAccount, CurrencyId, + IncentivePoolAccount, MoonbeamChainId, ParachainStakingPalletId, SlpxOperator, TokenSymbol, + XcmOperationType, }; pub use cumulus_primitives_core::ParaId; use frame_support::{ @@ -36,7 +38,6 @@ use frame_support::{ PalletId, }; use frame_system::{EnsureRoot, EnsureSignedBy}; -use hex_literal::hex; use orml_traits::{location::RelativeReserveProvider, parameter_type_with_key}; use parity_scale_codec::{Decode, Encode}; use sp_core::{bounded::BoundedVec, hashing::blake2_256, ConstU32}; @@ -185,10 +186,6 @@ impl orml_xtokens::Config for Runtime { parameter_types! { pub const MaximumUnlockIdOfUser: u32 = 10; pub const MaximumUnlockIdOfTimeUnit: u32 = 50; - pub BifrostEntranceAccount: PalletId = PalletId(*b"bf/vtkin"); - pub BifrostExitAccount: PalletId = PalletId(*b"bf/vtout"); - pub BifrostFeeAccount: AccountId = hex!["e4da05f08e89bf6c43260d96f26fffcfc7deae5b465da08669a9d008e64c2c63"].into(); - pub IncentivePoolAccount: PalletId = PalletId(*b"bf/inpoo"); } impl bifrost_vtoken_minting::Config for Runtime { @@ -237,7 +234,6 @@ parameter_types! { pub const MinDelegation: u128 = 3; pub AllowInflation: bool = true; pub PaymentInRound: u128 = 10; - pub const ParachainStakingPalletId: PalletId = PalletId(*b"bf/stake"); pub ToMigrateInvulnables: Vec = vec![AccountId32::new([1u8; 32])]; pub InitSeedStk: u128 = 10; } diff --git a/pallets/slp/src/mocks/mock_kusama.rs b/pallets/slp/src/mocks/mock_kusama.rs index 6aeafbf7c..adb01aa24 100644 --- a/pallets/slp/src/mocks/mock_kusama.rs +++ b/pallets/slp/src/mocks/mock_kusama.rs @@ -25,8 +25,10 @@ use crate::{Config, DispatchResult, QueryResponseManager}; use bifrost_asset_registry::AssetIdMaps; use bifrost_primitives::{ currency::{BNC, KSM, MANTA}, - Amount, Balance, CurrencyId, MockXcmExecutor, MockXcmRouter, MoonbeamChainId, SlpxOperator, - TokenSymbol, XcmDestWeightAndFeeHandler, XcmOperationType, + Amount, Balance, BifrostEntranceAccount, BifrostExitAccount, BifrostFeeAccount, CurrencyId, + IncentivePoolAccount, MockXcmExecutor, MockXcmRouter, MoonbeamChainId, + ParachainStakingPalletId, SlpxOperator, StableAssetPalletId, TokenSymbol, + XcmDestWeightAndFeeHandler, XcmOperationType, }; pub use cumulus_primitives_core::ParaId; use frame_support::{ @@ -93,9 +95,6 @@ impl bifrost_stable_asset::traits::ValidateAssetId for EnsurePoolAss true } } -parameter_types! { - pub const StableAssetPalletId: PalletId = PalletId(*b"nuts/sta"); -} impl bifrost_stable_asset::Config for Runtime { type RuntimeEvent = RuntimeEvent; @@ -236,10 +235,6 @@ impl orml_xtokens::Config for Runtime { parameter_types! { pub const MaximumUnlockIdOfUser: u32 = 10; pub const MaximumUnlockIdOfTimeUnit: u32 = 50; - pub BifrostEntranceAccount: PalletId = PalletId(*b"bf/vtkin"); - pub BifrostExitAccount: PalletId = PalletId(*b"bf/vtout"); - pub BifrostFeeAccount: AccountId = hex!["e4da05f08e89bf6c43260d96f26fffcfc7deae5b465da08669a9d008e64c2c63"].into(); - pub IncentivePoolAccount: PalletId = PalletId(*b"bf/inpoo"); } pub struct SlpxInterface; @@ -295,7 +290,6 @@ parameter_types! { pub const MinDelegation: u128 = 3; pub AllowInflation: bool = true; pub PaymentInRound: u128 = 10; - pub const ParachainStakingPalletId: PalletId = PalletId(*b"bf/stake"); pub ToMigrateInvulnables: Vec = vec![AccountId32::new([1u8; 32])]; pub InitSeedStk: u128 = 10; } diff --git a/pallets/slpx/src/mock.rs b/pallets/slpx/src/mock.rs index ea6eaf1e8..13e32baf7 100644 --- a/pallets/slpx/src/mock.rs +++ b/pallets/slpx/src/mock.rs @@ -19,9 +19,12 @@ use crate as slpx; use bifrost_asset_registry::AssetIdMaps; -use bifrost_primitives::MoonbeamChainId; +use bifrost_primitives::{ + BifrostEntranceAccount, BifrostExitAccount, BifrostFeeAccount, IncentivePoolAccount, + MoonbeamChainId, StableAssetPalletId, ZenlinkPalletId, +}; pub use bifrost_primitives::{ - CurrencyId, CurrencyIdMapping, MockXcmExecutor, SlpxOperator, TokenSymbol, BNC, KSM, + CurrencyId, CurrencyIdMapping, MockXcmExecutor, SlpxOperator, BNC, KSM, }; use bifrost_slp::{QueryId, QueryResponseManager}; use cumulus_primitives_core::ParaId; @@ -30,10 +33,8 @@ use frame_support::{ pallet_prelude::*, parameter_types, traits::{Everything, Nothing}, - PalletId, }; use frame_system::{EnsureRoot, EnsureSignedBy}; -use hex_literal::hex; use orml_traits::{ location::RelativeReserveProvider, parameter_type_with_key, xcm_transfer::Transferred, MultiCurrency, XcmTransfer, @@ -119,7 +120,7 @@ impl pallet_balances::Config for Test { } parameter_types! { - pub const GetNativeCurrencyId: CurrencyId = CurrencyId::Native(TokenSymbol::BNC); + pub const GetNativeCurrencyId: CurrencyId = BNC; } pub type AdaptedBasicCurrency = @@ -161,11 +162,7 @@ impl orml_tokens::Config for Test { parameter_types! { pub const MaximumUnlockIdOfUser: u32 = 10; pub const MaximumUnlockIdOfTimeUnit: u32 = 50; - pub BifrostEntranceAccount: PalletId = PalletId(*b"bf/vtkin"); - pub BifrostExitAccount: PalletId = PalletId(*b"bf/vtout"); - pub BifrostFeeAccount: AccountId = hex!["e4da05f08e89bf6c43260d96f26fffcfc7deae5b465da08669a9d008e64c2c63"].into(); pub const RelayCurrencyId: CurrencyId = KSM; - pub IncentivePoolAccount: PalletId = PalletId(*b"bf/inpoo"); } ord_parameter_types! { @@ -266,7 +263,6 @@ where type MultiAssets = ZenlinkMultiAssets>; parameter_types! { - pub const ZenlinkPalletId: PalletId = PalletId(*b"/zenlink"); pub const GetExchangeFee: (u32, u32) = (3, 1000); // 0.3% pub const SelfParaId: u32 = 2001; } @@ -476,9 +472,6 @@ impl bifrost_stable_asset::traits::ValidateAssetId for EnsurePoolAss true } } -parameter_types! { - pub const StableAssetPalletId: PalletId = PalletId(*b"nuts/sta"); -} impl bifrost_stable_asset::Config for Test { type RuntimeEvent = RuntimeEvent; @@ -509,7 +502,7 @@ impl bifrost_stable_pool::Config for Test { // Pallet slpx configuration parameter_types! { - pub const NativeCurrencyId: CurrencyId = CurrencyId::Native(TokenSymbol::BNC); + pub const NativeCurrencyId: CurrencyId = BNC; } pub struct XTokensMock; diff --git a/pallets/stable-asset/src/mock.rs b/pallets/stable-asset/src/mock.rs index ef1811eff..da1c64a1b 100644 --- a/pallets/stable-asset/src/mock.rs +++ b/pallets/stable-asset/src/mock.rs @@ -17,12 +17,12 @@ // along with this program. If not, see . use crate as stable_asset; +use bifrost_primitives::StableAssetPalletId; use frame_support::{ derive_impl, dispatch::DispatchResult, parameter_types, traits::{ConstU128, ConstU32, Currency, EnsureOrigin, Nothing, OnUnbalanced}, - PalletId, }; use frame_system::RawOrigin; use orml_traits::MultiCurrency; @@ -266,10 +266,6 @@ impl crate::traits::ValidateAssetId for EnsurePoolAssetId { } } -parameter_types! { - pub const StableAssetPalletId: PalletId = PalletId(*b"nuts/sta"); -} - impl stable_asset::Config for Test { type RuntimeEvent = RuntimeEvent; type AssetId = i64; diff --git a/pallets/stable-pool/src/mock.rs b/pallets/stable-pool/src/mock.rs index d63321de7..5dd4d6798 100644 --- a/pallets/stable-pool/src/mock.rs +++ b/pallets/stable-pool/src/mock.rs @@ -17,17 +17,19 @@ // along with this program. If not, see . use crate as bifrost_stable_pool; use bifrost_asset_registry::AssetIdMaps; -use bifrost_primitives::MoonbeamChainId; pub use bifrost_primitives::{ currency::{MOVR, VMOVR}, Balance, CurrencyId, CurrencyIdMapping, SlpOperator, SlpxOperator, TokenSymbol, ASTR, BNC, DOT, GLMR, VBNC, VDOT, }; +use bifrost_primitives::{ + BifrostEntranceAccount, BifrostExitAccount, IncentivePoolAccount, MoonbeamChainId, + StableAssetPalletId, KSM, KUSD, +}; use bifrost_runtime_common::milli; use frame_support::{ derive_impl, ord_parameter_types, parameter_types, traits::{ConstU128, ConstU32, Everything, Nothing}, - PalletId, }; use frame_system::{EnsureRoot, EnsureSignedBy}; use orml_traits::{location::RelativeReserveProvider, parameter_type_with_key}; @@ -63,7 +65,7 @@ impl frame_system::Config for Test { } parameter_types! { - pub const NativeCurrencyId: CurrencyId = CurrencyId::Native(TokenSymbol::BNC); + pub const NativeCurrencyId: CurrencyId = BNC; } orml_traits::parameter_type_with_key! { @@ -187,11 +189,8 @@ impl orml_xtokens::Config for Test { parameter_types! { pub const ExistentialDeposit: Balance = 1; - // pub const NativeCurrencyId: CurrencyId = CurrencyId::Native(TokenSymbol::BNC); - // pub const RelayCurrencyId: CurrencyId = CurrencyId::Token(TokenSymbol::KSM); - pub const StableCurrencyId: CurrencyId = CurrencyId::Stable(TokenSymbol::KUSD); - // pub SelfParaId: u32 = ParachainInfo::parachain_id().into(); - pub const PolkadotCurrencyId: CurrencyId = CurrencyId::Token(TokenSymbol::DOT); + pub const StableCurrencyId: CurrencyId = KUSD; + pub const PolkadotCurrencyId: CurrencyId = DOT; } impl pallet_balances::Config for Test { @@ -226,9 +225,6 @@ impl bifrost_stable_asset::traits::ValidateAssetId for EnsurePoolAss true } } -parameter_types! { - pub const StableAssetPalletId: PalletId = PalletId(*b"nuts/sta"); -} impl bifrost_stable_asset::Config for Test { type RuntimeEvent = RuntimeEvent; @@ -260,9 +256,6 @@ impl bifrost_stable_pool::Config for Test { parameter_types! { pub const MaximumUnlockIdOfUser: u32 = 1_000; pub const MaximumUnlockIdOfTimeUnit: u32 = 1_000; - pub BifrostEntranceAccount: PalletId = PalletId(*b"bf/vtkin"); - pub BifrostExitAccount: PalletId = PalletId(*b"bf/vtout"); - pub IncentivePoolAccount: PalletId = PalletId(*b"bf/inpoo"); } pub struct SlpxInterface; @@ -273,7 +266,7 @@ impl SlpxOperator for SlpxInterface { } ord_parameter_types! { - pub const RelayCurrencyId: CurrencyId = CurrencyId::Token(TokenSymbol::KSM); + pub const RelayCurrencyId: CurrencyId = KSM; } impl bifrost_vtoken_minting::Config for Test { diff --git a/pallets/stable-pool/src/tests.rs b/pallets/stable-pool/src/tests.rs index 807f32fde..a6277a30a 100644 --- a/pallets/stable-pool/src/tests.rs +++ b/pallets/stable-pool/src/tests.rs @@ -16,7 +16,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . use crate::{mock::*, AssetIdOf, AtLeast64BitUnsignedOf, Error}; -use bifrost_primitives::VtokenMintingOperator; +use bifrost_primitives::{StableAssetPalletId, VtokenMintingOperator}; use bifrost_stable_asset::{PoolCount, Pools, StableAssetPoolInfo}; use frame_support::{assert_noop, assert_ok, BoundedVec}; use orml_traits::MultiCurrency; diff --git a/pallets/system-staking/src/mock.rs b/pallets/system-staking/src/mock.rs index a450972d1..a50e2f26a 100644 --- a/pallets/system-staking/src/mock.rs +++ b/pallets/system-staking/src/mock.rs @@ -19,8 +19,12 @@ #![allow(non_upper_case_globals)] use bifrost_asset_registry::AssetIdMaps; -use bifrost_primitives::MoonbeamChainId; -pub use bifrost_primitives::{currency::*, CurrencyId, SlpxOperator, TokenSymbol}; +pub use bifrost_primitives::{currency::*, CurrencyId, SlpxOperator}; +use bifrost_primitives::{ + BifrostEntranceAccount, BifrostExitAccount, BifrostFeeAccount, FarmingBoostPalletId, + FarmingGaugeRewardIssuerPalletId, FarmingKeeperPalletId, FarmingRewardIssuerPalletId, + IncentivePoolAccount, MoonbeamChainId, SystemStakingPalletId, +}; use bifrost_slp::{QueryId, QueryResponseManager}; pub use cumulus_primitives_core::ParaId; use cumulus_primitives_core::*; @@ -29,10 +33,8 @@ use frame_support::{ pallet_prelude::Get, parameter_types, traits::{Everything, Nothing, OnFinalize, OnInitialize}, - PalletId, }; use frame_system::{EnsureRoot, EnsureSignedBy}; -use hex_literal::hex; use orml_traits::{location::RelativeReserveProvider, parameter_type_with_key}; use sp_core::ConstU32; use sp_runtime::{ @@ -87,7 +89,7 @@ impl frame_system::Config for Runtime { } parameter_types! { - pub const GetNativeCurrencyId: CurrencyId = CurrencyId::Native(TokenSymbol::ASG); + pub const GetNativeCurrencyId: CurrencyId = ASG; } pub type AdaptedBasicCurrency = @@ -173,11 +175,7 @@ impl orml_xtokens::Config for Runtime { parameter_types! { pub const MaximumUnlockIdOfUser: u32 = 10; pub const MaximumUnlockIdOfTimeUnit: u32 = 50; - pub BifrostEntranceAccount: PalletId = PalletId(*b"bf/vtkin"); - pub BifrostExitAccount: PalletId = PalletId(*b"bf/vtout"); - pub BifrostFeeAccount: AccountId = hex!["e4da05f08e89bf6c43260d96f26fffcfc7deae5b465da08669a9d008e64c2c63"].into(); pub const RelayCurrencyId: CurrencyId = KSM; - pub IncentivePoolAccount: PalletId = PalletId(*b"bf/inpoo"); } impl bifrost_vtoken_minting::Config for Runtime { @@ -277,11 +275,7 @@ impl bifrost_slp::Config for Runtime { } parameter_types! { - pub const FarmingKeeperPalletId: PalletId = PalletId(*b"bf/fmkpr"); - pub const FarmingRewardIssuerPalletId: PalletId = PalletId(*b"bf/fmrir"); - pub const FarmingBoostPalletId: PalletId = PalletId(*b"bf/fmbst"); pub const WhitelistMaximumLimit: u32 = 10; - pub const FarmingGaugeRewardIssuerPalletId: PalletId = PalletId(*b"bf/fmgar"); } ord_parameter_types! { @@ -309,7 +303,6 @@ parameter_types! { pub const BlocksPerRound: u32 = 5; pub const MaxTokenLen: u32 = 50; pub const MaxFarmingPoolIdLen: u32 = 100; - pub const SystemStakingPalletId: PalletId = PalletId(*b"bf/sysst"); } impl system_staking::Config for Runtime { diff --git a/pallets/token-issuer/src/mock.rs b/pallets/token-issuer/src/mock.rs index b110b7b22..4764c9e60 100644 --- a/pallets/token-issuer/src/mock.rs +++ b/pallets/token-issuer/src/mock.rs @@ -22,7 +22,7 @@ use crate::Weight; use bifrost_primitives::{ currency::{BNC, DOT, KSM, VDOT}, - CurrencyId, TokenSymbol, + CurrencyId, ASG, }; use frame_support::{derive_impl, parameter_types, traits::Nothing, PalletId}; use frame_system::EnsureRoot; @@ -70,7 +70,7 @@ impl frame_system::Config for Runtime { } parameter_types! { - pub const GetNativeCurrencyId: CurrencyId = CurrencyId::Native(TokenSymbol::ASG); + pub const GetNativeCurrencyId: CurrencyId = ASG; } pub type AdaptedBasicCurrency = diff --git a/pallets/vbnc-convert/src/mock.rs b/pallets/vbnc-convert/src/mock.rs index ce3b49e9f..88d8cc86e 100644 --- a/pallets/vbnc-convert/src/mock.rs +++ b/pallets/vbnc-convert/src/mock.rs @@ -24,9 +24,9 @@ use bifrost_asset_registry::AssetIdMaps; use bifrost_primitives::{ currency::{BNC, KSM, VBNC, VBNC_P, VKSM}, - CurrencyId, CurrencyIdMapping, TokenSymbol, + CurrencyId, CurrencyIdMapping, VBNCConvertPalletId, }; -use frame_support::{ord_parameter_types, parameter_types, traits::Nothing, PalletId}; +use frame_support::{ord_parameter_types, parameter_types, traits::Nothing}; use frame_system::EnsureSignedBy; use sp_core::H256; use sp_runtime::{ @@ -94,7 +94,7 @@ impl frame_system::Config for Runtime { } parameter_types! { - pub const NativeCurrencyId: CurrencyId = CurrencyId::Native(TokenSymbol::BNC); + pub const NativeCurrencyId: CurrencyId = BNC; } pub type AdaptedBasicCurrency = @@ -165,10 +165,6 @@ impl bifrost_asset_registry::Config for Runtime { type WeightInfo = (); } -parameter_types! { - pub const VBNCConvertPalletId: PalletId = PalletId(*b"bf/vbncc"); -} - impl bifrost_vbnc_convert::Config for Runtime { type RuntimeEvent = RuntimeEvent; type MultiCurrency = Currencies; diff --git a/pallets/vsbond-auction/src/mock.rs b/pallets/vsbond-auction/src/mock.rs index 2e4c9088e..a7ade8803 100644 --- a/pallets/vsbond-auction/src/mock.rs +++ b/pallets/vsbond-auction/src/mock.rs @@ -16,7 +16,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -use bifrost_primitives::{Amount, Balance, CurrencyId, TokenSymbol}; +use bifrost_primitives::{Amount, Balance, CurrencyId, TokenSymbol, VsbondAuctionPalletId, KSM}; #[cfg(feature = "runtime-benchmarks")] use frame_benchmarking::{account, whitelisted_caller}; use frame_support::{ @@ -111,10 +111,9 @@ impl orml_tokens::Config for Test { } parameter_types! { - pub const InvoicingCurrency: CurrencyId = CurrencyId::Token(TokenSymbol::KSM); + pub const InvoicingCurrency: CurrencyId = KSM; pub const MaximumOrderInTrade: u32 = 5; pub const MinimumSupply: Balance = 0; - pub const VsbondAuctionPalletId: PalletId = PalletId(*b"bf/vsbnd"); pub BifrostTreasuryAccount: AccountId = PalletId(*b"bf/trsry").into_account_truncating(); } diff --git a/pallets/vstoken-conversion/src/mock.rs b/pallets/vstoken-conversion/src/mock.rs index 0e9fa07d8..46e56b292 100644 --- a/pallets/vstoken-conversion/src/mock.rs +++ b/pallets/vstoken-conversion/src/mock.rs @@ -21,8 +21,12 @@ #![cfg(test)] #![allow(non_upper_case_globals)] -pub use bifrost_primitives::{currency::*, CurrencyId, TokenSymbol}; -use frame_support::{derive_impl, ord_parameter_types, parameter_types, traits::Nothing, PalletId}; +pub use bifrost_primitives::{currency::*, CurrencyId}; +use bifrost_primitives::{ + currency::{ASG, KSM}, + BifrostVsbondAccount, +}; +use frame_support::{derive_impl, ord_parameter_types, parameter_types, traits::Nothing}; use frame_system::EnsureSignedBy; use sp_core::ConstU32; use sp_runtime::{traits::IdentityLookup, AccountId32, BuildStorage}; @@ -66,7 +70,7 @@ impl frame_system::Config for Runtime { } parameter_types! { - pub const GetNativeCurrencyId: CurrencyId = CurrencyId::Native(TokenSymbol::ASG); + pub const GetNativeCurrencyId: CurrencyId = ASG; } pub type AdaptedBasicCurrency = @@ -120,13 +124,11 @@ impl orml_tokens::Config for Runtime { parameter_types! { pub const TreasuryAccount: AccountId32 = TREASURY_ACCOUNT; - pub BifrostVsbondAccount: PalletId = PalletId(*b"bf/salpb"); } ord_parameter_types! { pub const One: AccountId = ALICE; - // pub const RelayCurrencyId: CurrencyId = CurrencyId::Token2(DOT_TOKEN_ID); - pub const RelayCurrencyId: CurrencyId = CurrencyId::Token(TokenSymbol::KSM); + pub const RelayCurrencyId: CurrencyId = KSM; } impl bifrost_vstoken_conversion::Config for Runtime { diff --git a/pallets/vstoken-conversion/src/tests.rs b/pallets/vstoken-conversion/src/tests.rs index d997229fd..c1eb850ad 100644 --- a/pallets/vstoken-conversion/src/tests.rs +++ b/pallets/vstoken-conversion/src/tests.rs @@ -20,6 +20,7 @@ #![cfg(test)] +use bifrost_primitives::currency::KSM; use frame_support::{assert_noop, assert_ok}; pub use primitives::{VstokenConversionExchangeFee, VstokenConversionExchangeRate}; use sp_arithmetic::per_things::Percent; diff --git a/pallets/vtoken-minting/src/mock.rs b/pallets/vtoken-minting/src/mock.rs index f04aa0e80..3a7bb38ad 100644 --- a/pallets/vtoken-minting/src/mock.rs +++ b/pallets/vtoken-minting/src/mock.rs @@ -25,7 +25,8 @@ use bb_bnc::{BbBNCInterface, Point}; use bifrost_asset_registry::AssetIdMaps; use bifrost_primitives::{ currency::{BNC, DOT, FIL, KSM, MOVR, VBNC, VFIL, VKSM, VMOVR}, - CurrencyId, CurrencyIdMapping, MoonbeamChainId, SlpxOperator, TokenSymbol, + BifrostEntranceAccount, BifrostExitAccount, BifrostFeeAccount, CurrencyId, CurrencyIdMapping, + IncentivePoolAccount, MoonbeamChainId, SlpxOperator, KUSD, }; use bifrost_runtime_common::{micro, milli}; use bifrost_slp::{QueryId, QueryResponseManager}; @@ -35,10 +36,8 @@ use frame_support::{ pallet_prelude::Get, parameter_types, traits::{Everything, Nothing}, - PalletId, }; use frame_system::{EnsureRoot, EnsureSignedBy}; -use hex_literal::hex; use orml_traits::{location::RelativeReserveProvider, parameter_type_with_key}; use sp_runtime::{ traits::{ConstU32, IdentityLookup}, @@ -89,7 +88,7 @@ impl frame_system::Config for Runtime { } parameter_types! { - pub const NativeCurrencyId: CurrencyId = CurrencyId::Native(TokenSymbol::BNC); + pub const NativeCurrencyId: CurrencyId = BNC; } pub type AdaptedBasicCurrency = @@ -104,11 +103,8 @@ impl bifrost_currencies::Config for Runtime { parameter_types! { pub const ExistentialDeposit: Balance = 1; - // pub const NativeCurrencyId: CurrencyId = CurrencyId::Native(TokenSymbol::BNC); - // pub const RelayCurrencyId: CurrencyId = CurrencyId::Token(TokenSymbol::KSM); - pub const StableCurrencyId: CurrencyId = CurrencyId::Stable(TokenSymbol::KUSD); - // pub SelfParaId: u32 = ParachainInfo::parachain_id().into(); - pub const PolkadotCurrencyId: CurrencyId = CurrencyId::Token(TokenSymbol::DOT); + pub const StableCurrencyId: CurrencyId = KUSD; + pub const PolkadotCurrencyId: CurrencyId = DOT; } impl pallet_balances::Config for Runtime { @@ -197,15 +193,11 @@ parameter_types! { pub const MaximumUnlockIdOfUser: u32 = 1_000; pub const MaximumUnlockIdOfTimeUnit: u32 = 1_000; pub const MaxLockRecords: u32 = 64; - pub BifrostEntranceAccount: PalletId = PalletId(*b"bf/vtkin"); - pub BifrostExitAccount: PalletId = PalletId(*b"bf/vtout"); - pub IncentivePoolAccount: PalletId = PalletId(*b"bf/inpoo"); - pub BifrostFeeAccount: AccountId = hex!["e4da05f08e89bf6c43260d96f26fffcfc7deae5b465da08669a9d008e64c2c63"].into(); } ord_parameter_types! { pub const One: AccountId = ALICE; - pub const RelayCurrencyId: CurrencyId = CurrencyId::Token(TokenSymbol::KSM); + pub const RelayCurrencyId: CurrencyId = KSM; } impl vtoken_minting::Config for Runtime { diff --git a/pallets/vtoken-voting/src/mock.rs b/pallets/vtoken-voting/src/mock.rs index a9bada263..16a6adfc6 100644 --- a/pallets/vtoken-voting/src/mock.rs +++ b/pallets/vtoken-voting/src/mock.rs @@ -23,7 +23,7 @@ use crate::{BalanceOf, DerivativeAccountHandler, DerivativeIndex, DispatchResult use bifrost_primitives::{ currency::{KSM, VBNC, VKSM}, traits::XcmDestWeightAndFeeHandler, - CurrencyId, MockXcmRouter, TokenSymbol, VTokenSupplyProvider, XcmOperationType, + CurrencyId, MockXcmRouter, VTokenSupplyProvider, XcmOperationType, BNC, }; use cumulus_primitives_core::ParaId; use frame_support::{ @@ -80,7 +80,7 @@ impl frame_system::Config for Runtime { } parameter_types! { - pub const NativeCurrencyId: CurrencyId = CurrencyId::Native(TokenSymbol::BNC); + pub const NativeCurrencyId: CurrencyId = BNC; } pub type AdaptedBasicCurrency = diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index c7081880c..93e60be9f 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -11,6 +11,7 @@ scale-info = { workspace = true, features = ["derive"] } serde = { workspace = true, features = ["derive"] } frame-support = { workspace = true } +hex-literal = { workspace = true } sp-core = { workspace = true } sp-runtime = { workspace = true } sp-std = { workspace = true } diff --git a/primitives/src/currency.rs b/primitives/src/currency.rs index 3709c2598..e6d1e67f4 100644 --- a/primitives/src/currency.rs +++ b/primitives/src/currency.rs @@ -44,6 +44,8 @@ pub const VSKSM: CurrencyId = CurrencyId::VSToken(TokenSymbol::KSM); pub const PHA: CurrencyId = CurrencyId::Token(TokenSymbol::PHA); pub const VPHA: CurrencyId = CurrencyId::VToken(TokenSymbol::PHA); pub const ZLK: CurrencyId = CurrencyId::Token(TokenSymbol::ZLK); +pub const KUSD: CurrencyId = CurrencyId::Stable(TokenSymbol::KUSD); +pub const ASG: CurrencyId = CurrencyId::Native(TokenSymbol::ASG); pub const DOT_TOKEN_ID: u8 = 0u8; pub const DOT: CurrencyId = CurrencyId::Token2(DOT_TOKEN_ID); diff --git a/primitives/src/lib.rs b/primitives/src/lib.rs index 0040e851d..b711cb02d 100644 --- a/primitives/src/lib.rs +++ b/primitives/src/lib.rs @@ -20,6 +20,8 @@ #![cfg_attr(not(feature = "std"), no_std)] +use frame_support::{parameter_types, PalletId}; +use hex_literal::hex; use parity_scale_codec::MaxEncodedLen; use scale_info::TypeInfo; use sp_core::{Decode, Encode, RuntimeDebug, H160}; @@ -156,6 +158,44 @@ pub type DerivativeIndex = u16; pub type TimeStampedPrice = orml_oracle::TimestampedValue; +// Pallet Id +parameter_types! { + pub const BifrostCrowdloanId: PalletId = PalletId(*b"bf/salp#"); + pub BifrostEntranceAccount: PalletId = PalletId(*b"bf/vtkin"); + pub BifrostExitAccount: PalletId = PalletId(*b"bf/vtout"); + pub BifrostVsbondAccount: PalletId = PalletId(*b"bf/salpb"); + pub const BuyBackAccount: PalletId = PalletId(*b"bf/bybck"); + pub const BuybackPalletId: PalletId = PalletId(*b"bf/salpc"); + pub const CloudsPalletId: PalletId = PalletId(*b"bf/cloud"); + pub const CommissionPalletId: PalletId = PalletId(*b"bf/comms"); + pub const FarmingBoostPalletId: PalletId = PalletId(*b"bf/fmbst"); + pub const FarmingGaugeRewardIssuerPalletId: PalletId = PalletId(*b"bf/fmgar"); + pub const FarmingKeeperPalletId: PalletId = PalletId(*b"bf/fmkpr"); + pub const FarmingRewardIssuerPalletId: PalletId = PalletId(*b"bf/fmrir"); + pub const FeeSharePalletId: PalletId = PalletId(*b"bf/feesh"); + pub const FlexibleFeePalletId: PalletId = PalletId(*b"bf/flexi"); + pub IncentivePoolAccount: PalletId = PalletId(*b"bf/inpoo"); + pub IncentivePalletId: PalletId = PalletId(*b"bf/bbict"); + pub const LendMarketPalletId: PalletId = PalletId(*b"bf/ldmkt"); + pub const LighteningRedeemPalletId: PalletId = PalletId(*b"lighten#"); + pub const LiquidityAccount: PalletId = PalletId(*b"bf/liqdt"); + pub const LiquidityMiningPalletId: PalletId = PalletId(*b"mining##"); + pub const ParachainStakingPalletId: PalletId = PalletId(*b"bf/stake"); + pub const SlpEntrancePalletId: PalletId = PalletId(*b"bf/vtkin"); + pub const StableAssetPalletId: PalletId = PalletId(*b"nuts/sta"); + pub const SystemMakerPalletId: PalletId = PalletId(*b"bf/sysmk"); + pub const SystemStakingPalletId: PalletId = PalletId(*b"bf/sysst"); + pub const VBNCConvertPalletId: PalletId = PalletId(*b"bf/vbncc"); + pub const VeMintingPalletId: PalletId = PalletId(*b"bf/vemnt"); + pub const VsbondAuctionPalletId: PalletId = PalletId(*b"bf/vsbnd"); + pub const ZenlinkPalletId: PalletId = PalletId(*b"/zenlink"); +} + +// Account Id +parameter_types! { + pub BifrostFeeAccount: AccountId = hex!["e4da05f08e89bf6c43260d96f26fffcfc7deae5b465da08669a9d008e64c2c63"].into(); +} + // For vtoken-minting #[derive( PartialEq, Eq, Clone, Encode, Decode, MaxEncodedLen, RuntimeDebug, scale_info::TypeInfo,