Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion programs/amm/src/instructions/create_amm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub struct CreateAmm<'info> {
#[account(
init,
payer = user,
space = 8 + std::mem::size_of::<Amm>(),
space = 8 + Amm::INIT_SPACE,
seeds = [
AMM_SEED_PREFIX,
base_mint.key().as_ref(),
Expand Down
4 changes: 2 additions & 2 deletions programs/amm/src/state/amm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub enum SwapType {
Sell,
}

#[derive(Default, Clone, Copy, Debug, AnchorDeserialize, AnchorSerialize)]
#[derive(Default, Clone, Copy, Debug, AnchorDeserialize, AnchorSerialize, InitSpace)]
pub struct TwapOracle {
pub last_updated_slot: u64,
/// A price is the number of quote units per base unit multiplied by 1e12.
Expand Down Expand Up @@ -68,7 +68,7 @@ impl TwapOracle {
}

#[account]
#[derive(Default)]
#[derive(Default, InitSpace)]
pub struct Amm {
pub bump: u8,

Expand Down
2 changes: 1 addition & 1 deletion programs/autocrat/src/instructions/initialize_dao.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub struct InitializeDao<'info> {
#[account(
init,
payer = payer,
space = 8 + std::mem::size_of::<Dao>()
space = 8 + Dao::INIT_SPACE,
)]
pub dao: Account<'info, Dao>,
#[account(mut)]
Expand Down
3 changes: 2 additions & 1 deletion programs/autocrat/src/state/dao.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
pub use super::*;

#[account]
#[derive(InitSpace)]
pub struct Dao {
pub treasury_pda_bump: u8,
pub treasury: Pubkey,
Expand Down Expand Up @@ -38,4 +39,4 @@ pub struct Dao {
pub min_quote_futarchic_liquidity: u64,
pub min_base_futarchic_liquidity: u64,
pub seq_num: u64,
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub struct InitializeConditionalVault<'info> {
#[account(
init,
payer = payer,
space = 8 + std::mem::size_of::<ConditionalVault>() + (32 * question.num_outcomes()),
space = 8 + ConditionalVault::INIT_SPACE + (32 * question.num_outcomes()),
seeds = [
b"conditional_vault",
question.key().as_ref(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub struct InitializeQuestion<'info> {
#[account(
init,
payer = payer,
space = 8 + 32 + 32 + 1 + 4 + (args.num_outcomes as usize * 4) + 4,
space = 8 + Question::INIT_SPACE + (args.num_outcomes as usize * 4),
seeds = [
b"question",
args.question_id.as_ref(),
Expand Down
2 changes: 2 additions & 0 deletions programs/conditional_vault/src/state/conditional_vault.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ pub enum VaultStatus {
}

#[account]
#[derive(InitSpace)]
pub struct ConditionalVault {
pub question: Pubkey,
pub underlying_token_mint: Pubkey,
pub underlying_token_account: Pubkey,
#[max_len(0)]
pub conditional_token_mints: Vec<Pubkey>,
pub pda_bump: u8,
pub decimals: u8,
Expand Down
2 changes: 2 additions & 0 deletions programs/conditional_vault/src/state/question.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ use super::*;
///
/// Once resolved, the sum of all outcome resolutions is exactly 1.
#[account]
#[derive(InitSpace)]
pub struct Question {
pub question_id: [u8; 32],
pub oracle: Pubkey,
#[max_len(0)]
pub payout_numerators: Vec<u32>,
pub payout_denominator: u32,
}
Expand Down
2 changes: 1 addition & 1 deletion programs/launchpad/src/instructions/fund.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub struct Fund<'info> {
#[account(
init_if_needed,
payer = payer,
space = 8 + std::mem::size_of::<FundingRecord>(),
space = 8 + FundingRecord::INIT_SPACE,
seeds = [b"funding_record", launch.key().as_ref(), funder.key().as_ref()],
bump
)]
Expand Down
2 changes: 1 addition & 1 deletion programs/launchpad/src/instructions/initialize_launch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub struct InitializeLaunch<'info> {
#[account(
init,
payer = payer,
space = 8 + std::mem::size_of::<Launch>(),
space = 8 + Launch::INIT_SPACE,
seeds = [b"launch", token_mint.key().as_ref()],
bump
)]
Expand Down
1 change: 1 addition & 0 deletions programs/launchpad/src/state/funding_record.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use anchor_lang::prelude::*;

#[account]
#[derive(InitSpace)]
pub struct FundingRecord {
/// The PDA bump.
pub pda_bump: u8,
Expand Down
3 changes: 2 additions & 1 deletion programs/launchpad/src/state/launch.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use anchor_lang::prelude::*;

#[derive(AnchorSerialize, AnchorDeserialize, Clone, Copy, PartialEq, Eq)]
#[derive(AnchorSerialize, AnchorDeserialize, Clone, Copy, PartialEq, Eq, InitSpace)]
pub enum LaunchState {
Initialized,
Live,
Expand All @@ -9,6 +9,7 @@ pub enum LaunchState {
}

#[account]
#[derive(InitSpace)]
pub struct Launch {
/// The PDA bump.
pub pda_bump: u8,
Expand Down
Loading