From b54797be5db4bad35a12427fea94516270ea28ce Mon Sep 17 00:00:00 2001 From: brentstone Date: Mon, 26 Aug 2024 23:52:34 -0700 Subject: [PATCH] update gov params as part of moving to phase 5 --- nam_party/src/lib.rs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/nam_party/src/lib.rs b/nam_party/src/lib.rs index bd38ef9..cf36be0 100644 --- a/nam_party/src/lib.rs +++ b/nam_party/src/lib.rs @@ -8,15 +8,18 @@ pub const NAM_TARGET_LOCKED_AMOUNT: u64 = 1_000_000_000; pub const KP_GAIN: &str = "120000"; pub const KD_GAIN: &str = "120000"; +pub const MIN_PROPOSAL_GRACE_EPOCHS: u64 = 8; +pub const MIN_PROPOSAL_VOTING_PERIOD: u64 = 28; + #[transaction] fn apply_tx(ctx: &mut Ctx, _tx_data: BatchedTx) -> TxResult { let nam_address = ctx.get_native_token()?; - - // Enable NAM transfers + + // 1. Enable NAM transfers let native_token_transferable_key = parameters_storage::get_native_token_transferable_key(); ctx.write(&native_token_transferable_key, true)?; - // Enable NAM MASP rewards + // 2. Enable MASP rewards for NAM let shielded_token_last_inflation_key = token::storage_key::masp_last_inflation_key(&nam_address); let shielded_token_last_locked_amount_key = @@ -50,5 +53,12 @@ fn apply_tx(ctx: &mut Ctx, _tx_data: BatchedTx) -> TxResult { ctx.write(&shielded_token_kp_gain_key, Dec::from_str(KP_GAIN).unwrap())?; ctx.write(&shielded_token_kd_gain_key, Dec::from_str(KD_GAIN).unwrap())?; + // 3. Update governance parameters + let min_proposal_grace_epochs_key = gov_storage::keys::get_min_proposal_grace_epochs_key(); + ctx.write(&min_proposal_grace_epochs_key, MIN_PROPOSAL_GRACE_EPOCHS)?; + + let min_proposal_voting_period_key = gov_storage::keys::get_min_proposal_voting_period_key(); + ctx.write(&min_proposal_voting_period_key, MIN_PROPOSAL_VOTING_PERIOD)?; + Ok(()) }