diff --git a/audits/halborn/audit20220808-pallets-democracy-currencyFactory-crowdloanRewards.pdf b/audits/halborn/audit20220808-pallets-democracy-currencyFactory-crowdloanRewards.pdf deleted file mode 100644 index f29e7f05f9b..00000000000 Binary files a/audits/halborn/audit20220808-pallets-democracy-currencyFactory-crowdloanRewards.pdf and /dev/null differ diff --git a/audits/halborn/audit20220919-pallet-democracy.pdf b/audits/halborn/audit20220919-pallet-democracy.pdf deleted file mode 100644 index b90760e770c..00000000000 Binary files a/audits/halborn/audit20220919-pallet-democracy.pdf and /dev/null differ diff --git a/audits/halborn/audit20221010-pallets-stakingRewards-fnft.pdf b/audits/halborn/audit20221010-pallets-stakingRewards-fnft.pdf deleted file mode 100644 index e66c17ffdf5..00000000000 Binary files a/audits/halborn/audit20221010-pallets-stakingRewards-fnft.pdf and /dev/null differ diff --git a/code/parachain/runtime/composable/src/assets.rs b/code/parachain/runtime/composable/src/assets.rs index 4563e55b7b1..f9150e4a43f 100644 --- a/code/parachain/runtime/composable/src/assets.rs +++ b/code/parachain/runtime/composable/src/assets.rs @@ -1 +1,74 @@ use super::*; + + +impl pallet_assets::Config for Runtime { + type NativeAssetId = NativeAssetId; + type AssetId = CurrencyId; + type Balance = Balance; + type NativeCurrency = Balances; + type MultiCurrency = Tokens; + type WeightInfo = (); + type AdminOrigin = EnsureRootOrHalfCouncil; + type CurrencyValidator = ValidateCurrencyId; + type RuntimeHoldReason = TemporalHoldIdentifier; +} + +pub struct CurrencyHooks; +impl orml_traits::currency::MutationHooks for CurrencyHooks { + type OnDust = orml_tokens::TransferDust; + type OnSlash = (); + type PreDeposit = (); + type PostDeposit = (); + type PreTransfer = (); + type PostTransfer = (); + type OnNewTokenAccount = (); + type OnKilledTokenAccount = (); +} + +type ReserveIdentifier = [u8; 8]; +impl orml_tokens::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type Balance = Balance; + type Amount = Amount; + type CurrencyId = CurrencyId; + type WeightInfo = weights::tokens::WeightInfo; + type ExistentialDeposits = MultiExistentialDeposits; + type MaxLocks = ConstU32<32>; + type ReserveIdentifier = ReserveIdentifier; + type MaxReserves = frame_support::traits::ConstU32<2>; + type DustRemovalWhitelist = DustRemovalWhitelist; + type CurrencyHooks = CurrencyHooks; +} + + +parameter_types! { + /// Minimum amount an account has to hold to stay in state. + // minimum account balance is given as 0.1 PICA ~ 100 CurrencyId::milli() + pub ExistentialDeposit: Balance = 100 * CurrencyId::milli::(); +} + +pub type BalanceIdentifier = [u8; 8]; + +/// until next upgrade when ORM will be upgraded +pub type TemporalHoldIdentifier = (); + + +impl balances::Config for Runtime { + type MaxLocks = ConstU32<64>; + type MaxReserves = (); + type ReserveIdentifier = BalanceIdentifier; + type Balance = Balance; + type RuntimeEvent = RuntimeEvent; + type DustRemoval = (); + type ExistentialDeposit = ExistentialDeposit; + type AccountStore = System; + type WeightInfo = weights::balances::SubstrateWeight; + + type HoldIdentifier = TemporalHoldIdentifier; + + type FreezeIdentifier = BalanceIdentifier; + + type MaxHolds = ConstU32<32>; + + type MaxFreezes = ConstU32<32>; +} \ No newline at end of file diff --git a/code/parachain/runtime/composable/src/lib.rs b/code/parachain/runtime/composable/src/lib.rs index 64ac0662460..b6c92fe5354 100644 --- a/code/parachain/runtime/composable/src/lib.rs +++ b/code/parachain/runtime/composable/src/lib.rs @@ -6,8 +6,7 @@ clippy::indexing_slicing, clippy::todo, clippy::unwrap_used, - // // impl_runtime_apis will generate code that contains a `panic!`. Implementations should still avoid using panics. - // clippy::panic + clippy::panic ) )] #![deny(clippy::unseparated_literal_suffix, clippy::disallowed_types, unused_imports)] @@ -32,6 +31,7 @@ mod prelude; pub mod version; mod weights; mod xcmp; +mod assets; use common::{ fees::multi_existential_deposits, governance::native::NativeTreasury, rewards::StakingPot, AccountId, AccountIndex, Address, Amount, AuraId, Balance, BlockNumber, Hash, Moment, @@ -56,6 +56,8 @@ use sp_std::prelude::*; use sp_version::RuntimeVersion; // A few exports that help ease life for downstream crates. use codec::Encode; + +pub use crate::assets::*; pub use frame_support::{ construct_runtime, pallet_prelude::*, @@ -212,15 +214,10 @@ impl assets_registry::Config for Runtime { type NetworkId = ComposableNetworkId; } -parameter_types! { - // Maximum authorities/collators for aura - pub const MaxAuthorities: u32 = 100; -} - impl aura::Config for Runtime { type AuthorityId = AuraId; type DisabledValidators = (); - type MaxAuthorities = MaxAuthorities; + type MaxAuthorities = ConstU32<100>; } impl cumulus_pallet_aura_ext::Config for Runtime {} @@ -256,41 +253,6 @@ impl timestamp::Config for Runtime { type WeightInfo = weights::timestamp::WeightInfo; } -parameter_types! { - /// Minimum amount an account has to hold to stay in state. - // minimum account balance is given as 0.1 PICA ~ 100 CurrencyId::milli() - pub ExistentialDeposit: Balance = 100 * CurrencyId::milli::(); - /// Max locks that can be placed on an account. Capped for storage - /// concerns. - pub const MaxLocks: u32 = 50; -} - -type BalanceIdentifier = [u8; 8]; - -/// until next upgrade when ORM will be upgraded -type TemporalHoldIdentifier = (); - - -impl balances::Config for Runtime { - type MaxLocks = MaxLocks; - type MaxReserves = (); - type ReserveIdentifier = BalanceIdentifier; - type Balance = Balance; - type RuntimeEvent = RuntimeEvent; - type DustRemoval = (); - type ExistentialDeposit = ExistentialDeposit; - type AccountStore = System; - type WeightInfo = weights::balances::SubstrateWeight; - - type HoldIdentifier = TemporalHoldIdentifier; - - type FreezeIdentifier = BalanceIdentifier; - - type MaxHolds = ConstU32<32>; - - type MaxFreezes = ConstU32<32>; -} - pub struct WeightToFee; impl WeightToFeePolynomial for WeightToFee { type Balance = Balance; @@ -486,17 +448,7 @@ impl collator_selection::Config for Runtime { type WeightInfo = weights::collator_selection::WeightInfo; } -impl pallet_assets::Config for Runtime { - type NativeAssetId = NativeAssetId; - type AssetId = CurrencyId; - type Balance = Balance; - type NativeCurrency = Balances; - type MultiCurrency = Tokens; - type WeightInfo = (); - type AdminOrigin = EnsureRootOrHalfCouncil; - type CurrencyValidator = ValidateCurrencyId; - type RuntimeHoldReason = TemporalHoldIdentifier; -} + parameter_type_with_key! { // Minimum amount an account has to hold to stay in state @@ -518,33 +470,6 @@ parameter_types! { pub TreasuryAccount: AccountId = TreasuryPalletId::get().into_account_truncating(); } -pub struct CurrencyHooks; -impl orml_traits::currency::MutationHooks for CurrencyHooks { - type OnDust = orml_tokens::TransferDust; - type OnSlash = (); - type PreDeposit = (); - type PostDeposit = (); - type PreTransfer = (); - type PostTransfer = (); - type OnNewTokenAccount = (); - type OnKilledTokenAccount = (); -} - -type ReserveIdentifier = [u8; 8]; -impl orml_tokens::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type Balance = Balance; - type Amount = Amount; - type CurrencyId = CurrencyId; - type WeightInfo = weights::tokens::WeightInfo; - type ExistentialDeposits = MultiExistentialDeposits; - type MaxLocks = MaxLocks; - type ReserveIdentifier = ReserveIdentifier; - type MaxReserves = frame_support::traits::ConstU32<2>; - type DustRemovalWhitelist = DustRemovalWhitelist; - type CurrencyHooks = CurrencyHooks; -} - parameter_types! { pub MaximumSchedulerWeight: Weight = Perbill::from_percent(80) * RuntimeBlockWeights::get().max_block;