Setting an authority
Both the storage of Wasm light client byte code as well as the migration of an existing Wasm light client contract are permissioned (i.e. only allowed to an authority such as governance). The designated authority is specified when instantiating08-wasm
’s keeper: both NewKeeperWithVM
and NewKeeperWithConfig
constructor functions accept an authority
argument that must be the address of the authorized actor. For example, in app.go
, when instantiating the keeper, you can pass the address of the governance module:
Storing new Wasm light client byte code
If governance is the allowed authority, the governance v1 proposal that needs to be submitted to upload a new light client contract should contain the messageMsgStoreCode
with the base64-encoded byte code of the Wasm contract. Use the following CLI command and JSON as an example:
proposal.json
contains:
submit-proposal
CLI command, please check out the relevant section in Cosmos SDK documentation.
Alternatively, the process of submitting the proposal may be simpler if you use the CLI command store-code
. This CLI command accepts as argument the file of the Wasm light client contract and takes care of constructing the proposal message with MsgStoreCode
and broadcasting it.
Migrating an existing Wasm light client contract
If governance is the allowed authority, the governance v1 proposal that needs to be submitted to migrate an existing new Wasm light client contract should contain the messageMsgMigrateContract
with the checksum of the Wasm byte code to migrate to. Use the following CLI command and JSON as an example:
proposal.json
contains:
submit-proposal
CLI command, please check out the relevant section in Cosmos SDK documentation.
Removing an existing checksum
If governance is the allowed authority, the governance v1 proposal that needs to be submitted to remove a specific checksum from the list of allowed checksums should contain the messageMsgRemoveChecksum
with the checksum (of a corresponding Wasm byte code). Use the following CLI command and JSON as an example:
proposal.json
contains:
submit-proposal
CLI command, please check out the relevant section in Cosmos SDK documentation.