Skip to content

Implement Delegated Voting in pallet_dao_token #118

@deep-ink-ventures

Description

@deep-ink-ventures

Description

Objective

To introduce a delegated voting mechanism in pallet_dao_token. DAO token holders should be able to delegate their voting power to another account. This delegation should be forward-looking, meaning it should not affect old checkpoints or currently running proposals.

Requirements

  1. Create an Extrinsic to Delegate Voting Power: This extrinsic should write a new checkpoint for the caller, setting their voting power to 0, and another checkpoint for the delegate, adding the caller's voting power to them.
  2. Handle Voting Power During Transfers and Other Actions: When a transfer or any other action that affects voting power occurs, update the delegate's voting power in a new checkpoint. Do not write a new checkpoint for the original user.
  3. Create an Extrinsic to Remove the Delegate: This extrinsic should write a new checkpoint for the original user with their current balance and another checkpoint for the delegate with the reduced voting power.

Note: The implementation should not increase the maximum number of possible checkpoints per user.

Tasks

Implementation Phase

  • Implement the extrinsic for delegating voting power.
  • Implement logic to update the delegate's voting power during transfers and other actions.
  • Implement the extrinsic for removing the delegate.

Testing Phase

  • Unit tests for delegating voting power.
  • Unit tests for updating delegate's voting power during transfers and other actions.
  • Unit tests for removing the delegate.

Documentation Phase

  • Write inline code documentation.
  • Update user guide to include delegated voting features.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions