moonbase_runtime/governance/
councils.rs

1// Copyright 2019-2025 PureStake Inc.
2// This file is part of Moonbeam.
3
4// Moonbeam is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8
9// Moonbeam is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12// GNU General Public License for more details.
13
14// You should have received a copy of the GNU General Public License
15// along with Moonbeam.  If not, see <http://www.gnu.org/licenses/>.
16
17//! Councils for Gov1 and Gov2
18
19use super::moonbase_weights;
20use super::*;
21use crate::governance::referenda::FastGeneralAdminOrRoot;
22
23pub type TreasuryCouncilInstance = pallet_collective::Instance3;
24pub type OpenTechCommitteeInstance = pallet_collective::Instance4;
25
26parameter_types! {
27	// TODO: Check value of this parameter
28	pub MaxProposalWeight: Weight = Perbill::from_percent(50) * BlockWeights::get().max_block;
29}
30
31impl pallet_collective::Config<TreasuryCouncilInstance> for Runtime {
32	type RuntimeOrigin = RuntimeOrigin;
33	type RuntimeEvent = RuntimeEvent;
34	type Proposal = RuntimeCall;
35	/// The maximum amount of time (in blocks) for treasury council members to vote on motions.
36	/// Motions may end in fewer blocks if enough votes are cast to determine the result.
37	type MotionDuration = ConstU32<{ 3 * DAYS }>;
38	/// The maximum number of proposals that can be open in the treasury council at once.
39	type MaxProposals = ConstU32<20>;
40	/// The maximum number of treasury council members.
41	type MaxMembers = ConstU32<9>;
42	type DefaultVote = pallet_collective::MoreThanMajorityThenPrimeDefaultVote;
43	type WeightInfo =
44		moonbase_weights::pallet_collective_treasury_council_collective::WeightInfo<Runtime>;
45	type SetMembersOrigin = referenda::GeneralAdminOrRoot;
46	type MaxProposalWeight = MaxProposalWeight;
47	type DisapproveOrigin = FastGeneralAdminOrRoot;
48	type KillOrigin = FastGeneralAdminOrRoot;
49	type Consideration = ();
50}
51
52impl pallet_collective::Config<OpenTechCommitteeInstance> for Runtime {
53	type RuntimeOrigin = RuntimeOrigin;
54	type RuntimeEvent = RuntimeEvent;
55	type Proposal = RuntimeCall;
56	/// The maximum amount of time (in blocks) for technical committee members to vote on motions.
57	/// Motions may end in fewer blocks if enough votes are cast to determine the result.
58	type MotionDuration = ConstU32<{ 14 * DAYS }>;
59	/// The maximum number of proposals that can be open in the technical committee at once.
60	type MaxProposals = ConstU32<100>;
61	/// The maximum number of technical committee members.
62	type MaxMembers = ConstU32<100>;
63	type DefaultVote = pallet_collective::MoreThanMajorityThenPrimeDefaultVote;
64	type WeightInfo =
65		moonbase_weights::pallet_collective_open_tech_committee_collective::WeightInfo<Runtime>;
66	type SetMembersOrigin = referenda::GeneralAdminOrRoot;
67	type MaxProposalWeight = MaxProposalWeight;
68	type DisapproveOrigin = FastGeneralAdminOrRoot;
69	type KillOrigin = FastGeneralAdminOrRoot;
70	type Consideration = ();
71}