Skip to content

Commit

Permalink
minors
Browse files Browse the repository at this point in the history
  • Loading branch information
Fraccaman committed May 27, 2024
1 parent b8f639e commit 719d650
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,12 @@ The reference code can be found in [shielding_party folder](./shielding_party/).

When the Namada community is confident that the network is stable, NAM transfers are enabled. All key protocol functionality is now live. From here on, new features and support for new assets can continue to be added by the community via on-chain governance.

The reference code can be found in [shielding_reward_party folder](./shielding_reward_party/).
The reference code can be found in [shielding_reward_party folder](./shielding_reward_party/).

# How to build
To generate the wasm artifacts that can be attached to the governance proposal, run:
```
earhtly +build
```

You can install `earthly` following the official guide [here](https://earthly.dev/get-earthly).
5 changes: 3 additions & 2 deletions block_party/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ fn apply_tx(ctx: &mut Ctx, _tx_data: BatchedTx) -> TxResult {

// PGF inflation
let pgf_inflation_key = governance::pgf::storage::keys::get_pgf_inflation_rate_key();
let pgf_inflation_rate = Dec::from_str("0.025").unwrap(); // set PGF inflaton inflation to 2.5%
let pgf_inflation_rate = Dec::from_str("0.025").unwrap();
ctx.write(&pgf_inflation_key, pgf_inflation_rate)?;

// PGF stewards inflation
let steward_inflation_key = governance::pgf::storage::keys::get_steward_inflation_rate_key();
let steward_inflation_rate = Dec::from_str("0.001").unwrap(); // set PGF stewards inflation to 0.01%
let steward_inflation_rate = Dec::from_str("0.001").unwrap();
ctx.write(&steward_inflation_key, steward_inflation_rate)?;

// Read the current transaction allowlist from storage
Expand All @@ -61,6 +61,7 @@ fn apply_tx(ctx: &mut Ctx, _tx_data: BatchedTx) -> TxResult {
] {
let tx_hash = CodeHash::sha256(wasm_bytes);

// make the update idempotent
if current_tx_allowlist.contains(&tx_hash.to_string()) {
continue;
}
Expand Down
3 changes: 3 additions & 0 deletions shielding_reward_party/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,12 @@ const IBC_TOKENS: [(

#[transaction]
fn apply_tx(ctx: &mut Ctx, _tx_data: BatchedTx) -> TxResult {
// Enable NAM transfers
let native_token_transferable_key = parameters_storage::get_native_token_transferable_key();
ctx.write(&native_token_transferable_key, true)?;

// Enable NAM to be transferable via IBC
// Enable NAM to get MASP rewards
for (
denomination,
channel_id,
Expand Down
8 changes: 1 addition & 7 deletions staking_party/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ const TX_TRANSFER_BYTES: &[u8] = include_bytes!(
"../../wasms/tx_transfer.8198890dbdf67bc93b16492496413c8140a273465f0f8f3ae091e5949a5ac4e0.wasm"
);

const TX_IBC_NAME: &str = "tx_ibc.wasm";
const TX_IBC_BYTES: &[u8] = include_bytes!(
"../../wasms/tx_ibc.2fac9cb9797cb01104cfe67f7b9693c76d9dfcad7e01f894fcbc0a7675bcb184.wasm"
);

const IBC_TOKENS: [(ChannelId, BaseToken, MintTokenLimit, ThroughtputTokenLimit); 2] = [
(
"channel-0",
Expand Down Expand Up @@ -55,8 +50,7 @@ fn apply_tx(ctx: &mut Ctx, _tx_data: BatchedTx) -> TxResult {

// Update the allowlist and write the addition wasm storage keys per transaction
for (wasm_name, wasm_bytes) in [
(TX_TRANSFER_NAME, TX_TRANSFER_BYTES),
(TX_IBC_NAME, TX_IBC_BYTES),
(TX_TRANSFER_NAME, TX_TRANSFER_BYTES)
] {
let tx_hash = CodeHash::sha256(wasm_bytes);

Expand Down

0 comments on commit 719d650

Please sign in to comment.