Skip to main content

Governance


Enabling governance in a toolkit project requires approval for all changes through member votes. The project governance system currently uses a simple voting structure, where each member has one vote, and proposals need a minimum of 33% participation, with a 50%+ majority required for direct approval and execution.

Voting Power

Each member has a single ballot, giving equal voting power across all members.

Default Governance Rules

When governance is enabled, several default settings apply. These can be adjusted through proposals:

  • Proposal Duration: 2 days
  • Hotkeys Enabled: true
  • Governance Type: None (currently not utilized)
  • Canister Status Fetch Interval: 1 hour

Proposal Types

With governance enabled, members can propose various actions to manage and control the toolkit project. These actions fall under different proposal types, each with distinct functionalities.

ManageConfig

Settings to manage project configuration:

EnableGovernance(bool)

Enable or disable governance.

true  // Enable governance
false // Disable governance

Default: false

SetProposalDurationNanos(u64)

Set the duration for a proposal in nanoseconds.

u64 // Duration in nanoseconds

Default: 2 days
Range: 24 hours to 4 days

SetCanisterStatusFetchIntervalSeconds(u64)

Specify the interval for fetching the status of controlled canisters.

u64 // Duration in seconds

Default: 1 hour
Range: 5 minutes to 2 days

RootConfig

Controls for the root canister of the toolkit project:

Upgrade

Upgrade the root canister to a new version.

Detach (Not Implemented)

Detach the root canister and assign a principal as the new controller.

ManageMember

Controls for adding or removing members:

Add(Account)

Add a new member to the project.

pub struct Account {
pub owner: Principal,
pub subaccount: Option<[u8; 32]>,
}

Remove(Account)

Remove an existing member from the project.

pub struct Account {
pub owner: Principal,
pub subaccount: Option<[u8; 32]>,
}

ManageCanister

Controls for managing canisters associated with the toolkit project:

Register(Principal)

Register a canister with the toolkit project.

Principal // Canister to register

Requirements:

  • The root canister must control the canister being added.
  • The proposal creator must control the canister.
  • Existing controllers will be removed upon registration.

Deregister(DeregisterCanisterArgs)

Deregister a canister and assign a new controller.

pub struct DeregisterCanisterArgs {
pub canister_id: Principal, // Canister to deregister
pub controller: Principal, // New controller for the canister
}

Upgrade(InstallCodeArgument)

Upgrade a canister’s code.

InstallCodeArgument // See InstallCodeArgument documentation

New(NewCanisterArgs) (Not Implemented)

Deploy a new canister with specified cycles.

pub struct NewCanisterArgs {
pub icp_e8s: Principal, // ICP in e8s used for cycles
pub install_args: InstallCodeArgument, // Installation arguments
}

TransferOwner(Account)

Transfer the ownership of the toolkit project to another principal. Ownership can only be transferred to an existing member.

pub struct Account {
pub owner: Principal,
pub subaccount: Option<[u8; 32]>,
}

ManageMetadata

Controls for updating project metadata:

Update(UpdateMetadata)

Update metadata fields for the project.

pub struct UpdateMetadata {
url: Option<String>, // Project URL
logo: Option<String>, // Project logo URL
name: Option<String>, // Project name
description: Option<String>, // Project description
}

Note: Fields set to None are ignored in the update.

TokenTransfer

Actions related to ICRC token transfers:

IcrcTransfer(IcrcTransferArgs)

Initiate a transfer of ICRC tokens.

pub struct IcrcTransferArgs {
pub ledger: Principal, // Ledger principal to transfer from
pub from_subaccount: Option<[u8; 32]>,
pub to: Account, // Recipient account
pub amount: Nat, // Amount to transfer
}