Table of Content
This document provides an overview of the application.
It outlines the use cases, i.e. desirable functionality, in addition to requirements for the smart contract and the user interface.
This section contains general information about the functionality of the application and thus does not touch upon any technical aspects.
If you are interested in a functional overview then this is the section for you.
- Initializes the contract by setting the governance asset used for voting
- Creates a new proposal to be voted on
- Contains a threshold representing the number of votes required to allow the proposal to pass
- Contains a duration for how long the proposal can be voted on
- Allows a user to deposit any number of governance assets
- Each coin deposited equates to one vote the user can cast
- Allows a user to withdraw any number of governance assets that they have deposited
- The user can only withdraw coins that have not been bonded as votes in proposals
- Allows a user to vote on a proposal using their unlocked deposit
- They can vote in favor of the proposal
- They can vote against the proposal
- They can vote in favor and against the same proposal
- Casting a vote reduces the available deposit by the equivalent amount
- Allows a proposal to be executed, only once, if
- The deadline has been surpassed
- The threshold for the proposal passing has been surpassed
- Once the deadline of a proposal has been surpassed a user can unlock those votes
- To vote on another proposal
- To withdraw
- Returns the total balance of the governance coins deposited in the contract
- Returns the number of unlocked governance coins for a user
- If a user has voted on a proposal then those coins will not be reflected in this balance
- Returns the number of votes for a proposal by a user
- This consists of the votes in favor / against the proposal
- Returns information about a proposal
- The percentage required to make the proposal pass
- The author of the proposal
- The deadline after which votes can no longer be cast
- Whether the proposal has been executed
- The raw number of "yes" and "no" votes
- Arbitrary data required for the proposal to execute
- Returns the ID of the governance asset
- Returns the total number of proposals created