On-chain voting on proposals with quorum requirements. Members create proposals, vote for or against, and finalize outcomes after the voting period ends.
DAO decision-making with transparent vote tallies
Community governance for protocol parameters
Grant funding decisions with on-chain accountability
Parameter Type Description nameStringDAO name voting_periodu64Duration of each proposal's voting window (seconds) quorumu64Minimum total votes required for a proposal to be valid
Method Parameters Description initializename, voting_period, quorumSet up the DAO. Only callable once. proposetitle: String, description: StringCreate a new proposal. Returns proposal ID. voteproposal_id: u64, support: boolVote for (true) or against (false) a proposal. One vote per address. finalizeproposal_id: u64End voting on a proposal. Sets status to Passed, Rejected, or Expired.
Method Parameters Returns Description get_config-- GovConfigDAO configuration get_proposalproposal_id: u64GovProposalFull proposal details get_proposal_count-- u64Total number of proposals get_voteproposal_id: u64, voter: Addressu8Vote status: 0=not voted, 1=for, 2=against
pub enum ProposalStatus {
Active , // Voting is open
Passed , // Quorum met, more for-votes than against
Rejected , // Quorum met, more against-votes than for
Expired , // Voting period ended without quorum
}
pub struct GovConfig {
pub creator : Address ,
pub name : String ,
pub voting_period : u64 ,
pub quorum : u64 ,
pub created_at : u64 ,
}
pub struct GovProposal {
pub id : u64 ,
pub proposer : Address ,
pub title : String ,
pub description : String ,
pub for_votes : u64 ,
pub against_votes : u64 ,
pub start_time : u64 ,
pub end_time : u64 ,
pub status : ProposalStatus ,
}
# Deploy
norn wallet deploy-loom --name my-dao
# Upload bytecode
norn wallet upload-bytecode --loom-id < LOOM_I D > \
--bytecode governance.wasm
# Execute (borsh-encoded input)
norn wallet execute-loom --loom-id < LOOM_I D > --input < HE X >
# Query config
norn wallet query-loom --loom-id < LOOM_I D >