moonbeam_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::*;
20use crate::governance::referenda::FastGeneralAdminOrRoot;
21
22pub type TreasuryCouncilInstance = pallet_collective::Instance3;
23pub type OpenTechCommitteeInstance = pallet_collective::Instance4;
24
25parameter_types! {
26	// TODO: Check value of this parameter
27	pub MaxProposalWeight: Weight = Perbill::from_percent(50) * RuntimeBlockWeights::get().max_block;
28}
29
30impl pallet_collective::Config<TreasuryCouncilInstance> for Runtime {
31	type RuntimeOrigin = RuntimeOrigin;
32	type RuntimeEvent = RuntimeEvent;
33	type Proposal = RuntimeCall;
34	/// The maximum amount of time (in blocks) for treasury council members to vote on motions.
35	/// Motions may end in fewer blocks if enough votes are cast to determine the result.
36	type MotionDuration = ConstU32<{ 3 * DAYS }>;
37	/// The maximum number of proposals that can be open in the treasury council at once.
38	type MaxProposals = ConstU32<20>;
39	/// The maximum number of treasury council members.
40	type MaxMembers = ConstU32<9>;
41	type DefaultVote = pallet_collective::MoreThanMajorityThenPrimeDefaultVote;
42	type WeightInfo =
43		moonbeam_weights::pallet_collective_treasury_council_collective::WeightInfo<Runtime>;
44	type SetMembersOrigin = referenda::GeneralAdminOrRoot;
45	type MaxProposalWeight = MaxProposalWeight;
46	type KillOrigin = FastGeneralAdminOrRoot;
47	type DisapproveOrigin = FastGeneralAdminOrRoot;
48	type Consideration = ();
49}
50
51impl pallet_collective::Config<OpenTechCommitteeInstance> for Runtime {
52	type RuntimeOrigin = RuntimeOrigin;
53	type RuntimeEvent = RuntimeEvent;
54	type Proposal = RuntimeCall;
55	/// The maximum amount of time (in blocks) for technical committee members to vote on motions.
56	/// Motions may end in fewer blocks if enough votes are cast to determine the result.
57	type MotionDuration = ConstU32<{ 14 * DAYS }>;
58	/// The maximum number of proposals that can be open in the technical committee at once.
59	type MaxProposals = ConstU32<100>;
60	/// The maximum number of technical committee members.
61	type MaxMembers = ConstU32<100>;
62	type DefaultVote = pallet_collective::MoreThanMajorityThenPrimeDefaultVote;
63	type WeightInfo =
64		moonbeam_weights::pallet_collective_open_tech_committee_collective::WeightInfo<Runtime>;
65	type SetMembersOrigin = referenda::GeneralAdminOrRoot;
66	type MaxProposalWeight = MaxProposalWeight;
67	type KillOrigin = FastGeneralAdminOrRoot;
68	type DisapproveOrigin = FastGeneralAdminOrRoot;
69	type Consideration = ();
70}