We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 75be44a commit dcea66dCopy full SHA for dcea66d
programs/8-pda-sharing/secure/src/lib.rs
@@ -13,6 +13,13 @@ pub mod pda_sharing_secure {
13
ctx.accounts.pool.withdraw_destination.as_ref(),
14
&[ctx.accounts.pool.bump],
15
];
16
+ let (address, expected_bump) = Pubkey::find_program_address(seeds, ctx.program_id);
17
+ if address != ctx.accounts.pool.key() {
18
+ return Err(ProgramError::InvalidArgument);
19
+ }
20
+ if expected_bump != ctx.accounts.pool.bump {
21
22
23
token::transfer(ctx.accounts.transfer_ctx().with_signer(&[seeds]), amount)
24
}
25
0 commit comments