defaults.rs 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. //! This module contains default parameters for the runtime codex proposals.
  2. use crate::{Balance, BlockNumber, ProposalParameters};
  3. // Proposal parameters for the 'Set validator count' proposal
  4. pub(crate) fn set_validator_count_proposal() -> ProposalParameters<BlockNumber, Balance> {
  5. ProposalParameters {
  6. voting_period: 43200,
  7. grace_period: 0,
  8. approval_quorum_percentage: 66,
  9. approval_threshold_percentage: 80,
  10. slashing_quorum_percentage: 60,
  11. slashing_threshold_percentage: 80,
  12. required_stake: Some(100_000),
  13. constitutionality: 1,
  14. }
  15. }
  16. // Proposal parameters for the upgrade runtime proposal
  17. pub(crate) fn runtime_upgrade_proposal() -> ProposalParameters<BlockNumber, Balance> {
  18. ProposalParameters {
  19. voting_period: 72000,
  20. grace_period: 72000,
  21. approval_quorum_percentage: 80,
  22. approval_threshold_percentage: 100,
  23. slashing_quorum_percentage: 60,
  24. slashing_threshold_percentage: 80,
  25. required_stake: Some(1_000_000),
  26. constitutionality: 1,
  27. }
  28. }
  29. // Proposal parameters for the text proposal
  30. pub(crate) fn text_proposal() -> ProposalParameters<BlockNumber, Balance> {
  31. ProposalParameters {
  32. voting_period: 72000,
  33. grace_period: 0,
  34. approval_quorum_percentage: 60,
  35. approval_threshold_percentage: 80,
  36. slashing_quorum_percentage: 60,
  37. slashing_threshold_percentage: 80,
  38. required_stake: Some(25000),
  39. constitutionality: 1,
  40. }
  41. }
  42. // Proposal parameters for the 'Spending' proposal
  43. pub(crate) fn spending_proposal() -> ProposalParameters<BlockNumber, Balance> {
  44. ProposalParameters {
  45. voting_period: 72000,
  46. grace_period: 14400,
  47. approval_quorum_percentage: 60,
  48. approval_threshold_percentage: 80,
  49. slashing_quorum_percentage: 60,
  50. slashing_threshold_percentage: 80,
  51. required_stake: Some(25000),
  52. constitutionality: 1,
  53. }
  54. }
  55. // Proposal parameters for the 'Add working group opening' proposal
  56. pub(crate) fn add_working_group_opening_proposal() -> ProposalParameters<BlockNumber, Balance> {
  57. ProposalParameters {
  58. voting_period: 72000,
  59. grace_period: 0,
  60. approval_quorum_percentage: 60,
  61. approval_threshold_percentage: 80,
  62. slashing_quorum_percentage: 60,
  63. slashing_threshold_percentage: 80,
  64. required_stake: Some(100_000),
  65. constitutionality: 1,
  66. }
  67. }
  68. // Proposal parameters for the 'Fill working group opening' proposal
  69. pub(crate) fn fill_working_group_opening_proposal() -> ProposalParameters<BlockNumber, Balance> {
  70. ProposalParameters {
  71. voting_period: 43200,
  72. grace_period: 0,
  73. approval_quorum_percentage: 60,
  74. approval_threshold_percentage: 75,
  75. slashing_quorum_percentage: 60,
  76. slashing_threshold_percentage: 80,
  77. required_stake: Some(50000),
  78. constitutionality: 1,
  79. }
  80. }
  81. // Proposal parameters for the 'Set working group budget capacity' proposal
  82. pub(crate) fn set_working_group_budget_capacity_proposal(
  83. ) -> ProposalParameters<BlockNumber, Balance> {
  84. ProposalParameters {
  85. voting_period: 43200,
  86. grace_period: 0,
  87. approval_quorum_percentage: 60,
  88. approval_threshold_percentage: 75,
  89. slashing_quorum_percentage: 60,
  90. slashing_threshold_percentage: 80,
  91. required_stake: Some(50000),
  92. constitutionality: 1,
  93. }
  94. }
  95. // Proposal parameters for the 'Decrease working group leader stake' proposal
  96. pub(crate) fn decrease_working_group_leader_stake_proposal(
  97. ) -> ProposalParameters<BlockNumber, Balance> {
  98. ProposalParameters {
  99. voting_period: 43200,
  100. grace_period: 0,
  101. approval_quorum_percentage: 60,
  102. approval_threshold_percentage: 75,
  103. slashing_quorum_percentage: 60,
  104. slashing_threshold_percentage: 80,
  105. required_stake: Some(50000),
  106. constitutionality: 1,
  107. }
  108. }
  109. // Proposal parameters for the 'Slash working group leader stake' proposal
  110. pub fn slash_working_group_leader_stake_proposal() -> ProposalParameters<BlockNumber, Balance> {
  111. ProposalParameters {
  112. voting_period: 43200,
  113. grace_period: 0,
  114. approval_quorum_percentage: 60,
  115. approval_threshold_percentage: 75,
  116. slashing_quorum_percentage: 60,
  117. slashing_threshold_percentage: 80,
  118. required_stake: Some(50000),
  119. constitutionality: 1,
  120. }
  121. }
  122. // Proposal parameters for the 'Set working group leader reward' proposal
  123. pub(crate) fn set_working_group_leader_reward_proposal() -> ProposalParameters<BlockNumber, Balance>
  124. {
  125. ProposalParameters {
  126. voting_period: 43200,
  127. grace_period: 0,
  128. approval_quorum_percentage: 60,
  129. approval_threshold_percentage: 75,
  130. slashing_quorum_percentage: 60,
  131. slashing_threshold_percentage: 80,
  132. required_stake: Some(50000),
  133. constitutionality: 1,
  134. }
  135. }
  136. // Proposal parameters for the 'Terminate working group leader role' proposal
  137. pub(crate) fn terminate_working_group_leader_role_proposal(
  138. ) -> ProposalParameters<BlockNumber, Balance> {
  139. ProposalParameters {
  140. voting_period: 72200,
  141. grace_period: 0,
  142. approval_quorum_percentage: 66,
  143. approval_threshold_percentage: 80,
  144. slashing_quorum_percentage: 60,
  145. slashing_threshold_percentage: 80,
  146. required_stake: Some(100_000),
  147. constitutionality: 1,
  148. }
  149. }
  150. // Proposal parameters for the 'Amend constitution' proposal
  151. pub(crate) fn amend_constitution_proposal() -> ProposalParameters<BlockNumber, Balance> {
  152. ProposalParameters {
  153. voting_period: 72200,
  154. grace_period: 72200,
  155. approval_quorum_percentage: 80,
  156. approval_threshold_percentage: 100,
  157. slashing_quorum_percentage: 60,
  158. slashing_threshold_percentage: 80,
  159. required_stake: Some(1_000_000),
  160. constitutionality: 1,
  161. }
  162. }