Skip to content

Commit

Permalink
Fixed [P2-I-05] Check "reward_mint"
Browse files Browse the repository at this point in the history
by providing a check for the reward mint in the claim & fill_vault instructions.
  • Loading branch information
kstepanovdev committed Sep 27, 2024
1 parent 479f265 commit 67f6cca
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions programs/rewards/src/instructions/claim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ pub fn process_claim<'a>(program_id: &Pubkey, accounts: &'a [AccountInfo<'a>]) -
let reward_pool_data = &mut reward_pool.data.borrow_mut();
let wrapped_reward_pool = WrappedRewardPool::from_bytes_mut(reward_pool_data)?;

assert_account_key(reward_mint, &wrapped_reward_pool.pool.reward_mint)?;
assert_account_key(
deposit_authority,
&wrapped_reward_pool.pool.deposit_authority,
Expand Down
1 change: 1 addition & 0 deletions programs/rewards/src/instructions/fill_vault.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ pub fn process_fill_vault<'a>(
let wrapped_reward_pool = WrappedRewardPool::from_bytes_mut(reward_pool_data)?;

assert_account_key(fill_authority, &wrapped_reward_pool.pool.fill_authority)?;
assert_account_key(reward_mint, &wrapped_reward_pool.pool.reward_mint)?;

{
let vault_seeds = &[
Expand Down

0 comments on commit 67f6cca

Please sign in to comment.