diff --git a/CHANGELOG.md b/CHANGELOG.md index bf6aeedd5e..d0efa661ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -57,6 +57,8 @@ and this project adheres to - cosmwasm-std: Replace `HumanAddr` with `String` in `BankQuery`, `StakingQuery` and `WasmQuery` query requests. - cosmwasm-vm: Add import `addr_validate` ([#802]). +- cosmwasm-std: Add `BankMsg::Burn` variant when you want the tokens to + disappear ([#860]) [#692]: https://github.com/CosmWasm/cosmwasm/issues/692 [#706]: https://github.com/CosmWasm/cosmwasm/pull/706 @@ -68,6 +70,7 @@ and this project adheres to [#793]: https://github.com/CosmWasm/cosmwasm/pull/793 [#796]: https://github.com/CosmWasm/cosmwasm/pull/796 [#802]: https://github.com/CosmWasm/cosmwasm/pull/802 +[#860]: https://github.com/CosmWasm/cosmwasm/pull/860 ### Changed diff --git a/contracts/ibc-reflect-send/schema/execute_msg.json b/contracts/ibc-reflect-send/schema/execute_msg.json index dfc8c5988d..4a3a5dac7b 100644 --- a/contracts/ibc-reflect-send/schema/execute_msg.json +++ b/contracts/ibc-reflect-send/schema/execute_msg.json @@ -129,6 +129,30 @@ } }, "additionalProperties": false + }, + { + "description": "This will burn the given coins from the contract's account. There is no Cosmos SDK message that performs this, but it can be done by calling the bank keeper. Important if a contract controls significant token supply that must be retired.", + "type": "object", + "required": [ + "burn" + ], + "properties": { + "burn": { + "type": "object", + "required": [ + "amount" + ], + "properties": { + "amount": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + } + } + } + }, + "additionalProperties": false } ] }, diff --git a/contracts/ibc-reflect-send/schema/packet_msg.json b/contracts/ibc-reflect-send/schema/packet_msg.json index 167f9f556d..db0ee36d82 100644 --- a/contracts/ibc-reflect-send/schema/packet_msg.json +++ b/contracts/ibc-reflect-send/schema/packet_msg.json @@ -82,6 +82,30 @@ } }, "additionalProperties": false + }, + { + "description": "This will burn the given coins from the contract's account. There is no Cosmos SDK message that performs this, but it can be done by calling the bank keeper. Important if a contract controls significant token supply that must be retired.", + "type": "object", + "required": [ + "burn" + ], + "properties": { + "burn": { + "type": "object", + "required": [ + "amount" + ], + "properties": { + "amount": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + } + } + } + }, + "additionalProperties": false } ] }, diff --git a/contracts/ibc-reflect/schema/packet_msg.json b/contracts/ibc-reflect/schema/packet_msg.json index 9fc4c1890c..612be54734 100644 --- a/contracts/ibc-reflect/schema/packet_msg.json +++ b/contracts/ibc-reflect/schema/packet_msg.json @@ -81,6 +81,30 @@ } }, "additionalProperties": false + }, + { + "description": "This will burn the given coins from the contract's account. There is no Cosmos SDK message that performs this, but it can be done by calling the bank keeper. Important if a contract controls significant token supply that must be retired.", + "type": "object", + "required": [ + "burn" + ], + "properties": { + "burn": { + "type": "object", + "required": [ + "amount" + ], + "properties": { + "amount": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + } + } + } + }, + "additionalProperties": false } ] }, diff --git a/contracts/reflect/schema/execute_msg.json b/contracts/reflect/schema/execute_msg.json index 1be850d27e..c80689fe65 100644 --- a/contracts/reflect/schema/execute_msg.json +++ b/contracts/reflect/schema/execute_msg.json @@ -100,6 +100,30 @@ } }, "additionalProperties": false + }, + { + "description": "This will burn the given coins from the contract's account. There is no Cosmos SDK message that performs this, but it can be done by calling the bank keeper. Important if a contract controls significant token supply that must be retired.", + "type": "object", + "required": [ + "burn" + ], + "properties": { + "burn": { + "type": "object", + "required": [ + "amount" + ], + "properties": { + "amount": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + } + } + } + }, + "additionalProperties": false } ] }, diff --git a/contracts/reflect/schema/response_for__custom_msg.json b/contracts/reflect/schema/response_for__custom_msg.json index 24bb6b74fc..1622956220 100644 --- a/contracts/reflect/schema/response_for__custom_msg.json +++ b/contracts/reflect/schema/response_for__custom_msg.json @@ -88,6 +88,30 @@ } }, "additionalProperties": false + }, + { + "description": "This will burn the given coins from the contract's account. There is no Cosmos SDK message that performs this, but it can be done by calling the bank keeper. Important if a contract controls significant token supply that must be retired.", + "type": "object", + "required": [ + "burn" + ], + "properties": { + "burn": { + "type": "object", + "required": [ + "amount" + ], + "properties": { + "amount": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + } + } + } + }, + "additionalProperties": false } ] }, diff --git a/packages/std/schema/cosmos_msg.json b/packages/std/schema/cosmos_msg.json index f087876f08..255188a3f0 100644 --- a/packages/std/schema/cosmos_msg.json +++ b/packages/std/schema/cosmos_msg.json @@ -82,6 +82,30 @@ } }, "additionalProperties": false + }, + { + "description": "This will burn the given coins from the contract's account. There is no Cosmos SDK message that performs this, but it can be done by calling the bank keeper. Important if a contract controls significant token supply that must be retired.", + "type": "object", + "required": [ + "burn" + ], + "properties": { + "burn": { + "type": "object", + "required": [ + "amount" + ], + "properties": { + "amount": { + "type": "array", + "items": { + "$ref": "#/definitions/Coin" + } + } + } + } + }, + "additionalProperties": false } ] }, diff --git a/packages/std/src/results/cosmos_msg.rs b/packages/std/src/results/cosmos_msg.rs index 9c61c36c1c..234b87dc3f 100644 --- a/packages/std/src/results/cosmos_msg.rs +++ b/packages/std/src/results/cosmos_msg.rs @@ -51,6 +51,10 @@ pub enum BankMsg { to_address: String, amount: Vec, }, + /// This will burn the given coins from the contract's account. + /// There is no Cosmos SDK message that performs this, but it can be done by calling the bank keeper. + /// Important if a contract controls significant token supply that must be retired. + Burn { amount: Vec }, } /// The message types of the staking module.