-
Notifications
You must be signed in to change notification settings - Fork 528
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
661a0e3
commit 7bca0f1
Showing
25 changed files
with
1,882 additions
and
529 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
// This file is part of Acala. | ||
|
||
// Copyright (C) 2020-2023 Acala Foundation. | ||
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 | ||
|
||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
|
||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
|
||
// You should have received a copy of the GNU General Public License | ||
// along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
//! Councils for Gov1 and Gov2 | ||
|
||
use super::*; | ||
|
||
parameter_types! { | ||
pub const GeneralCouncilMotionDuration: BlockNumber = 3 * DAYS; | ||
pub const CouncilDefaultMaxProposals: u32 = 20; | ||
pub const CouncilDefaultMaxMembers: u32 = 30; | ||
pub MaxProposalWeight: Weight = Perbill::from_percent(50) * RuntimeBlockWeights::get().max_block; | ||
} | ||
|
||
impl pallet_collective::Config<GeneralCouncilInstance> for Runtime { | ||
type RuntimeOrigin = RuntimeOrigin; | ||
type Proposal = RuntimeCall; | ||
type RuntimeEvent = RuntimeEvent; | ||
type MotionDuration = GeneralCouncilMotionDuration; | ||
type MaxProposals = CouncilDefaultMaxProposals; | ||
type MaxMembers = CouncilDefaultMaxMembers; | ||
type DefaultVote = pallet_collective::PrimeDefaultVote; | ||
type SetMembersOrigin = EnsureRoot<AccountId>; | ||
type WeightInfo = (); | ||
type MaxProposalWeight = MaxProposalWeight; | ||
} | ||
|
||
impl pallet_membership::Config<GeneralCouncilMembershipInstance> for Runtime { | ||
type RuntimeEvent = RuntimeEvent; | ||
type AddOrigin = EnsureRootOrThreeFourthsGeneralCouncil; | ||
type RemoveOrigin = EnsureRootOrThreeFourthsGeneralCouncil; | ||
type SwapOrigin = EnsureRootOrThreeFourthsGeneralCouncil; | ||
type ResetOrigin = EnsureRootOrThreeFourthsGeneralCouncil; | ||
type PrimeOrigin = EnsureRootOrThreeFourthsGeneralCouncil; | ||
type MembershipInitialized = GeneralCouncil; | ||
type MembershipChanged = GeneralCouncil; | ||
type MaxMembers = CouncilDefaultMaxMembers; | ||
type WeightInfo = (); | ||
} | ||
|
||
parameter_types! { | ||
pub const FinancialCouncilMotionDuration: BlockNumber = 3 * DAYS; | ||
} | ||
|
||
impl pallet_collective::Config<FinancialCouncilInstance> for Runtime { | ||
type RuntimeOrigin = RuntimeOrigin; | ||
type Proposal = RuntimeCall; | ||
type RuntimeEvent = RuntimeEvent; | ||
type MotionDuration = FinancialCouncilMotionDuration; | ||
type MaxProposals = CouncilDefaultMaxProposals; | ||
type MaxMembers = CouncilDefaultMaxMembers; | ||
type DefaultVote = pallet_collective::PrimeDefaultVote; | ||
type SetMembersOrigin = EnsureRoot<AccountId>; | ||
type WeightInfo = (); | ||
type MaxProposalWeight = MaxProposalWeight; | ||
} | ||
|
||
impl pallet_membership::Config<FinancialCouncilMembershipInstance> for Runtime { | ||
type RuntimeEvent = RuntimeEvent; | ||
type AddOrigin = EnsureRootOrTwoThirdsGeneralCouncil; | ||
type RemoveOrigin = EnsureRootOrTwoThirdsGeneralCouncil; | ||
type SwapOrigin = EnsureRootOrTwoThirdsGeneralCouncil; | ||
type ResetOrigin = EnsureRootOrTwoThirdsGeneralCouncil; | ||
type PrimeOrigin = EnsureRootOrTwoThirdsGeneralCouncil; | ||
type MembershipInitialized = FinancialCouncil; | ||
type MembershipChanged = FinancialCouncil; | ||
type MaxMembers = CouncilDefaultMaxMembers; | ||
type WeightInfo = (); | ||
} | ||
|
||
parameter_types! { | ||
pub const HomaCouncilMotionDuration: BlockNumber = 3 * DAYS; | ||
} | ||
|
||
impl pallet_collective::Config<HomaCouncilInstance> for Runtime { | ||
type RuntimeOrigin = RuntimeOrigin; | ||
type Proposal = RuntimeCall; | ||
type RuntimeEvent = RuntimeEvent; | ||
type MotionDuration = HomaCouncilMotionDuration; | ||
type MaxProposals = CouncilDefaultMaxProposals; | ||
type MaxMembers = CouncilDefaultMaxMembers; | ||
type DefaultVote = pallet_collective::PrimeDefaultVote; | ||
type SetMembersOrigin = EnsureRoot<AccountId>; | ||
type WeightInfo = (); | ||
type MaxProposalWeight = MaxProposalWeight; | ||
} | ||
|
||
impl pallet_membership::Config<HomaCouncilMembershipInstance> for Runtime { | ||
type RuntimeEvent = RuntimeEvent; | ||
type AddOrigin = EnsureRootOrTwoThirdsGeneralCouncil; | ||
type RemoveOrigin = EnsureRootOrTwoThirdsGeneralCouncil; | ||
type SwapOrigin = EnsureRootOrTwoThirdsGeneralCouncil; | ||
type ResetOrigin = EnsureRootOrTwoThirdsGeneralCouncil; | ||
type PrimeOrigin = EnsureRootOrTwoThirdsGeneralCouncil; | ||
type MembershipInitialized = HomaCouncil; | ||
type MembershipChanged = HomaCouncil; | ||
type MaxMembers = CouncilDefaultMaxMembers; | ||
type WeightInfo = (); | ||
} | ||
|
||
parameter_types! { | ||
pub const TechnicalCommitteeMotionDuration: BlockNumber = 3 * DAYS; | ||
} | ||
|
||
impl pallet_collective::Config<TechnicalCommitteeInstance> for Runtime { | ||
type RuntimeOrigin = RuntimeOrigin; | ||
type Proposal = RuntimeCall; | ||
type RuntimeEvent = RuntimeEvent; | ||
type MotionDuration = TechnicalCommitteeMotionDuration; | ||
type MaxProposals = CouncilDefaultMaxProposals; | ||
type MaxMembers = CouncilDefaultMaxMembers; | ||
type DefaultVote = pallet_collective::PrimeDefaultVote; | ||
type SetMembersOrigin = EnsureRoot<AccountId>; | ||
type WeightInfo = (); | ||
type MaxProposalWeight = MaxProposalWeight; | ||
} | ||
|
||
impl pallet_membership::Config<TechnicalCommitteeMembershipInstance> for Runtime { | ||
type RuntimeEvent = RuntimeEvent; | ||
type AddOrigin = EnsureRootOrTwoThirdsGeneralCouncil; | ||
type RemoveOrigin = EnsureRootOrTwoThirdsGeneralCouncil; | ||
type SwapOrigin = EnsureRootOrTwoThirdsGeneralCouncil; | ||
type ResetOrigin = EnsureRootOrTwoThirdsGeneralCouncil; | ||
type PrimeOrigin = EnsureRootOrTwoThirdsGeneralCouncil; | ||
type MembershipInitialized = TechnicalCommittee; | ||
type MembershipChanged = TechnicalCommittee; | ||
type MaxMembers = CouncilDefaultMaxMembers; | ||
type WeightInfo = (); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
// This file is part of Acala. | ||
|
||
// Copyright (C) 2020-2023 Acala Foundation. | ||
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 | ||
|
||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
|
||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
|
||
// You should have received a copy of the GNU General Public License | ||
// along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
//! Democracy config for Gov1 | ||
|
||
use crate::*; | ||
|
||
parameter_types! { | ||
pub const LaunchPeriod: BlockNumber = 5 * DAYS; | ||
pub const VotingPeriod: BlockNumber = 5 * DAYS; | ||
pub const FastTrackVotingPeriod: BlockNumber = 3 * HOURS; | ||
pub MinimumDeposit: Balance = 1000 * dollar(ACA); | ||
pub const EnactmentPeriod: BlockNumber = 2 * DAYS; | ||
pub const VoteLockingPeriod: BlockNumber = 14 * DAYS; | ||
pub const CooloffPeriod: BlockNumber = 7 * DAYS; | ||
} | ||
|
||
impl pallet_democracy::Config for Runtime { | ||
type RuntimeEvent = RuntimeEvent; | ||
type Currency = Balances; | ||
type EnactmentPeriod = EnactmentPeriod; | ||
type LaunchPeriod = LaunchPeriod; | ||
type VotingPeriod = VotingPeriod; | ||
type VoteLockingPeriod = VoteLockingPeriod; | ||
type MinimumDeposit = MinimumDeposit; | ||
/// A straight majority of the council can decide what their next motion is. | ||
type ExternalOrigin = EnsureRootOrHalfGeneralCouncil; | ||
/// A majority can have the next scheduled referendum be a straight majority-carries vote. | ||
type ExternalMajorityOrigin = EnsureRootOrHalfGeneralCouncil; | ||
/// A unanimous council can have the next scheduled referendum be a straight default-carries | ||
/// (NTB) vote. | ||
type ExternalDefaultOrigin = EnsureRootOrAllGeneralCouncil; | ||
/// Two thirds of the technical committee can have an ExternalMajority/ExternalDefault vote | ||
/// be tabled immediately and with a shorter voting/enactment period. | ||
type FastTrackOrigin = EnsureRootOrTwoThirdsTechnicalCommittee; | ||
type InstantOrigin = EnsureRootOrAllTechnicalCommittee; | ||
type InstantAllowed = ConstBool<true>; | ||
type FastTrackVotingPeriod = FastTrackVotingPeriod; | ||
// To cancel a proposal which has been passed, 2/3 of the council must agree to it. | ||
type CancellationOrigin = EnsureRootOrTwoThirdsGeneralCouncil; | ||
type BlacklistOrigin = EnsureRoot<AccountId>; | ||
// To cancel a proposal before it has been passed, the technical committee must be unanimous or | ||
// Root must agree. | ||
type CancelProposalOrigin = EnsureRootOrAllTechnicalCommittee; | ||
// Any single technical committee member may veto a coming council proposal, however they can | ||
// only do it once and it lasts only for the cooloff period. | ||
type VetoOrigin = pallet_collective::EnsureMember<AccountId, TechnicalCommitteeInstance>; | ||
type CooloffPeriod = CooloffPeriod; | ||
type Slash = Treasury; | ||
type Scheduler = Scheduler; | ||
type PalletsOrigin = OriginCaller; | ||
type MaxVotes = ConstU32<100>; | ||
type WeightInfo = pallet_democracy::weights::SubstrateWeight<Runtime>; | ||
type MaxProposals = ConstU32<100>; | ||
type Preimages = Preimage; | ||
type MaxDeposits = ConstU32<100>; | ||
type MaxBlacklisted = ConstU32<100>; | ||
type SubmitOrigin = EnsureSigned<AccountId>; | ||
} |
Oops, something went wrong.