Skip to content
This repository was archived by the owner on Jan 24, 2025. It is now read-only.

fix: read token_account from bumps #589

Closed
wants to merge 1 commit into from
Closed
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
5 changes: 1 addition & 4 deletions content/courses/program-security/owner-checks.md
Original file line number Diff line number Diff line change
Expand Up @@ -511,10 +511,7 @@ pub mod owner_check {
pub fn secure_withdraw(ctx: Context<SecureWithdraw>) -> Result<()> {
let amount = ctx.accounts.token_account.amount;

let seeds = &[
b"token".as_ref(),
&[*ctx.bumps.get("token_account").unwrap()],
];
let seeds = &[b"token".as_ref(), &[ctx.bumps.token_account]];
let signer = [&seeds[..]];

let cpi_ctx = CpiContext::new_with_signer(
Expand Down
Loading