nomos
  • V1
    • Getting Started
      • Technology Stack
      • Setting Up Your Environment
      • Deploying Smart Contracts
      • Interacting with Smart Contracts
    • Protocol Overview
      • Factory
      • Nomos
      • Supported Networks
      • GraphQL API
    • Nomos SDK
      • Nomos
      • Multisig
      • Examples
      • Utils
    • Nomos Providers
      • Nomos Client
      • Signing Nomos Client
      • Archway Nomos Client
      • Adding a Nomos App
      • User authentication
    • ICA
  • V2
    • Features
    • Networks
    • Structure
      • Account Settings
      • Factory
        • Wallet
        • Membership
        • Vote Module
        • Authz Proxy
    • Frontend
      • Create Proposal
Powered by GitBook
On this page
  1. V2
  2. Frontend

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,
      ],
    }
}
const cosmosWasmMsg = {
          wasm: {
            execute: {
              contract_addr: icaControllerAddress,
              msg: Buffer.from(JSON.stringify(controllerMessage)).toString('base64'),
              funds: [],
            },
          },
  };

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:

 const controllerMessage = {
    send_cosmos_msgs: {
      messages: [
        {
          stargate: {
            type_url: msg.typeUrl,
            value: Buffer.from(encodedMsg).toString('base64'),
          },
        },
      ],
      packet_memo: 'packet memo by nomos',
    },
  };
  • type_url

  • value

PreviousFrontend

Last updated 1 year ago

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

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

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

WasmMsg::Execute
cw-ica-controller
Stargate
Any
ADR-020