Skip to content

Commit

Permalink
nibiru: use tf/ for token factory denom
Browse files Browse the repository at this point in the history
  • Loading branch information
0xphilipp committed Aug 22, 2024
1 parent f7cf61d commit b9c9939
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion contracts/hub/src/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ pub fn instantiate(
},
)?;

Ok(Response::new().add_message(chain.create_denom_msg(full_denom, sub_denom)))
Ok(Response::new()
.add_message(chain.create_denom_msg(full_denom.clone(), sub_denom))
.add_attribute("denom", full_denom))
}

//--------------------------------------------------------------------------------------------------
Expand Down
5 changes: 5 additions & 0 deletions packages/eris-nibiru/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ pub struct Chain {
}

impl ChainInterface<CustomMsgType, DenomType, WithdrawType, StageType, HubChainConfig> for Chain {
fn get_token_denom(&self, contract_addr: impl Into<String>, sub_denom: String) -> String {
format!("tf/{0}/{1}", contract_addr.into(), sub_denom)
}

fn create_denom_msg(&self, _full_denom: String, subdenom: String) -> CosmosMsg<CustomMsgType> {
MsgCreateDenom {
sender: self.contract.to_string(),
Expand All @@ -28,6 +32,7 @@ impl ChainInterface<CustomMsgType, DenomType, WithdrawType, StageType, HubChainC
) -> Vec<CosmosMsg<CustomMsgType>> {
vec![MsgMint {
sender: self.contract.to_string(),

amount: Some(crate::denom::Coin {
denom: full_denom.to_string(),
amount: amount.to_string(),
Expand Down

0 comments on commit b9c9939

Please sign in to comment.