runtime_eden/
pallets_governance.rsuse crate::RuntimeBlockWeights;
use crate::{constants, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, TechnicalCommittee};
use frame_support::pallet_prelude::Weight;
use frame_support::{parameter_types, traits::EitherOfDiverse, PalletId};
use frame_system::{EnsureNever, EnsureRoot};
use primitives::{AccountId, BlockNumber};
pub use sp_runtime::Perbill;
parameter_types! {
pub const CompanyReservePalletId: PalletId = PalletId(*b"py/resrv"); }
impl pallet_reserve::Config<pallet_reserve::Instance1> for Runtime {
type RuntimeEvent = RuntimeEvent;
type Currency = pallet_balances::Pallet<Runtime>;
type ExternalOrigin = MoreThanHalfOfTechComm;
type RuntimeCall = RuntimeCall;
type PalletId = CompanyReservePalletId;
type WeightInfo = crate::weights::pallet_reserve_company_reserve::WeightInfo<Runtime>;
}
parameter_types! {
pub const InternationalReservePalletId: PalletId = PalletId(*b"py/rvint"); }
impl pallet_reserve::Config<pallet_reserve::Instance2> for Runtime {
type RuntimeEvent = RuntimeEvent;
type Currency = pallet_balances::Pallet<Runtime>;
type ExternalOrigin = MoreThanHalfOfTechComm;
type RuntimeCall = RuntimeCall;
type PalletId = InternationalReservePalletId;
type WeightInfo = crate::weights::pallet_reserve_international_reserve::WeightInfo<Runtime>;
}
parameter_types! {
pub const UsaReservePalletId: PalletId = PalletId(*b"py/rvusa"); }
impl pallet_reserve::Config<pallet_reserve::Instance3> for Runtime {
type RuntimeEvent = RuntimeEvent;
type Currency = pallet_balances::Pallet<Runtime>;
type ExternalOrigin = MoreThanHalfOfTechComm;
type RuntimeCall = RuntimeCall;
type PalletId = UsaReservePalletId;
type WeightInfo = crate::weights::pallet_reserve_usa_reserve::WeightInfo<Runtime>;
}
parameter_types! {
pub const DaoReservePalletId: PalletId = PalletId(*b"py/nddao"); }
impl pallet_reserve::Config<pallet_reserve::Instance4> for Runtime {
type RuntimeEvent = RuntimeEvent;
type Currency = pallet_balances::Pallet<Runtime>;
type ExternalOrigin = EnsureNever<AccountId>;
type RuntimeCall = RuntimeCall;
type PalletId = DaoReservePalletId;
type WeightInfo = crate::weights::pallet_reserve_dao_reserve::WeightInfo<Runtime>;
}
parameter_types! {
pub const MotionDuration: BlockNumber = 2 * constants::DAYS;
pub const MaxProposals: u32 = 100;
pub const MaxMembers: u32 = 50;
pub MaxCollectivesProposalWeight: Weight = Perbill::from_percent(50) * RuntimeBlockWeights::get().max_block;
}
pub type MoreThanHalfOfTechComm =
pallet_collective::EnsureProportionMoreThan<AccountId, pallet_collective::Instance1, 1, 2>;
pub type EnsureRootOrMoreThanHalfOfTechComm = EitherOfDiverse<EnsureRoot<AccountId>, MoreThanHalfOfTechComm>;
impl pallet_collective::Config<pallet_collective::Instance1> for Runtime {
type RuntimeOrigin = RuntimeOrigin;
type Proposal = RuntimeCall;
type RuntimeEvent = RuntimeEvent;
type MotionDuration = MotionDuration;
type MaxProposals = MaxProposals;
type WeightInfo = crate::weights::pallet_collective::WeightInfo<Runtime>;
type MaxMembers = MaxMembers;
type DefaultVote = pallet_collective::PrimeDefaultVote;
type SetMembersOrigin = EnsureRootOrMoreThanHalfOfTechComm;
type MaxProposalWeight = MaxCollectivesProposalWeight;
}
impl pallet_membership::Config<pallet_membership::Instance3> for Runtime {
type RuntimeEvent = RuntimeEvent;
type AddOrigin = MoreThanHalfOfTechComm;
type RemoveOrigin = MoreThanHalfOfTechComm;
type SwapOrigin = MoreThanHalfOfTechComm;
type ResetOrigin = MoreThanHalfOfTechComm;
type PrimeOrigin = MoreThanHalfOfTechComm;
type MembershipInitialized = TechnicalCommittee;
type MembershipChanged = TechnicalCommittee;
type MaxMembers = MaxMembers;
type WeightInfo = crate::weights::pallet_membership_technical_membership::WeightInfo<Runtime>;
}
impl pallet_mandate::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type RuntimeCall = RuntimeCall;
type ExternalOrigin = MoreThanHalfOfTechComm;
}