Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions packages/std/src/results/cosmos_msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,33 @@ pub enum WasmMsg {
/// A human-readbale label for the contract, must be unique across all contracts
label: String,
},
/// Migrates a given contracts to use new wasm code. Passes a MigrateMsg to allow us to
/// customize behavior.
///
/// Only the contract admin (as defined in wasmd), if any, is able to make this call.
///
/// This is translated to a [MsgMigrateContract](https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto#L86-L96).
/// `sender` is automatically filled with the current contract's address.
Migrate {
contract_addr: String,
/// code_hash is the hex encoded hash of the **new** code. This is used by Secret Network to harden against replaying the contract
/// It is used to bind the request to a destination contract in a stronger way than just the contract address which can be faked
code_hash: String,
/// the code_id of the **new** logic to place in the given contract
code_id: u64,
/// msg is the json-encoded MigrateMsg struct that will be passed to the new code
#[derivative(Debug(format_with = "binary_to_string"))]
msg: Binary,
},
/// Sets a new admin (for migrate) on the given contract.
/// Fails if this contract is not currently admin of the target contract.
UpdateAdmin {
contract_addr: String,
admin: String,
},
/// Clears the admin on the given contract, so no more migration possible.
/// Fails if this contract is not currently admin of the target contract.
ClearAdmin { contract_addr: String },
}

#[cfg(feature = "stargate")]
Expand Down