Summary
Creators need a way to ask their community a question and get a verifiable on-chain result. A governance poll lets a creator post a question with up to four options. Key holders vote, weighted by their liquid key balance at the time of voting. The result is readable from the contract so anyone can verify the outcome without trusting the creator or the client.
Scope
- Add
create_poll(creator_id, question: String, options: Vec<String>, duration_ledgers: u32) -> u32 callable only by the creator
- Returns a
poll_id
- Maximum 4 options, minimum 2
question max 280 characters
- Each option max 100 characters
- Poll expires at
current_ledger + duration_ledgers
- Add
cast_vote(creator_id, poll_id, option_index: u32) callable by any key holder
- Vote weight equals the caller's liquid key balance at the time of voting
- Each wallet can vote once per poll — subsequent vote calls update the vote (change of mind allowed before expiry)
- Reverts with
PollExpired after expiry
- Reverts with
NotAHolder if liquid balance is zero
- Add
get_poll_result(creator_id, poll_id) -> PollResult view returning: { question, options, vote_counts: Vec<u32>, total_weight, expired }
Acceptance Criteria
ETA: 24 hours
Coordinate on Telegram
Summary
Creators need a way to ask their community a question and get a verifiable on-chain result. A governance poll lets a creator post a question with up to four options. Key holders vote, weighted by their liquid key balance at the time of voting. The result is readable from the contract so anyone can verify the outcome without trusting the creator or the client.
Scope
create_poll(creator_id, question: String, options: Vec<String>, duration_ledgers: u32) -> u32callable only by the creatorpoll_idquestionmax 280 characterscurrent_ledger + duration_ledgerscast_vote(creator_id, poll_id, option_index: u32)callable by any key holderPollExpiredafter expiryNotAHolderif liquid balance is zeroget_poll_result(creator_id, poll_id) -> PollResultview returning:{ question, options, vote_counts: Vec<u32>, total_weight, expired }Acceptance Criteria
PollExpiredNotAHolderget_poll_resultreturns correct weighted vote countsETA: 24 hours
Coordinate on Telegram