Unable to build Schema (& Contract)

Very recently i have been facing this error

cargo concordium build
    Finished release [optimized] target(s) in 0.01s
Error: Could not build smart contract.

Caused by:
    0: Could not validate resulting smart contract module as a V1 contract.
    1: Unsupported instruction 0xc0

I have changed the concordium-std & concordium-cis2 dependencies versions have not changed.
also cargo concordium version (2.7.0) is not changed
Even the cis2-multi example from the official repo throws this error upon building

cargo concordium build

Hi,

Unfortunately Iā€™m unable to reproduce this.

Can you provide some more context:

  1. run rustup show and paste the active toolchain + installed targets here.
  2. Which version of concordium-std are you using?
  3. Which version of concordium-cis2 are you using?

For the record I just successfully built the cis2-multi with:
cargo-concordium v. 2.7.0
concordium-cis2 v. 4.0.0
concordium-std v. 7.0.0
rustc v.1.65

1 Like

The issue was rustc version
though i did install wasm32-unknown-unknown target

coupled with this probable bug

i though the versions has some issue

Newer versions (v. 1.70 onwards) of rust use some wasm instructions we do not currently support in the smart contracts. So for the moment you will need to build contracts using an older version e.g. 1.69.

For future readers: Incompatibility of Concordium smart contracts with Rust 1.70 or newer