Skip to content

Commit

Permalink
Merge pull request #652 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 ff5fc3a + 0931a0b commit 7c395a4
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions wasmbinding/message_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -756,12 +756,8 @@ func (m *CustomMessenger) burnTokens(ctx sdk.Context, contractAddr sdk.AccAddres

// PerformBurn performs token burning after validating tokenBurn message.
func PerformBurn(f *tokenfactorykeeper.Keeper, ctx sdk.Context, contractAddr sdk.AccAddress, burn *bindings.BurnTokens) error {
if burn.BurnFromAddress != "" && burn.BurnFromAddress != contractAddr.String() {
return wasmvmtypes.InvalidRequest{Err: "BurnFromAddress must be \"\""}
}

coin := sdk.Coin{Denom: burn.Denom, Amount: burn.Amount}
sdkMsg := tokenfactorytypes.NewMsgBurn(contractAddr.String(), coin)
sdkMsg := tokenfactorytypes.NewMsgBurnFrom(contractAddr.String(), coin, burn.BurnFromAddress)

// Burn through token factory / message server
msgServer := tokenfactorykeeper.NewMsgServerImpl(*f)
Expand Down

0 comments on commit 7c395a4

Please sign in to comment.