🌅
Sunrise / Gluon Docs
  • Home
    • 👋Sunrise
  • 📜Learn
    • 🌆Sunrise
      • Proof of Liquidity
      • Fee Abstraction
      • Data Availability
      • Gauges Voting
      • Liquidity Pool
      • Liquidity Incentive
      • Swap
      • TokenConverter
      • Fee
      • Lockup Account
      • Bribes
    • 💴$RISE
      • Allocations
    • 🏦Gluon
    • 💴$GLU
    • 🎓Thesis
      • App chain thesis
      • Interoperability
  • 🛠️Build
    • 🚀Quick Start
    • Client
    • L2 Blockchains
      • Rollkit
        • Sunrise Data
        • Rollkit L2 Chain
      • OP Stack
        • Sunrise Data
        • OP Stack L2 Chain
    • Validators
      • Proof of Data Availability
      • Self Delegation
  • 🏗️Run a Sunrise Node
    • Networks
    • Types of Nodes
      • Consensus
        • Full Consensus Node
        • Validator Node (Genesis)
        • Validator Node
        • Setup Cosmovisor
      • IBC Relayers
    • Resources
      • Upgrade
      • Environment
  • 🏗️Run a Gluon Node
    • Networks
    • Node
      • Validator Node
  • 🔗Links
    • GitHub
    • Discord
    • X (Twitter)
    • Medium
    • dev.to
  • 📓Deprecated (UnUniFi)
    • IBC Channels
    • Security
    • CosmWasm
      • Tutorial
      • Create Project
    • IYA Strategy
      • Interface
      • External CosmWasm chain with IBCHooks
      • External EVM chain with Axelar
    • Frontend
      • Cosmos Client TS
    • Resources
    • Setup ununifid
    • ununifid
      • Basic Commands
      • Module Commands
        • wasm
    • Build a Node
    • Build a Validator Node
    • Setup Cosmovisor
    • Mainnet Upgrades
    • IBC Relayer
Powered by GitBook
On this page
  • How to use wasm CLI
  • Compiling and Testing a Contract
  • Unit Tests
  • Build with Optimizer
  • Deployment and Interaction
  1. Deprecated (UnUniFi)
  2. CosmWasm

Tutorial

PreviousCosmWasmNextCreate Project

Last updated 1 year ago

How to use wasm CLI

First of all, install ununifid to use wasm CLI and . To learn how to install ununifid, see

There are two ways of using wasm CLI.

ununifid tx wasm --help
ununifid query wasm --help

Compiling and Testing a Contract

Quoted from

# Download the repository
git clone https://github.com/CosmWasm/cw-plus
cd cw-plus
git checkout main
cd contracts/cw20-ics20

# compile the wasm contract with stable toolchain
rustup default stable
cargo wasm

Unit Tests

RUST_BACKTRACE=1 cargo unit-test

Build with Optimizer

docker run --rm -v "$(pwd)":/code \
  --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \
  --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
  cosmwasm/rust-optimizer:0.12.11

Deployment and Interaction

To deploy your wasm smart contract that you built, use ununifid tx wasm store commands.

ununifid tx wasm store --help

Converse to Solidity smart contracts, CosmWasm has two stages to activate smart contracts. That are deploy and instantiate. So after you deployed your wasm smart contract, use ununifid tx wasm instantiate commands.

ununifid tx wasm instantiate --help

Quoted from

Quoted from

Quoted from

📓
Rust
here
CosmWasm Documentation
CosmWasm Documentation
CosmWasm Documentation
CosmWasm Documentation