In the latest release of the Rust compiler, version 1.70, some code generation features are enabled that make it produce Wasm instructions that are not supported on the current version of the Concordium blockchain.
When building a contract with cargo concordium
you might see an error
Error: Could not build smart contract.
Caused by:
0: Could not build module schema.
1: Could not generate module schema from Wasm module.
2: Unsupported instruction 0xc0
There is no workaround other than to use an older version of the Rust toolchain which you can set by running
rustup default 1.69
We are working on supporting the new instruction set in a future protocol version of the Concordium blockchain.
Note that the same consideration applies to any nightly version that is more recent than 1.69.