123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- use anchor_lang::prelude::*;
- declare_id!("Eoiuq1dXvHxh6dLx3wh9gj8kSAUpga11krTrbfF5XYsC");
- mod state;
- mod instructions;
- mod error;
- mod constants;
- use instructions::*;
- use error::*;
- pub use constants::*;
- #[program]
- pub mod fundraiser {
- use super::*;
- pub fn initialize(ctx: Context<Initialize>, amount: u64, duration: u16) -> Result<()> {
- ctx.accounts.initialize(amount, duration, &ctx.bumps)?;
- Ok(())
- }
- pub fn contribute(ctx: Context<Contribute>, amount: u64) -> Result<()> {
- ctx.accounts.contribute(amount)?;
- Ok(())
- }
- pub fn check_contributions(ctx: Context<CheckContributions>) -> Result<()> {
- ctx.accounts.check_contributions()?;
- Ok(())
- }
- pub fn refund(ctx: Context<Refund>) -> Result<()> {
- ctx.accounts.refund()?;
- Ok(())
- }
- }
|