We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Tier-Based Reward Logic
Definition of Done:
Tasks:
Code Example:
#[account] pub struct Tier { pub campaign: Pubkey, // Associated campaign pub title: String, // Tier title pub price: u64, // Tier price in lamports pub max_backers: u32, // Maximum number of backers pub current_backers: u32, // Current number of backers } #[derive(Accounts)] pub struct CreateTier<'info> { #[account(mut)] pub campaign: Account<'info, Campaign>, #[account(init, payer = creator, space = 8 + Tier::MAX_SIZE, seeds = [b"tier", campaign.key().as_ref(), title.as_bytes()], bump)] pub tier: Account<'info, Tier>, #[account(mut)] pub creator: Signer<'info>, pub system_program: Program<'info, System>, } pub fn create_tier( ctx: Context<CreateTier>, title: String, price: u64, max_backers: u32, ) -> Result<()> { let tier = &mut ctx.accounts.tier; tier.campaign = ctx.accounts.campaign.key(); tier.title = title; tier.price = price; tier.max_backers = max_backers; tier.current_backers = 0; Ok(()) }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Add Tier-Based Reward Logic
Definition of Done:
Tasks:
Code Example:
The text was updated successfully, but these errors were encountered: