Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to upload cw20_base wasm file on terra-station #716

Closed
Odelya opened this issue May 3, 2022 · 4 comments
Closed

Unable to upload cw20_base wasm file on terra-station #716

Odelya opened this issue May 3, 2022 · 4 comments

Comments

@Odelya
Copy link

Odelya commented May 3, 2022

I am trying to upload an optimized version of cw20_base contract to my localterra like this:

const terra = new LCDClient({URL: 'http://localhost:1317', chainID: 'localterra',});
 const wallet = terra.wallet(mk);
 const storeCode = new MsgStoreCode(
   wallet.key.accAddress,
   fs.readFileSync('../artifacts/cs20_base.wasm').toString('base64'),
 );

 const storeCodeTx = await wallet.createAndSignTx({msgs: [storeCode]});

However, I am getting:

code: 3,
message: 'failed to execute message; message index: 0: Error calling the VM: Error during static Wasm validation: Wasm contract has unknown interface_version_
marker export (see https://github.com/CosmWasm/cosmwasm/blob/main/packages/vm/README.md): store wasm contract failed: invalid request',
*

is it working with terra network? if so, how?

@Odelya
Copy link
Author

Odelya commented May 4, 2022

I checkout to tag v0.9.2 which depends on cosmwasm-std version = "0.16.0" and now it works. It could be related to that library. What do you suggest to do?

@octalmage
Copy link

Terra is on CosmWasm 0.16 which means you’ll need to use branch 0.9.x

@taitruong
Copy link

taitruong commented Jun 22, 2022

I am all new to this and have the same issue. Trying this example: https://github.com/terran6/nft-on-terra

My Cargo.toml file uses cw-plus v0.9.2 and CosmWasm 0.16.0. It looks like this: https://github.com/terran6/nft-on-terra/blob/master/contracts/cw721-metadata-onchain/Cargo.toml

 ...
name = "cw721-metadata-onchain"
version = "0.9.2"
authors = ["Ethan Frey <ethanfrey@users.noreply.github.com>"]
edition = "2018"
description = "Example extending CW721 NFT to store metadata on chain"
license = "Apache-2.0"
repository = "https://github.com/CosmWasm/cw-plus"
homepage = "https://cosmwasm.com"
documentation = "https://docs.cosmwasm.com"
...
[lib]
crate-type = ["cdylib", "rlib"]

[package.metadata.scripts]
optimize = """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:0.12.5
"""

[features]
backtraces = ["cosmwasm-std/backtraces"]
library = []

[dependencies]
cw721 = { version = "0.9.2" }
cw721-base = {version = "0.9.2", features = ["library"] }
cosmwasm-std = { version = "0.16.0" }
schemars = "0.8.1"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
thiserror = { version = "1.0.23" }

[dev-dependencies]
cosmwasm-schema = { version = "0.16.0" }`

@ethanfrey
Copy link
Member

ethanfrey commented Oct 11, 2022

Terra (both classic and terra2) are using cosmwasm 1.0 afaik. Closing this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants