This is a DAO voting program built using Anchor. The program allows users to create proposals, vote on them, and reward participation using reward points. Optionally, privacy voting can be implemented using Zero-Knowledge (ZK) proofs or verifiable compute.
This program is a decentralized autonomous organization (DAO) voting system built on the Solana blockchain using the Anchor framework. Users can create proposals, vote on them, and receive reward points for their participation.
To install the required dependencies, run the following commands:
# Clone the repository
git clone https://github.com/yourusername/dao-voting.git
# Change to the project directory
cd dao-voting
# Install the necessary dependencies
anchor build
anchor deployTo create a proposal, use the create_proposal instruction. You need to provide a title and description for the proposal.
pub fn create_proposal(
ctx: Context<CreateProposal>,
title: String,
description: String,
) -> Result<()> {
create_proposal_handler(ctx, title, description)
}To vote on a proposal, use the vote instruction. You need to provide the proposal title and your vote (true for yes, false for no).
pub fn vote(ctx: Context<Vote>, title: String, vote: bool) -> Result<()> {
vote_handler(ctx, title, vote)
}To reward participation, use the reward_participation instruction. You need to provide the public key of the voter.
pub fn reward_participation(
ctx: Context<RewardParticipation>,
voter_pubkey: Pubkey,
) -> Result<()> {
reward_participation_handler(ctx, voter_pubkey)
}To run the tests, use the following command:
anchor test