Initial commit

This commit is contained in:
stackclass
2025-09-07 10:51:18 +00:00
commit 39acad2d76
17 changed files with 2181 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
[package]
name = "voting-program"
version = "0.1.0"
description = "Solana voting program"
edition = "2021"
[lib]
crate-type = ["cdylib", "lib"]
[dependencies]
anchor-lang = { version = "0.30.1", features = ["init-if-needed"] }

View File

@@ -0,0 +1,42 @@
use anchor_lang::prelude::*;
declare_id!("Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS");
#[program]
pub mod voting_program {
use super::*;
pub fn initialize_proposal(
ctx: Context<InitializeProposal>,
title: String,
options: Vec<String>,
) -> Result<()> {
// Students will implement this function
Ok(())
}
pub fn vote(ctx: Context<Vote>, option_index: u32) -> Result<()> {
// Students will implement this function
Ok(())
}
}
#[account]
pub struct Proposal {
// Students will complete this struct
}
#[derive(Accounts)]
pub struct InitializeProposal<'info> {
// Students will complete this struct
}
#[derive(Accounts)]
pub struct Vote<'info> {
// Students will complete this struct
}
#[error_code]
pub enum VotingError {
// Students will define error codes
}