moonbeam_runtime/governance/
referenda.rs1use super::*;
24use crate::currency::{GLMR, SUPPLY_FACTOR};
25use frame_support::traits::{EitherOf, MapSuccess};
26use frame_system::EnsureRootWithSuccess;
27use sp_runtime::traits::Replace;
28
29parameter_types! {
30 pub const VoteLockingPeriod: BlockNumber = 1 * DAYS;
31}
32
33impl pallet_conviction_voting::Config for Runtime {
34 type WeightInfo = moonbeam_weights::pallet_conviction_voting::WeightInfo<Runtime>;
35 type RuntimeEvent = RuntimeEvent;
36 type Currency = Balances;
37 type Polls = Referenda;
38 type MaxTurnout = frame_support::traits::TotalIssuanceOf<Balances, Self::AccountId>;
39 type MaxVotes = ConstU32<20>;
41 type VoteLockingPeriod = VoteLockingPeriod;
43 type BlockNumberProvider = System;
44 type VotingHooks = ();
45}
46
47parameter_types! {
48 pub const AlarmInterval: BlockNumber = 1;
49 pub const SubmissionDeposit: Balance = 10 * GLMR * SUPPLY_FACTOR;
50 pub const UndecidingTimeout: BlockNumber = 21 * DAYS;
51}
52
53pub type GeneralAdminOrRoot = EitherOf<EnsureRoot<AccountId>, origins::GeneralAdmin>;
55pub type FastGeneralAdminOrRoot =
57 EitherOf<EnsureRoot<AccountId>, EitherOf<origins::GeneralAdmin, origins::FastGeneralAdmin>>;
58
59impl custom_origins::Config for Runtime {}
60
61impl pallet_whitelist::Config for Runtime {
64 type WeightInfo = moonbeam_weights::pallet_whitelist::WeightInfo<Runtime>;
65 type RuntimeEvent = RuntimeEvent;
66 type RuntimeCall = RuntimeCall;
67 type WhitelistOrigin = EitherOf<
68 EnsureRootWithSuccess<Self::AccountId, ConstU16<65535>>,
69 MapSuccess<
70 pallet_collective::EnsureProportionAtLeast<
71 Self::AccountId,
72 OpenTechCommitteeInstance,
73 5,
74 9,
75 >,
76 Replace<ConstU16<6>>,
77 >,
78 >;
79 type DispatchWhitelistedOrigin = EitherOf<EnsureRoot<Self::AccountId>, WhitelistedCaller>;
80 type Preimages = Preimage;
81}
82
83impl pallet_referenda::Config for Runtime {
84 type WeightInfo = moonbeam_weights::pallet_referenda::WeightInfo<Runtime>;
85 type RuntimeCall = RuntimeCall;
86 type RuntimeEvent = RuntimeEvent;
87 type Scheduler = Scheduler;
88 type Currency = Balances;
89 type SubmitOrigin = frame_system::EnsureSigned<AccountId>;
90 type CancelOrigin = EitherOf<EnsureRoot<Self::AccountId>, ReferendumCanceller>;
91 type KillOrigin = EitherOf<EnsureRoot<Self::AccountId>, ReferendumKiller>;
92 type Slash = Treasury;
93 type Votes = pallet_conviction_voting::VotesOf<Runtime>;
94 type Tally = pallet_conviction_voting::TallyOf<Runtime>;
95 type SubmissionDeposit = SubmissionDeposit;
96 type MaxQueued = ConstU32<100>;
97 type UndecidingTimeout = UndecidingTimeout;
98 type AlarmInterval = AlarmInterval;
99 type Tracks = TracksInfo;
100 type Preimages = Preimage;
101 type BlockNumberProvider = System;
102}