Wasm

Send CosmWasm messages to the chain.

Available Commands

Command
Description

Executes a wasm message.

Instantiates a contract by code Id.

Migrate a contract.

Queries a contract.

Upload a contract wasm.

Execute

Executes a wasm message.

Usage

wasm execute <contract address> <message>

Flags

Flag
Description
Usage

funds

Funds to send with the message

--funds 100uandr

memo

An optional memo to attach to the message

--memo 'Wow what a great transaction!'

simulate

Simulates the transaction without broadcasting it. Useful to estimate gas costs.

-- simulate

help

Displays info about the current command.

--help

Example

The CLI will promt a confirmation. After confirming, the output is similar to:

Instantiate

Instantiates a contract by code Id.

Usage

Flags

Flag
Description
Usage

label

Used to provide a label assigned to the instantiation.

--label 'This is a great label'

admin

Used to provide an alternative admin address for the contract.

--admin andr1...

simulate

Simulates the transaction without broadcasting it. Useful to estimate gas costs.

--simulate

print

Prints the constructed message before simulating.

--print

help

Displays info about the current command.

--help

Example

Migrate

Migrates a contract.

Usage:

Example:

Query

Performs a contract query.

Usage

Example

Here I am queriying the account of a user (which is empty) from one of our contracts, we get:

Upload

Upload a contract wasm.

Usage

Example

Was this helpful?