Skip to content

[Contract] Implement Token-Weighted Voting Module for Asset Proposals #471

@yusuftomilola

Description

@yusuftomilola

Governance mechanism allowing token holders to vote on proposals (e.g. detokenization, asset sale) with votes weighted by token balance.

Requirements

cast_vote(env, asset_id, proposal_id, voter):

  • Voter must authenticate
  • Voter must hold tokens and not have already voted
  • Adds the voter's token balance to the proposal's running tally
  • Marks voter as having voted (prevents double voting)
  • Emits a vote_cast event

get_vote_tally(env, asset_id, proposal_id) — Returns cumulative votes cast

has_voted(env, asset_id, proposal_id, voter) — Read-only

proposal_passed(env, asset_id, proposal_id):

  • Passes if tally ≥ min_voting_threshold (set during tokenization)

Acceptance Criteria

  • Double voting returns Error::AlreadyVoted
  • Vote weight equals voter's token balance at time of voting
  • proposal_passed respects the min_voting_threshold

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions