# upload the wasm code to OKTC and you will get a code id.
# e.g.
# <path_to_wasm_file>=./cw-plus/target/wasm32-unknown-unknown/release/cw20_base.wasm
# <from_address_or_name>=ex1h0j8x0v9hs4eq6ppgamemfyu4vuvp2sl0q9p3v
# <fees>=0.01okt
# <gas>=3000000
exchaincli tx wasm store <path_to_wasm_file> --from <from_address_or_name> --fees <fees> --gas <gas> -b block -y
# Instantiate a contract with the uploaded code. We can use the code we upload in previous step.
# e.g.
# <code_id>=1
# <instantiate_message>
# <label>=test (label can be any human readable string)
# <admin_address>=ex1h0j8x0v9hs4eq6ppgamemfyu4vuvp2sl0q9p3v (usually same as <from_address_or_name>)
# <from_address_or_name>=ex1h0j8x0v9hs4eq6ppgamemfyu4vuvp2sl0q9p3v
# <fees>=0.01okt
# <gas>=3000000
exchaincli tx wasm instantiate <code_id> <instantiate_message> --label <label> --admin <admin_address> --from <from_address_or_name> --fees <fees> --gas <gas> -b block -y
# Call the contract with execute message defined in schema json.
# e.g.
# <contract_address>=ex1eyfccmjm6732k7wp4p6gdjwhxjwsvje44j0hfx8nkgrm8fs7vqfsfxfyxv
# <execute_message>=?
# <admin_address>=ex1h0j8x0v9hs4eq6ppgamemfyu4vuvp2sl0q9p3v (usually same as <from_address_or_name>)
# <from_address_or_name>=ex1h0j8x0v9hs4eq6ppgamemfyu4vuvp2sl0q9p3v
# <fees>=0.01okt
# <gas>=3000000
exchaincli tx wasm execute <contract_address> <execute_message> --from <from_address_or_name> --fees <fees> --gas <gas> -b block -y
# migrate contract to new code id, <instantiate_message> is the instantiate message of the new code defined in json schema
# e.g.
# <contractAddr>=ex1eyfccmjm6732k7wp4p6gdjwhxjwsvje44j0hfx8nkgrm8fs7vqfsfxfyxv
# <new_code_id>=2
# <instantiate_message>="" (refer to the schema file)
# <from_address_or_name>=ex1h0j8x0v9hs4eq6ppgamemfyu4vuvp2sl0q9p3v
# <fees>=0.01okt
# <gas>=3000000
exchaincli tx wasm migrate <contractAddr> <new_code_id> <instantiate_message> --from <from_address_or_name> --fees <fees> --gas <gas> -b block -y
# transfer admin to a new address
# e.g.
# <contractAddr>=ex1eyfccmjm6732k7wp4p6gdjwhxjwsvje44j0hfx8nkgrm8fs7vqfsfxfyxv
# <new_admin_address>=ex190227rqaps5nplhg2tg8hww7slvvquzy0qa0l0
# <admin_address>=ex1h0j8x0v9hs4eq6ppgamemfyu4vuvp2sl0q9p3v
# <fees>=0.01okt
# <gas>=3000000
exchaincli tx wasm set-contract-admin <contractAddr> <new_admin_address> --from <admin_address> --fees <fees> --gas <gas> -b block -y
# clear admin of the contract
# e.g.
# <contractAddr>=ex1eyfccmjm6732k7wp4p6gdjwhxjwsvje44j0hfx8nkgrm8fs7vqfsfxfyxv
# <admin_address>=ex1h0j8x0v9hs4eq6ppgamemfyu4vuvp2sl0q9p3v
# <fees>=0.01okt
# <gas>=3000000
exchaincli tx wasm clear-contract-admin <contractAddr> --from <admin_address> --fees <fees> --gas <gas> -b block -y
exchaincli query wasm list-code
# e.g.
# <code_id>=1
exchaincli query wasm list-contract-by-code <code_id>
# Download wasm bytecode and save to file
# e.g.
# <code_id>=1
# <filename>=test.wasm
exchaincli query wasm code <code_id> <filename>
# e.g.
# <code_id>=1
exchaincli query wasm code-info <code_id>
# e.g.
# <contract_address>=ex14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s6fqu27
exchaincli query wasm contract <contract_address>
# e.g.
# <contract_address>=ex14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s6fqu27
exchaincli query wasm contract-history <contract_address>
# e.g.
# <contract_address>=ex14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s6fqu27
exchaincli query wasm contract-state all <contract_address>
# e.g.
# <contract_address>=ex14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s6fqu27
# <query_message>='{"balance":{"address":"ex190227rqaps5nplhg2tg8hww7slvvquzy0qa0l0"}}'
# you should refer to the schema file for query message
exchaincli query wasm contract-state smart <contract_address> <query_message>
exchaincli query wasm pinned
exchaincli query wasm libwasmvm-version