Skip to content

Commit

Permalink
3.0.16: add feature to change base denom.
Browse files Browse the repository at this point in the history
add archway
  • Loading branch information
PFC-developer committed May 5, 2024
1 parent 432c0b2 commit def0b49
Show file tree
Hide file tree
Showing 11 changed files with 71 additions and 8 deletions.
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion contracts/hub-tf/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pfc-steak-hub-tf"
version = "3.0.15"
version = "3.0.16"
authors = ["larry <[email protected]>", "PFC <[email protected]>"]
edition = "2018"
license = "GPL-3.0-or-later"
Expand Down
1 change: 1 addition & 0 deletions contracts/hub-tf/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ pub fn execute(deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg) -> S
ExecuteMsg::ReturnDenom {} => {
execute::bond(deps, env, info.sender, info.funds, None, false)
},
ExecuteMsg::SetBaseDenom {new_denom} => execute::set_base_denom(deps,info.sender,new_denom),
ExecuteMsg::ChangeTokenFactory {
token_factory_type,
} => execute::change_token_factory(deps, info.sender, &token_factory_type),
Expand Down
15 changes: 15 additions & 0 deletions contracts/hub-tf/src/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1185,6 +1185,21 @@ pub fn redelegate(
.add_event(event)
.add_attribute("action", "steakhub/redelegate"))
}
pub fn set_base_denom(
deps: DepsMut,
sender: Addr,
new_denom: String,
) -> StdResult<Response> {
let state = State::default();

state.assert_owner(deps.storage, &sender)?;
state.denom.save(deps.storage, &new_denom)?;

let event = Event::new("steak/set_base_denom")
.add_attribute("base_denom", new_denom);

Ok(Response::new().add_event(event).add_attribute("action", "steakhub/set_base_denom"))
}

pub fn change_token_factory(
deps: DepsMut,
Expand Down
2 changes: 1 addition & 1 deletion contracts/hub/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pfc-steak-hub"
version = "3.0.15"
version = "3.0.16"
authors = ["larry <[email protected]>", "PFC <[email protected]>"]
edition = "2018"
license = "GPL-3.0-or-later"
Expand Down
1 change: 1 addition & 0 deletions contracts/hub/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ pub fn execute(deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg) -> S
}
},
ExecuteMsg::ReturnDenom {} => execute::return_denom(deps, env, info.funds),
ExecuteMsg::SetBaseDenom {new_denom} => execute::set_base_denom(deps,info.sender, new_denom)
}
}

Expand Down
15 changes: 15 additions & 0 deletions contracts/hub/src/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1033,6 +1033,21 @@ pub fn collect_dust(deps: DepsMut, _env: Env, _max_tokens: usize) -> StdResult<R
Err(StdError::generic_err("No dust collector set"))
}
}
pub fn set_base_denom(
deps: DepsMut,
sender: Addr,
new_denom: String,
) -> StdResult<Response> {
let state = State::default();

state.assert_owner(deps.storage, &sender)?;
state.denom.save(deps.storage, &new_denom)?;

let event = Event::new("steak/set_base_denom")
.add_attribute("base_denom", new_denom);

Ok(Response::new().add_event(event).add_attribute("action", "steakhub/set_base_denom"))
}

pub fn return_denom(deps: DepsMut, _env: Env, _funds: Vec<Coin>) -> StdResult<Response> {
let state = State::default();
Expand Down
23 changes: 23 additions & 0 deletions init/archway_hub_init.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"cw20_code_id": 446,
"owner": "archway1lu92zj8q6cmrptu09rp3343x9969r9qrg72hzj",
"name": "boneARCH Token",
"symbol": "boneARCH",
"decimals": 18,
"epoch_period": 259200,
"unbond_period": 1814400,
"validators": [
"archwayvaloper1cz6unq70w0sdm2gwghv8m4uqmhwxz5x4adam88"
],
"denom": "aarch",
"fee_account": "archway1pzjprqczpn0fvn5kvqzs74mggg4539rt2vpmp07ffp3pufp6cc3qqmhdg3",
"fee_amount": "0.10",
"max_fee_amount": "0.10",
"fee_account_type": "FeeSplit",
"label": "boneARCH",
"marketing": {
"project": "https://backbonelabs.io",
"description": "The GraveDigger is the Liquid Staking Product of BackBone Labs. It's liquid staking derivative (LSD) is boneARCH.",
"marketing": "archway1lu92zj8q6cmrptu09rp3343x9969r9qrg72hzj"
}
}
2 changes: 1 addition & 1 deletion packages/steak/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pfc-steak"
version = "3.0.15"
version = "3.0.16"
authors = ["larry <[email protected]>", "PFC <[email protected]>"]
edition = "2018"
description = "Liquid steaking protocol for the cosmos"
Expand Down
4 changes: 4 additions & 0 deletions packages/steak/src/hub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ pub enum ExecuteMsg {
},
/// Return the Dust in shiny 'base denom'
ReturnDenom {},
/// admin: setBaseDenom - in case you muck up the init and need to change it
SetBaseDenom {
new_denom: String
}
}

#[derive(Serialize, Deserialize, Clone, Debug, Eq, PartialEq, JsonSchema)]
Expand Down
4 changes: 4 additions & 0 deletions packages/steak/src/hub_tf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ pub enum ExecuteMsg {
},
/// Return the Dust in shiny 'base denom'
ReturnDenom {},
/// admin: setBaseDenom - in case you muck up the init and need to change it
SetBaseDenom {
new_denom: String
},
/// change tokenfactory type (ADMIN only)
ChangeTokenFactory {
token_factory_type: String,
Expand Down

0 comments on commit def0b49

Please sign in to comment.