Skip to content

Commit

Permalink
check that the owners of registry accounts are system accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
samkim-crypto committed Oct 22, 2024
1 parent 091f6d8 commit 9672a6e
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use {
program_error::ProgramError,
pubkey::Pubkey,
rent::Rent,
system_instruction,
system_instruction, system_program,
sysvar::Sysvar,
},
solana_zk_sdk::zk_elgamal_proof_program::proof_data::pubkey_validity::{
Expand All @@ -35,6 +35,10 @@ pub fn process_create_registry_account(
let wallet_account_info = next_account_info(account_info_iter)?;
let system_program_info = next_account_info(account_info_iter)?;

if wallet_account_info.owner != &system_program::id() {
return Err(ProgramError::IncorrectProgramId);
}

if !wallet_account_info.is_signer {
return Err(ProgramError::MissingRequiredSignature);
}
Expand Down

0 comments on commit 9672a6e

Please sign in to comment.