Skip to content

kda-community/dao-voting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Kadena DAO Voting

On chain voting Sytem for the Kadena Communitiy DAO

Features

  • Multi-chain. People can vote on the chain of their choice (maybe limited to 0 , 1 ,2).
  • Holders only need to lock their KDA during at the Voting date
  • Viters can withdraw / change their vote before the freeze
  • Team can propose incetive to be shared by the voters
  • Proposals have a title and linked document (ideally immutable link IPFS, or GH Hash pin)

Procedure

     :                                         :                                     :
     :              PRE-VOTE PHASE             :            POST VOTE PHASE          :        ENDED PHASE
     :                                         :                                     :
  REGISTER                                   VOTES                                   :       Team Can retrieve
  PROPOSAL        Team can add incentives   FROZEN                                   :       unclaimed incentives
     |              |             |            |                                     :              |
     |              v             v            v                                     :              v
     |-----------------------------------------|-------------------------------------|------------------------------->
          ^                          ^                             ^                              ^
          |                          |                             |                              |
    Voters can deposit       Voters can withdraw            Voters can withdraw             Voters can withdraw
    to vote                  and cancel their vote          their KDA + incentives          their KDA but incetives
                                                                                            art lost

API

Read API

get-proposal

proposal-id:stringobject{proposal}

Return the details of a proposal

  (defschema proposal
    id:string ; ID of the proposal
    title:string ; The title of the proposal
    external-urls:[string] ; A list ox external URL or documents
    vote-yes:decimal ; Number of Kadena put on YES
    vote-neutral:decimal ; Number of Kadena put on NEUTRAL
    vote-no:decimal ; Number of Kadena put on NO
    total-incentive:decimal ; Total incentive allocated to this proposal
    voting-date:time ; Time when the voting is validated
    next-id:string ; Previous Proposal in list
  )
get-vote

account:string proposal-id:stringobject{proposal}

Return the details of an account vote

  (defschema vote
    @doc "Represents a vote by a given account and for a given proposal"
    deposit:decimal ; How much KDA is allocated by the user to this vote
    choice:string ; YES, NEUTRAL or NO
  )
get-last-proposals

start-id:string count:integer[object{proposal}]

Return tha list of last proposals in paginated way. Returns next proposals after start-id, up to count proposals

start-id may be a proposal ID or "LATEST" to return the first element of the list.

get-last-votes

acount:string start-id:string count:integer[object{proposal}]

Return tha list of last votes for a given account in paginated way. Returns next proposals after start-id, up to count votes

start-id may be a proposal ID or "LATEST" to return the first element of the list.

For Team

CREATE-PROPOSAL (cap)

bool

Capability to create a proposal. Must be signed by an admin key.

WITHDRAW-INCENTIVE (cap)

bool

Capability to withdraw unclaimed inventives. Must be signed by an admin key.

create-proposal

title:string external-urls:[string] voting-date:timestring

Create a proposal with a given title, set of external urls, and a voting date. The CREATE-PROPOSAL cap must be signed by the team

deposit-incentive

proposal-id:string from:string amount:decimalbool

Deposit an amount for incentive from account from for rewarding voters.

withdraw-incentive

proposal-id:string to:stringbool

Allow the team to withdraw unclaimed incentive after the voting is defintively ended

For Users

VOTE (cap)

proposal-id:string account:stringbool Allow an user to vote

WITHDRAW (cap)

proposal-id:string account:stringbool Allow an user to vote

deposit-for-vote

proposal-id:string account:string amount:decimalbool

Deposit an ammount of KDA for voting. The vote is set initially to NEUTRAL. The coin.TRANSFER cap must be installed with to (voting-account)

set-vote

proposal-id:string account:string choice:stringbool

Set the voting choice for an user: choice being "YES", "NEUTRAL" or "NO" The cap VOTE must be installed and signed

withdraw

proposal-id:string account:string amount:decimalbool

Allow an user to withdraw a previously deposited amount. After the vote, the whole amount must be withdrawn. The cap WITHDRAW must be installed and signed

About

On chain voting Sytem for the Kadena Communitiy DAO

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages