Skip to content

Commit

Permalink
update gov params as part of moving to phase 5
Browse files Browse the repository at this point in the history
  • Loading branch information
brentstone committed Aug 27, 2024
1 parent dd43c2a commit 5ab3352
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions nam_party/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down Expand Up @@ -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(())
}

0 comments on commit 5ab3352

Please sign in to comment.