Ink! 3.1.0 has been released today, and it seems that it has been automatically embed/used in the cargo-contract command. The result is that newly compiled contract are no more compatible with node that run 3.0 contracts pallet.
Is there a way to keep version 3.0.1 when compiling ink! contracts ?
Thanks for your help !
Edit : found the
-Z original-manifest cargo-contract option that preserves
cargo.toml versions values :)
But the build failed at the metadata generation...
Steps to reproduce:
- Download and uncompress precompile contract node v0.13
- Launch dev node :
- Build flipper contract sample :
cargo contract new flipper cd flipper cargo +nightly contract build
- Use Contracts UI to instantiate the flipper contract
- Instantiation failed with 'ExtrinsicFailed'
- Debug log shows :
DEBUG ThreadId(46) runtime::contracts: CodeRejected: module imports a non-existent function
Same contract is instantiated correctly on recent contracts node v0.14 and v0.15.
Same flipper contract built a few days before (using ink! 3.0.1), instantiation is correct on v0.13.
I saw that upgrading my node version to polkadot v0.9.22 should resolve this issue. But the cumulus pallet is still on polkadot v0.9.20.
That's why I asked initially how to stick to ink! 3.0.1 when compiling contract.