Skip to content

Instantly share code, notes, and snippets.

@giansalex
Last active December 14, 2023 18:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save giansalex/edcdf7ad560b4e3761452402095a8d02 to your computer and use it in GitHub Desktop.
Save giansalex/edcdf7ad560b4e3761452402095a8d02 to your computer and use it in GitHub Desktop.
Deploy CW20-ICS20 contract

CW20-ICS20 on Juno

TX_FLAGS="--gas auto --gas-adjustment 1.3 --gas-prices 0.025ujunox"
junod tx wasm store cw20_ics20.wasm --from user $TX_FLAGS

GET Code ID.

  • Instantiate Contract:
JSON_DATA='{"default_timeout": 1200, "gov_contract": "juno14vhcdsyf83ngsrrqc92kmw8q9xakqjm0ff2dpn", "allowlist": [], "default_gas_limit": 200000}'
junod tx wasm instantiate <CODE-ID> "$JSON_DATA" --no-admin --from user $TX_FLAGS

GET contract address (e.g juno1u2kf5e9qxf08hg3c0t53krjfjlj733ym9fkkgpch8qc3dp3yhpcses9c6n).

  • Create an IBC Channel OSMO testnet <> JUNO testnet
hermes create channel --a-chain osmo-test-4 \
 --b-chain uni-3 \
 --a-port transfer \
 --b-port wasm.juno1u2kf5e9qxf08hg3c0t53krjfjlj733ym9fkkgpch8qc3dp3yhpcses9c6n \
 --new-client-connection \
 --order unordered \
 --chan-version ics20-1

hermes v1.0 used
Note: You can replace --new-client-connection by --a-connection connection-xx

  • Verify ibc channel
junod q wasm contract-state smart juno1u2kf5e9qxf08hg3c0t53krjfjlj733ym9fkkgpch8qc3dp3yhpcses9c6n '{"list_channels":{}}'

Deployed demo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment