Skip to content

Tutorial

Geunwoo Kim edited this page Jul 9, 2022 · 18 revisions

We recommend starting with this tutorial https://docs.cosmwasm.com/dev-academy/develop-smart-contract/develop/.

https://docs.junonetwork.io/smart-contracts-and-junod-development/tutorial-erc-20 this tutorial is not good.

In the tutorial, we interact with the testnet using wasmd and JS CLI. In our project, we will use cosmr which is Rust cosmos SDK that creates, signs, and sends transactions.

How to setup a testnet wallet and make a faucet request

https://docs.cosmwasm.com/dev-academy/basics/environment#setup-wasmd-and-wallet

Troubleshooting

  • The original optimizer does not work well in Mac M1. For Mac M1 machine, we need to run the following command.
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-arm64:0.12.6
  • If the original version of the compiled contract is not optimized following the instruction, it is rejected by the network due to the size limitation (i.e., your contract in /artifacts directory should be uploaded).
Clone this wiki locally