Junø
WebDiscordGithubTwitter
  • Juno
    • Intro
    • Home of CosmWasm
    • Contributors - Core Software
    • Brand Identity
    • Security Disclosures
    • Economic Overview
      • Disclaimer
      • Native Asset (JUNO)
      • Incentive structure
      • Supply API - Data
  • Developer Guides
    • CosmWasm Contracts
      • Compile a Contract
      • Deploy a Contract
      • Guide: How to Upload a Smart Contract on the Juno Chain
      • Use Cw-orchestrator to speed-up your development
      • Query A Contract
      • Send Tokens to a Contract
    • Miscellaneous
      • Conversions
      • Multi Message Transaction
      • Get & Decode Transactions
      • Get Token Prices
      • Get Account Transactions
      • IBC Transfer
      • State Export / Airdrop
    • Juno Modules
      • FeeShare
      • TokenFactory
    • API Endpoints
      • Cosmos
        • Tx
          • V1beta1
            • Simulate
            • Txs
              • Block
        • Params
          • V1beta1
            • Params
        • Bank
          • V1beta1
            • Balances
              • By denom
            • Denoms metadata
            • Params
            • Spendable balances
            • Supply
        • Upgrade
          • V1beta1
            • Applied plan
            • Current plan
            • Module versions
            • Upgraded consensus state
        • Auth
          • V1beta1
            • Accounts
            • Module accounts
            • Params
        • Staking
          • V1beta1
            • Delegations
            • Historical info
            • Params
            • Pool
            • Validators
              • Delegations
                • Unbonding delegation
              • Unbonding delegations
            • Delegators
              • Redelegations
              • Unbonding delegations
              • Validators
        • Evidence
          • V1beta1
            • Evidence
        • Mint
          • V1beta1
            • Annual provisions
            • Inflation
            • Params
        • Feegrant
          • V1beta1
            • Allowance
            • Allowances
            • Issued
        • Gov
          • V1beta1
            • Params
            • Proposals
              • Deposits
              • Tally
              • Votes
        • Distribution
          • V1beta1
            • Community pool
            • Params
            • Delegators
              • Rewards
              • Validators
              • Withdraw address
            • Validators
              • Commission
              • Outstanding rewards
              • Slashes
        • Slashing
          • V1beta1
            • Params
            • Signing infos
        • Authz
          • V1beta1
            • Grants
              • Grantee
              • Granter
        • Base
          • Tendermint
            • V1beta1
              • Blocks
                • Latest
              • Node info
              • Syncing
              • Validatorsets
                • Latest
          • Node
            • V1beta1
              • Config
      • Cosmwasm
        • Wasm
          • V1
            • Code
              • Contracts
            • Contract
              • History
              • Raw
              • Smart
              • State
            • Codes
              • Params
              • Pinned
            • Contracts
              • Creator
      • Juno
        • Feeshare
          • V1
            • Fee shares
            • Params
        • Tokenfactory
          • V1beta1
            • Denoms from creator
            • Params
            • Denoms
              • Authority metadata
      • Ibc
        • Apps
          • Router
            • V1
              • Params
      • API Specification
    • Local Interchain
      • Local Interchain Rust Example
    • Junod Local Dev Setup
    • Integrate Leap wallet
    • SubQuery Indexer
  • Governance
    • Before submitting a proposal
    • Submitting a Proposal (CLI)
      • Formatting Proposal Markdown
  • Command-Line Interface (CLI)
    • Introduction
    • Useful CLI Commands
    • Module Reference
      • bank
      • distribution
      • gov
      • keys
      • params
      • slashing
      • staking
      • status
      • tendermint
      • upgrade
      • wasm
  • Nodes & Validators
    • Junod Installation and setup
    • Setting up Cosmovisor
    • Mainnet Setup and Tooling
    • Joining Mainnet
      • Sync from Snapshot
      • Sync with state-sync
      • Mainnet Upgrades
    • Joining Testnet
    • Relaying
    • Juno Delegations Program
Powered by GitBook
On this page
  • Preparation:
  • Steps:
  • Conclusion:

Was this helpful?

  1. Developer Guides
  2. CosmWasm Contracts

Guide: How to Upload a Smart Contract on the Juno Chain

Welcome to this tutorial on deploying a smart contract to the Juno testnet. This guide will show you how to deploy and interact with a contract using CLI. For scripting using Rust, you can use [cw-orc

PreviousDeploy a ContractNextUse Cw-orchestrator to speed-up your development

Last updated 1 year ago

Was this helpful?

Preparation:

Required Materials: A computer with an internet connection, familiarity with GitHub, and basic knowledge of smart contracts.

Steps:

  1. Find an Example Smart Contract:

(Note: The steps here mainly involve browsing, no specific bash commands.)

  1. Connect to the Juno Testnet:

Check out our new video that shows you how to deploy a local env

  1. Create a Juno Wallet:

bash junod keys add MyWalletName

5. Claim junox Test Tokens:

6. Verify Token Receipt:

junod query bank balances [YOUR_WALLET_ADDRESS]

7. Configure the Juno Command Line:

bash junod config node [NODE_URL] 
junod config chain-id [CHAIN_ID] 
junod config gas auto 
junod config gas-prices 0.025ujuno

8. Deploy the Smart Contract:

Assuming you've downloaded clock_example.wasm to your current directory

junod tx wasm store clock_example.wasm --from MyWalletName --gas 1500000 --chain-id [CHAIN_ID]

9. Instantiate the Smart Contract:

Replace [CODE_ID] with the code ID obtained from the previous step e.g 3785

 junod tx wasm instantiate [CODE_ID] '{"count": 0}' --label "my-clock-instance" --from MyWalletName --amount 100ujuno

10. Interact with the Smart Contract:

Query the smart contract (replace [CONTRACT_ADDRESS] with the address from instantiation) junod query wasm contract [CONTRACT_ADDRESS]


junod tx wasm execute [CONTRACT_ADDRESS] '{"increment": {}}' --from MyWalletName --amount 10ujuno

Conclusion:

  • You've now successfully uploaded, instantiated, and interacted with a smart contract on the Juno testnet.

  • If you have further questions or ideas, join the Juno community on Discord, particularly the "developer lounge".


Note: Adjust the bash commands to fit your specific situation, and always double-check them, especially when working with real tokens or live environments.\

In this tutorial we will be using

Head to Juno Discord and find FAUCET section. In there you can get some using the API provided and inputting the wallet address you created in the previous step.

https://github.com/Reecepbcups/cw-clock-exampl
https://github.com/Reecepbcups/cw-clock-example
https://discord.com/invite/caEBtA4QDb
https://faucet.reece.sh/uni-6/JUNO_ADDRESS_HERE