堆栈错误导致在 solana 上使用锚点

Stack error caused working with anchor on solana

我正在用anchor框架开发solana的链上程序
但我因堆栈错误而崩溃。

#[derive(Accounts)]
pub struct ClaimNftContext<'info> {
    #[account(mut)]
    pool: Account<'info, Pool>,
    pool_signer: AccountInfo<'info>,
    vault: AccountInfo<'info>, 
    user: Signer<'info>,
    mint: Account<'info, Mint>,
    #[account(mut)]
    nft_from: Account<'info, TokenAccount>,
    #[account(mut)]
    nft_to: Box<Account<'info, TokenAccount>>,
    #[account(mut)]
    token_from: Account<'info, TokenAccount>, 
    #[account(mut)]
    token_to: Account<'info, TokenAccount>, 
    token_program: Program<'info, Token>
}

如您所见,ClaimNftContext 中有 10 个帐户,但如果我删除一个,则没有错误。
我认为 anchor 中的堆栈大小是有限的。
我该怎么办?

Anchor 的筹码量有限。
那是不是不可能从上下文中得到9个以上的账号?
幸运的是,有一种方法可以减少堆栈。
那是盒子。
我们可以这样使用:

token_from: 框<帐户信息<'信息>> 然后我们可以获得更多的帐户。