Skip to content

Commit d8b2393

Browse files
feat(permission0): create new curator scope (#97)
Creates a new curator scope for the permission0 system. This change supersedes the `Curators` storage value in the governance pallet. A new extrinsic was added to `permission0`: ```rust pub fn grant_curator_permission( origin: OriginFor<T>, grantee: T::AccountId, flags: u32, cooldown: Option<BlockNumberFor<T>>, duration: PermissionDuration<T>, revocation: RevocationTerms<T>, ) ; ``` For now, only the sudo (root) key is allowed to grant new permissions, which we will do through a multisig dispatch. Future versions will allow curators to re-delegate permissions. The new extrinsic allows setting different sub-permissions for curator actions: ```rust /// Permission to review and process agent applications const APPLICATION_REVIEW = 0b0000_0010; /// Permission to manage the whitelist (add/remove accounts) const WHITELIST_MANAGE = 0b0000_0100; /// Permission to apply penalty factors to agents const PENALTY_CONTROL = 0b0000_1000; ``` The value for `0b1` is reserved for future use and internally assigned as `ROOT`. The `flags` field is a bitmask, so OR the different flags together to get your very own personalized permission. Finally, I removed the old extrinsics for curators in the governance pallet.
1 parent 000fe75 commit d8b2393

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+3267
-1209
lines changed

Cargo.lock

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ substrate-wasm-builder = { git = "https://github.com/paritytech/polkadot-sdk.git
3939
num-traits = { version = "0.2.19", default-features = false, features = [
4040
"libm",
4141
] }
42+
bitflags = { version = "2.5.0", default-features = false }
4243

4344
# Frontier / EVM
4445
fc-api = { git = "https://github.com/paritytech/frontier.git", rev = "b9b1c620c8b418bdeeadc79725f9cfa4703c0333" }

0 commit comments

Comments
 (0)