From b58064a4e17668c1ed8e58aad49cdbfea4145e7a Mon Sep 17 00:00:00 2001 From: Reinis Martinsons Date: Mon, 6 Jan 2025 12:33:20 +0000 Subject: [PATCH] fix(svm): N-04 reset use of PDA signer in multicall handler Signed-off-by: Reinis Martinsons --- programs/multicall-handler/src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/programs/multicall-handler/src/lib.rs b/programs/multicall-handler/src/lib.rs index 2af2b4bc3..8755bf411 100644 --- a/programs/multicall-handler/src/lib.rs +++ b/programs/multicall-handler/src/lib.rs @@ -17,11 +17,13 @@ pub mod multicall_handler { pub fn handle_v3_across_message(ctx: Context, message: Vec) -> Result<()> { // Some instructions might require being signed by handler PDA. let (handler_signer, bump) = Pubkey::find_program_address(&[b"handler_signer"], &crate::ID); - let mut use_handler_signer = false; let compiled_ixs: Vec = AnchorDeserialize::deserialize(&mut &message[..])?; for compiled_ix in compiled_ixs { + // Will only sign with handler PDA if it is included in this instruction's accounts (checked below). + let mut use_handler_signer = false; + let mut accounts = Vec::with_capacity(compiled_ix.account_key_indexes.len()); let mut account_infos = Vec::with_capacity(compiled_ix.account_key_indexes.len());