From c43d180cb7fb1d0d975aa798bb69a31e1d415bc2 Mon Sep 17 00:00:00 2001 From: Vladimir Guguiev <1524432+vovacodes@users.noreply.github.com> Date: Sun, 24 Sep 2023 16:34:59 +0200 Subject: [PATCH] feat(batch_add_transaction): only creator of the batch can add txs to it --- .../src/instructions/batch_add_transaction.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/programs/squads_multisig_program/src/instructions/batch_add_transaction.rs b/programs/squads_multisig_program/src/instructions/batch_add_transaction.rs index d39b4190..685661cb 100644 --- a/programs/squads_multisig_program/src/instructions/batch_add_transaction.rs +++ b/programs/squads_multisig_program/src/instructions/batch_add_transaction.rs @@ -79,6 +79,7 @@ impl BatchAddTransaction<'_> { multisig, member, proposal, + batch, .. } = self; @@ -91,6 +92,8 @@ impl BatchAddTransaction<'_> { multisig.member_has_permission(member.key(), Permission::Initiate), MultisigError::Unauthorized ); + // Only batch creator can add transactions to it. + require!(member.key() == batch.creator, MultisigError::Unauthorized); // `proposal` require!(