Skip to content

Commit

Permalink
feat: pass through burn_from_address and mint_to_address
Browse files Browse the repository at this point in the history
  • Loading branch information
NeverHappened committed Aug 1, 2024
1 parent 0406eae commit c931dd4
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 5 deletions.
12 changes: 12 additions & 0 deletions contracts/tokenfactory/schema/execute_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@
},
"denom": {
"type": "string"
},
"mint_to_address": {
"type": [
"string",
"null"
]
}
}
}
Expand All @@ -86,6 +92,12 @@
"amount": {
"$ref": "#/definitions/Uint128"
},
"burn_from_address": {
"type": [
"string",
"null"
]
},
"denom": {
"type": "string"
}
Expand Down
27 changes: 22 additions & 5 deletions contracts/tokenfactory/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,28 @@ pub fn execute(
denom,
new_admin_address,
} => NeutronMsg::submit_change_admin(denom, new_admin_address).into(),
ExecuteMsg::MintTokens { denom, amount } => {
NeutronMsg::submit_mint_tokens(denom, amount, env.contract.address).into()
}
ExecuteMsg::BurnTokens { denom, amount } => {
NeutronMsg::submit_burn_tokens(denom, amount).into()
ExecuteMsg::MintTokens {
denom,
amount,
mint_to_address,
} => NeutronMsg::submit_mint_tokens(
denom,
amount,
mint_to_address.unwrap_or(env.contract.address.into()),
)
.into(),
ExecuteMsg::BurnTokens {
denom,
amount,
burn_from_address,
} => {
// TODO: update neutron-sdk `submit_burn_tokens`
NeutronMsg::BurnTokens {
denom,
amount,
burn_from_address: burn_from_address.unwrap_or_default(),
}
.into()
}
ExecuteMsg::SetBeforeSendHook {
denom,
Expand Down
2 changes: 2 additions & 0 deletions contracts/tokenfactory/src/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ pub enum ExecuteMsg {
MintTokens {
denom: String,
amount: Uint128,
mint_to_address: Option<String>,
},
BurnTokens {
denom: String,
amount: Uint128,
burn_from_address: Option<String>,
},
SendTokens {
recipient: String,
Expand Down

0 comments on commit c931dd4

Please sign in to comment.