From 3052d2e2fff8dc7cedcb4da59dbb1a3209d9eb6b Mon Sep 17 00:00:00 2001 From: microwavedcola1 Date: Mon, 19 Aug 2024 07:27:20 +0200 Subject: [PATCH] program: remove ununused code, fix from audit Signed-off-by: microwavedcola1 --- programs/mango-v4/src/instructions/token_liq_bankruptcy.rs | 1 + programs/mango-v4/src/state/group.rs | 5 ----- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/programs/mango-v4/src/instructions/token_liq_bankruptcy.rs b/programs/mango-v4/src/instructions/token_liq_bankruptcy.rs index cd04dec11..430b3b0d4 100644 --- a/programs/mango-v4/src/instructions/token_liq_bankruptcy.rs +++ b/programs/mango-v4/src/instructions/token_liq_bankruptcy.rs @@ -28,6 +28,7 @@ pub fn token_liq_bankruptcy( // find the insurance bank token index let insurance_mint = ctx.accounts.insurance_vault.mint; + require_keys_eq!(insurance_mint, group.insurance_mint); let insurance_token_index = health_ais .iter() .find_map(|ai| { diff --git a/programs/mango-v4/src/state/group.rs b/programs/mango-v4/src/state/group.rs index 665f67b5d..f4b4c8bed 100644 --- a/programs/mango-v4/src/state/group.rs +++ b/programs/mango-v4/src/state/group.rs @@ -12,11 +12,6 @@ pub type TokenIndex = u16; /// incorrect assumption. pub const QUOTE_TOKEN_INDEX: TokenIndex = 0; -/// The token index used for the insurance fund. -/// -/// We should eventually generalize insurance funds. -pub const INSURANCE_TOKEN_INDEX: TokenIndex = 0; - /// The token index used for settling perp markets. /// /// We should eventually generalize to make the whole perp quote (and settle) token