From af524974dce6d0d6bcc95d82684f9651547ffb6f Mon Sep 17 00:00:00 2001 From: Jon Gurary Date: Wed, 16 Oct 2024 13:10:47 -0400 Subject: [PATCH] Add cargo feature flag for mainnet wallet check --- programs/marginfi/Cargo.toml | 1 + .../src/instructions/marginfi_group/init_global_fee_state.rs | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/programs/marginfi/Cargo.toml b/programs/marginfi/Cargo.toml index bd5feb6f7..895e67ae4 100644 --- a/programs/marginfi/Cargo.toml +++ b/programs/marginfi/Cargo.toml @@ -22,6 +22,7 @@ devnet = [] mainnet-beta = [] debug = [] staging = [] +fee-deploy = [] [dependencies] solana-program = { workspace = true } diff --git a/programs/marginfi/src/instructions/marginfi_group/init_global_fee_state.rs b/programs/marginfi/src/instructions/marginfi_group/init_global_fee_state.rs index 6572f7873..ec47a0a21 100644 --- a/programs/marginfi/src/instructions/marginfi_group/init_global_fee_state.rs +++ b/programs/marginfi/src/instructions/marginfi_group/init_global_fee_state.rs @@ -15,9 +15,8 @@ pub fn initialize_fee_state( program_fee_rate: WrappedI80F48, ) -> Result<()> { let mut fee_state = ctx.accounts.fee_state.load_init()?; - // On mainnet we always use the mrgn program multisig. On other networks, configurable. cfg_if::cfg_if! { - if #[cfg(feature = "mainnet-beta")] { + if #[cfg(all(feature = "mainnet-beta", feature = "fee-deploy"))] { if ctx.accounts.payer.key != &pubkey!("3HGdGLrnK9DsnHi1mCrUMLGfQHcu6xUrXhMY14GYjqvM"){ panic!("The mrgn program multisig must sign on mainnet.") }