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

Commit 9672a6e

Browse files
committed
check that the owners of registry accounts are system accounts
1 parent 091f6d8 commit 9672a6e

File tree

1 file changed

+5
-1
lines changed
  • token/confidential-transfer/elgamal-registry/src

1 file changed

+5
-1
lines changed

token/confidential-transfer/elgamal-registry/src/processor.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use {
1313
program_error::ProgramError,
1414
pubkey::Pubkey,
1515
rent::Rent,
16-
system_instruction,
16+
system_instruction, system_program,
1717
sysvar::Sysvar,
1818
},
1919
solana_zk_sdk::zk_elgamal_proof_program::proof_data::pubkey_validity::{
@@ -35,6 +35,10 @@ pub fn process_create_registry_account(
3535
let wallet_account_info = next_account_info(account_info_iter)?;
3636
let system_program_info = next_account_info(account_info_iter)?;
3737

38+
if wallet_account_info.owner != &system_program::id() {
39+
return Err(ProgramError::IncorrectProgramId);
40+
}
41+
3842
if !wallet_account_info.is_signer {
3943
return Err(ProgramError::MissingRequiredSignature);
4044
}

0 commit comments

Comments
 (0)