Skip to content

Commit

Permalink
docs: fix support numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
mootz12 committed Apr 23, 2024
1 parent a263928 commit ecd127d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions contracts/governor/src/governor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ pub trait Governor {
/// * `voter` - The address of the account voting
/// * `proposal_id` - The id of the proposal to vote on
/// * `support` - The vote to cast:
/// - 0 to vote abstain
/// - 1 to vote against
/// - 2 to vote for
/// - 0 to vote against
/// - 1 to vote for
/// - 2 to vote abstain
fn vote(e: Env, voter: Address, proposal_id: u32, support: u32);

/// Get the voting status of a voter for a proposal.
///
/// Returns None if the voter has not voted on the proposal, or a u32 that
/// represents the vote cast (0 = abstain, 1 = against, 2 = for).
/// represents the vote cast (0 = against, 1 = for, 2 = abstain).
///
/// ### Arguments
/// * `voter` - The address of the account voting
Expand Down
6 changes: 3 additions & 3 deletions contracts/governor/src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,9 @@ pub fn get_voter_support(e: &Env, voter: &Address, proposal_id: u32) -> Option<u
/// * `voter` - The address of the voter
/// * `proposal_id` - The proposal id
/// * `support` - The support the user chose
/// - 0 to vote abstain
/// - 1 to vote against
/// - 2 to vote for
/// - 0 to vote against
/// - 1 to vote for
/// - 2 to vote abstain
pub fn create_voter_support(e: &Env, voter: &Address, proposal_id: u32, support: u32) {
let key = GovernorDataKey::VoterSup(VoterStatusKey {
voter: voter.clone(),
Expand Down
2 changes: 1 addition & 1 deletion docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The Governor manages a handful of parameters that define how the proposal flow i
* Quorum `u32`
* The percentage of votes (expressed in BPS) needed of the total available votes to consider a vote successful.
* Counting Type `u32`
* Determine which votes to count against the quorum out of for, against, and abstain. The value is encoded such that only the last 3 bits are considered, and follows the structure `MSB...{for}{against}{abstain}`, such that any value != 0 means that type of vote is counted in the quorum. For example, consider 5 == `0x0...0101`, this means that votes "for" and "abstain" are included in the quorum, but votes "against" are not.
* Determine which votes to count against the quorum out of for, against, and abstain. The value is encoded such that only the last 3 bits are considered, and follows the structure `MSB...{against}{for}{abstain}`, such that any value != 0 means that type of vote is counted in the quorum. For example, consider 5 == `0x0...0101`, this means that votes "against" and "abstain" are included in the quorum, but votes "for" are not.
* Vote Threshold `u32`
* The percentage of votes "yes" (expressed in BPS) needed to consider a vote successful.

Expand Down

0 comments on commit ecd127d

Please sign in to comment.