Hi
I have been developing smart contract on concordium.
I took a track_and_trace example from concordium and tried to build it and I got the following 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: Unexpected byte 0x80. Expected 0x00
What does this mean? How could I solve it?
Also I built my own contract but same error happens
Since Rust version 1.82, unfortunately the compiler enables some WebAssembly features that are not supported on Concordium (yet). This typically leads to this error, as the compiled Wasm cannot be parsed by the chain and our tooling.
The current workaround for this is to use Rust toolchain version 1.81 or earlier. You can specify this as cargo +1.81 concordium ... in the commandline. You may need to install it with:
rustup toolchain install 1.81
rustup target +1.81 add wasm32-unknown-unknown (Installs the wasm target for the toolchain.)
You can also make this the default rust version with:
rustup default 1.81
Or set it as the toolchain to use for the current directory with: