-
Webjojo | Uncode Lounge replied to the topic What is the exact recommended versions to compile CosmWasm smart contracts? in the forum Beginner Questions 11 months, 1 week ago
Hi everyone,
After many discussion with StrathCole and Man, I have received an answer that works:
– use rust 1.82 (1.87 will break things)
– if using cosmwasm 1.0 -> fine
– if using cosmwasm 1.2/1.5 -> add base64ct = “<1.8.0" to dependencies
– run cargo build (if you had run that with a newer rust version, delete the Cargo.lock first)
– run eithercargo build --release --target wasm32-unknown-unknown && wasm-opt -Oz -o "artifacts/contract.wasm" "target/wasm32-unknown-unknown/release/contract.wasm"
or
docker run --rm -v "$(pwd)":/code --mount type=volume,source="$(basename "$(pwd)")_cache",target=/target --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry cosmwasm/rust-optimizer:0.16.1

