Skip to content

Commit

Permalink
Merge pull request #74 from mangata-finance/feature/council-improvement
Browse files Browse the repository at this point in the history
Feature/council improvement
  • Loading branch information
iStrike7 authored Dec 9, 2022
2 parents b5cdb23 + b340f09 commit 1380654
Show file tree
Hide file tree
Showing 15 changed files with 4,756 additions and 3 deletions.
37 changes: 34 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ members = [
"frame/bounties",
"frame/child-bounties",
"frame/collective",
"frame/collective-mangata",
"frame/contracts",
"frame/contracts/rpc",
"frame/contracts/rpc/runtime-api",
Expand Down Expand Up @@ -136,6 +137,7 @@ members = [
"frame/staking/reward-fn",
"frame/state-trie-migration",
"frame/sudo",
"frame/sudo-mangata",
"frame/support",
"frame/support/procedural",
"frame/support/procedural/tools",
Expand Down
50 changes: 50 additions & 0 deletions frame/collective-mangata/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
[package]
name = "pallet-collective-mangata"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
description = "Collective system: Members of a set of account IDs can make their collective feelings known through dispatched calls from one of two specialized origins."
readme = "README.md"

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] }
log = { version = "0.4.17", default-features = false }
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
frame-benchmarking = { version = "4.0.0-dev", default-features = false, optional = true, path = "../benchmarking" }
frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" }
frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" }
sp-core = { version = "6.0.0", default-features = false, path = "../../primitives/core" }
sp-io = { version = "6.0.0", default-features = false, path = "../../primitives/io" }
sp-runtime = { version = "6.0.0", default-features = false, path = "../../primitives/runtime" }
sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" }

[features]
default = ["std"]
std = [
"codec/std",
"frame-benchmarking/std",
"frame-support/std",
"frame-system/std",
"log/std",
"scale-info/std",
"sp-core/std",
"sp-io/std",
"sp-runtime/std",
"sp-std/std",
]
runtime-benchmarks = [
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
]
try-runtime = [
"frame-system/try-runtime",
"frame-support/try-runtime"
]
25 changes: 25 additions & 0 deletions frame/collective-mangata/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Collective system: Members of a set of account IDs can make their collective feelings known
through dispatched calls from one of two specialized origins.

The membership can be provided in one of two ways: either directly, using the Root-dispatchable
function `set_members`, or indirectly, through implementing the `ChangeMembers`.
The pallet assumes that the amount of members stays at or below `MaxMembers` for its weight
calculations, but enforces this neither in `set_members` nor in `change_members_sorted`.

A "prime" member may be set to help determine the default vote behavior based on chain
config. If `PrimeDefaultVote` is used, the prime vote acts as the default vote in case of any
abstentions after the voting period. If `MoreThanMajorityThenPrimeDefaultVote` is used, then
abstentations will first follow the majority of the collective voting, and then the prime
member.

Voting happens through motions comprising a proposal (i.e. a dispatchable) plus a
number of approvals required for it to pass and be called. Motions are open for members to
vote on for a minimum period given by `MotionDuration`. As soon as the required number of
approvals is given, the motion is closed and executed. If the number of approvals is not reached
during the voting period, then `close` may be called by any account in order to force the end
the motion explicitly. If a prime member is defined, then their vote is used instead of any
abstentions and the proposal is executed if there are enough approvals counting the new votes.

If there are not, or if no prime member is set, then the motion is dropped without being executed.

License: Apache-2.0
Loading

0 comments on commit 1380654

Please sign in to comment.