Create Proposal

Creating Proposal

On creating proposal, client need to direct the execution call to "Vote contract" as the target contract address.

const executionResponse = await client?.execute(userAddress, voteAddress, proposalPayload, 'auto');

Proposal Payload

The proposal payload will have "propose" as Json key and the json child will have 4 keys which are:

  • title (required)

  • description (required)

  • msgs (required): array of CosmosMsg json object

  • latest <optional>: to set expiration

const payload = {
    propose : {
      title,
      description,
      msgs: [
        cosmosWasmMsg,
      ],
    }
}

The CosmosMsg that client should pass as message is the json representation of WasmMsg::Execute. The reason is we need to forward call/exeuction to other contract which is instance of cw-ica-controller contract that will forward the call to be executed by ICA address in the target chain.

The WasmMsg::Execute json payload above will be executed by controllerAddress and the message inside it should have "send_cosmos_msgs" json key like below:

The content of messages array should be Stargate message that always have two json keys which are:

  • type_url

  • value

A Stargate message encoded the same way as a protobuf Any. This is the same structure as messages in TxBody from ADR-020

Last updated