Upgrade Smart Contracts to Cosmwasm 1.0.0
CosmWasm 1.0 allows Terra to adopt IBC-Wasm integration, enabling contract execution between IBC-enabled chains.
This upgrade also supports the ICS-20 protocol, which allows fungible tokens to be moved across other IBC-enabled Cosmos chains. Users will be able to send custom CW20 tokens using ICS20 and use them as native tokens on other chains.
How To Upgrade Your Smart Contract
Upgrading to Cosmwasm 1.0.0 requires upgrades to various dependencies in the smart contract.
- Open your smart contract's
Cargo.toml
file, and update the following dependencies to these versions:
Under [dependencies]
:
_9- `cosmwasm-std = "1.0.0"_9- cosmwasm-storage = "1.0.0"_9- cw-storage-plus = "0.13.2"_9- cw0 = "0.10.3"_9- cw2 = "0.13.2"_9- cw-controllers = "0.13.2"_9- schemars = "0.8.8"_9- serde = { version = "1.0.137", default-features = false, features = ["derive"] }_9- thiserror = "1.0.31"
The Terra-Cosmwasm package is no longer supported. This package was for queries to the oracle, market, and treasury modules which are only available on Terra Classic.
The following dependencies may be upgraded in the future, but are currently not functional with Cosmwasm 1.0.0:
You may want to rebuild your application without these dependencies for now.
Under [dev-dependencies]
:
- cosmwasm-schema = "1.0.0"
- Once all dependecies have been updated, run the following:
_1cargo build
- Finally, run the following to verify that the upgrade didn't cause any breaking changes to the contract:
_1`terrain test [insert-contract-name]`