dApp migration guide
Contents
dApp migration guide#
Use this guide to Migrate from Terra Classic to the new Terra chain.
Changes#
Terra 2.0 will be starting from a blank state when it comes to CosmWasm. This means no existing code IDs or smart contracts will be migrated.
CosmWasm smart contracts will need to be uploaded to the new chain and instantiated.
In addition to needing to re-deploy smart contracts, there are some breaking changes that developers should be aware of.
1. No UST or other native stablecoins (KRT, SDT, etc).#
Terra 2.0 has removed all native stablecoins. Any logic that accepts, queries, or sends Terra stablecoins will need to be removed or updated.
Terra developers are working on getting alternative stablecoins on chain as soon as possible.
2. No stablecoin tax queries to the treasury module.#
Terra 2.0 has removed the treasury module. Any queries to the treasury module to query the TaxRate or TaxCap will now fail. Without the native stablecoins this logic isn’t necessary, so it can be removed.
3. No market module.#
Any attempts to swap Luna for UST or other stablecoins through the market module will fail. Specifically the market/MsgSwap
message has been removed. However, LUNA can still be swapped onchain for other assets using a DEX. This includes any liquid stablecoins on Terra.
4. No oracle module.#
Terra 2.0 has removed the oracle module. Any queries to fetch ExchangeRates from the oracle module will fail. However, there are other oracle solutions that can be employed.
Band protocol is one such solution. Band works over IBC. See the oracle module documentation for more details
5. Terra.js changes#
Outside of the deprecation of the treasury, market, and oracle modules, Terra.js functionality remains relatively unchanged. There are a few additions to allow for legacy commands which are explained in Using Terra Classic.
Update Terra.js and WalletConnect
All dApps on either Terra Classic or the new Terra chain must update Terra.js and WalletConnect to the latest versions.
Examples of Deprecated Functionality#
The following are code snippets with functionality that will no longer be supported.
All
oracle
andmarket
related methods are now deprecated.
// all methods in these modules, including parameters() are deprecated
const oracleParams = await lcd.oracle.parameters();
const marketParams = await lcd.market.parameters();
MsgSwap
anduusd
(which represents UST) are now deprecated.
// Used to swap 1 Luna for UST
const swap = new MsgSwap(
'terra...9fj',
new Coin('uluna', '1000000'),
'uusd'
TaxRate queries using the Terra Querier are deprecated.
pub fn compute_tax(deps: Deps, coin: &Coin) -> StdResult<Uint256> {
let terra_querier = TerraQuerier::new(&deps.querier);
let tax_rate = Decimal256::from((terra_querier.query_tax_rate()?).rate);
let tax_cap = Uint256::from((terra_querier.query_tax_cap(coin.denom.to_string())?).cap);
let amount = Uint256::from(coin.amount);
Ok(std::cmp::min(
amount * Decimal256::one() - amount / (Decimal256::one() + tax_rate),
tax_cap,
))
}
Migrating CW20/CW721 balances#
A tool was created that will generate a snapshot of CW20 or CW721 holders and balances at a specific block height:
Once a snapshot is created, you can airdrop the correct balances to users as defined by the snapshot.