Skip to content

Commit

Permalink
Adjusting direct_deposit.rs to follow token-2022 updates
Browse files Browse the repository at this point in the history
  • Loading branch information
codinghistorian committed Dec 9, 2024
1 parent 38d5377 commit 28e1dd5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions programs/tokenized_vault/src/instructions/direct_deposit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ pub struct DirectDeposit<'info> {
#[account(mut, seeds = [SHARES_SEED.as_bytes(), vault.key().as_ref()], bump)]
pub shares_mint: InterfaceAccount<'info, Mint>,

#[account(mut, address = vault.load()?.underlying_mint)]
pub underlying_mint: InterfaceAccount<'info, Mint>,

#[account(mut)]
pub user_shares_account: InterfaceAccount <'info, TokenAccount>,

Expand Down Expand Up @@ -89,6 +92,7 @@ pub fn handle_direct_deposit<'info>(ctx: Context<'_, '_, '_, 'info, DirectDeposi
ctx.accounts.user_token_account.to_account_info(),
ctx.accounts.vault_token_account.to_account_info(),
ctx.accounts.user.to_account_info(),
&ctx.accounts.underlying_mint,
amount,
)?;

Expand All @@ -98,6 +102,7 @@ pub fn handle_direct_deposit<'info>(ctx: Context<'_, '_, '_, 'info, DirectDeposi
ctx.accounts.strategy.to_account_info(),
ctx.accounts.vault.to_account_info(),
ctx.accounts.strategy_token_account.to_account_info(),
ctx.accounts.underlying_mint.to_account_info(),
ctx.accounts.vault_token_account.to_account_info(),
ctx.accounts.token_program.to_account_info(),
ctx.accounts.strategy_program.to_account_info(),
Expand Down

0 comments on commit 28e1dd5

Please sign in to comment.