Skip to content

Commit

Permalink
Merge pull request #61 from neutron-org/feat/burn-different
Browse files Browse the repository at this point in the history
feat: allow to burn from different address in wasmbindings #ntrn-372
  • Loading branch information
pr0n00gler authored Aug 28, 2024
2 parents 0821807 + 080d64d commit 493f312
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

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

12 changes: 12 additions & 0 deletions contracts/tokenfactory/schema/execute_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@
},
"denom": {
"type": "string"
},
"mint_to_address": {
"type": [
"string",
"null"
]
}
},
"additionalProperties": false
Expand All @@ -89,6 +95,12 @@
"amount": {
"$ref": "#/definitions/Uint128"
},
"burn_from_address": {
"type": [
"string",
"null"
]
},
"denom": {
"type": "string"
}
Expand Down
21 changes: 15 additions & 6 deletions contracts/tokenfactory/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,21 @@ 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,
} => NeutronMsg::submit_burn_tokens(denom, amount, burn_from_address).into(),
ExecuteMsg::SetBeforeSendHook {
denom,
contract_addr,
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 493f312

Please sign in to comment.