diff --git a/Cargo.lock b/Cargo.lock index 30a1c65..ce4babd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7380,6 +7380,7 @@ dependencies = [ "pallet-authorship", "pallet-balances", "pallet-collator-selection", + "pallet-multisig", "pallet-parachain-template", "pallet-session", "pallet-sudo", diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index b589f16..30436bd 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -39,6 +39,7 @@ frame-try-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch pallet-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0", default-features = false } pallet-authorship = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0", default-features = false } pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0", default-features = false } +pallet-multisig = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0", default-features = false } pallet-session = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0", default-features = false } pallet-sudo = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0", default-features = false } pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0", default-features = false } @@ -104,6 +105,7 @@ std = [ "pallet-balances/std", "pallet-collator-selection/std", "pallet-parachain-template/std", + "pallet-multisig/std", "pallet-session/std", "pallet-sudo/std", "pallet-timestamp/std", @@ -144,6 +146,7 @@ runtime-benchmarks = [ "hex-literal", "pallet-balances/runtime-benchmarks", "pallet-collator-selection/runtime-benchmarks", + "pallet-multisig/runtime-benchmarks", "pallet-parachain-template/runtime-benchmarks", "pallet-sudo/runtime-benchmarks", "pallet-timestamp/runtime-benchmarks", @@ -169,6 +172,7 @@ try-runtime = [ "pallet-authorship/try-runtime", "pallet-balances/try-runtime", "pallet-collator-selection/try-runtime", + "pallet-multisig/try-runtime", "pallet-parachain-template/try-runtime", "pallet-session/try-runtime", "pallet-sudo/try-runtime", diff --git a/runtime/src/constants.rs b/runtime/src/constants.rs new file mode 100644 index 0000000..f1833cf --- /dev/null +++ b/runtime/src/constants.rs @@ -0,0 +1,11 @@ +pub mod currency { + use crate::Balance; + + pub const MILLICENTS: Balance = 1_000_000_000; + pub const CENTS: Balance = 1_000 * MILLICENTS; // assume this is worth about a cent. + pub const DOLLARS: Balance = 100 * CENTS; + + pub const fn deposit(items: u32, bytes: u32) -> Balance { + items as Balance * 15 * CENTS + (bytes as Balance) * 6 * CENTS + } +} diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 706f056..b5a98d8 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -6,6 +6,8 @@ #[cfg(feature = "std")] include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); +pub mod constants; +use constants::currency::*; mod weights; pub mod xcm_config; @@ -27,6 +29,7 @@ use frame_system::{ limits::{BlockLength, BlockWeights}, EnsureRoot, }; +pub use pallet_multisig; /// Import the template pallet. pub use pallet_parachain_template; use pallet_xcm::{EnsureXcm, IsVoiceOfBody}; @@ -426,6 +429,24 @@ impl cumulus_pallet_dmp_queue::Config for Runtime { type XcmExecutor = XcmExecutor; } +parameter_types! { + // One storage item; key size is 32; value is size 4+4+16+32 bytes = 56 bytes. + pub const DepositBase: Balance = deposit(1, 88); + // Additional storage item size of 32 bytes. + pub const DepositFactor: Balance = deposit(0, 32); + pub const MaxSignatories: u16 = 100; +} + +impl pallet_multisig::Config for Runtime { + type Currency = Balances; + type DepositBase = DepositBase; + type DepositFactor = DepositFactor; + type MaxSignatories = MaxSignatories; + type RuntimeCall = RuntimeCall; + type RuntimeEvent = RuntimeEvent; + type WeightInfo = pallet_multisig::weights::SubstrateWeight; +} + parameter_types! { pub const Period: u32 = 6 * HOURS; pub const Offset: u32 = 0; @@ -506,6 +527,7 @@ construct_runtime!( // Governance Sudo: pallet_sudo = 15, + Multisig: pallet_multisig, // Collator support. The order of these 4 are important and shall not change. Authorship: pallet_authorship = 20,