Skip to content

Commit bfac91b

Browse files
committed
pause funding
1 parent 4226769 commit bfac91b

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

programs/drift/src/instructions/admin.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3261,12 +3261,20 @@ pub fn handle_update_perp_market_status(
32613261
perp_market_valid(&ctx.accounts.perp_market)
32623262
)]
32633263
pub fn handle_update_perp_market_paused_operations(
3264-
ctx: Context<AdminUpdatePerpMarket>,
3264+
ctx: Context<HotAdminUpdatePerpMarket>,
32653265
paused_operations: u8,
32663266
) -> Result<()> {
32673267
let perp_market = &mut load_mut!(ctx.accounts.perp_market)?;
32683268
msg!("perp market {}", perp_market.market_index);
32693269

3270+
if *ctx.accounts.admin.key != ctx.accounts.state.admin {
3271+
validate!(
3272+
paused_operations == PerpOperation::UpdateFunding as u8,
3273+
ErrorCode::DefaultError,
3274+
"signer must be admin",
3275+
)?;
3276+
}
3277+
32703278
perp_market.paused_operations = paused_operations;
32713279

32723280
if perp_market.is_prediction_market() {

programs/drift/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1340,7 +1340,7 @@ pub mod drift {
13401340
}
13411341

13421342
pub fn update_perp_market_paused_operations(
1343-
ctx: Context<AdminUpdatePerpMarket>,
1343+
ctx: Context<HotAdminUpdatePerpMarket>,
13441344
paused_operations: u8,
13451345
) -> Result<()> {
13461346
handle_update_perp_market_paused_operations(ctx, paused_operations)

0 commit comments

Comments
 (0)