Quantcast
Channel: Active questions tagged rustc - Solana Stack Exchange
Viewing all articles
Browse latest Browse all 37

Access violation in input section at address 0x400011cc0 of size 8

$
0
0

This program seems to work well, until I uncomment the treasury_account (need it to send funds from program account to user associated token account, and then I run into

...failed: Access violation in input section at address 0x400011cc0 of size 8"

I had similar issue to global_vote_account (holds data about all votes), which is why I boxed it, but boxing the treasury account doesnt seem to help.

#[derive(Accounts)]pub struct Initialize<'info> {    #[account(mut)]    pub signer: Signer<'info>,    #[account(        init_if_needed,        seeds = [constants::TREASURY_SEED],        bump,        payer = signer,        token::mint = mint,        token::authority = treasury_account    )]    pub treasury_account: Account<'info, TokenAccount>,    #[account(        init_if_needed,        seeds = [constants::GLOBAL_VOTE_SEED],        bump,        payer = signer,        space = 8 + std::mem::size_of::<GlobalVotes>()    )]    pub global_vote_account: Account<'info, GlobalVotes>,    pub mint: Account<'info, Mint>,    pub token_program: Program<'info, Token>,    pub system_program: Program<'info, System>,}#[derive(Accounts)]pub struct Vote<'info> {    #[account(mut)]    pub signer: Signer<'info>,    #[account(        mut,        seeds = [constants::GLOBAL_VOTE_SEED],        bump,    )]    pub global_vote_account: Box<Account<'info, GlobalVotes>>,     #[account(        init_if_needed,        seeds = [constants::VOTE_INFO_SEED, signer.key().as_ref()],        bump,        payer = signer,        space = 8 + std::mem::size_of::<VoteInfo>()    )]    pub vote_info_account: Account<'info, VoteInfo>,    #[account(        init_if_needed,        seeds = [constants::TOKEN_WALLET_SEED, signer.key().as_ref()],        bump,        payer = signer,        token::mint = mint,        token::authority = vote_account    )]    pub vote_account: Account<'info, TokenAccount>,    #[account(        mut,        associated_token::mint = mint,        associated_token::authority = signer,    )]    pub user_votewiftremp_account: Account<'info, TokenAccount>,    /*#[account(        mut,        seeds = [constants::TREASURY_SEED],        bump,    )]    pub treasury_account: Account<'info, TokenAccount>,*/    pub mint: Account<'info, Mint>,    pub token_program: Program<'info, Token>,    pub associated_token_program: Program<'info, AssociatedToken>,    pub system_program: Program<'info, System>,}

Viewing all articles
Browse latest Browse all 37

Trending Articles