diff --git a/programs/multisig/src/lib.rs b/programs/multisig/src/lib.rs index c25e286..8e87094 100644 --- a/programs/multisig/src/lib.rs +++ b/programs/multisig/src/lib.rs @@ -154,6 +154,16 @@ pub mod serum_multisig { return Err(ErrorCode::AlreadyExecuted.into()); } + // Is this wallet a owner of the multisig? + ctx + .accounts + .multisig + .owners + .iter() + .position(|a| a == ctx.accounts.owner.key) + .ok_or(ErrorCode::InvalidOwner)?; + + // Do we have enough signers. let sig_count = ctx .accounts @@ -239,6 +249,8 @@ pub struct ExecuteTransaction<'info> { multisig_signer: UncheckedAccount<'info>, #[account(mut, has_one = multisig)] transaction: Box>, + // One of the multisig owners. Checked in the handler. + owner: Signer<'info>, } #[account]