0
  • I want to try compiling smart contract with "patractlabs/metis".
  • First of all,I downloaded example project and tried to compile.
  • But I got an error as following.
  • I downloaded from "https://github.com/patractlabs/metis/tree/master/example"
% npx redspot compile
compiler version: 0.14.0
toolchain: nightly
ink: 24 matches

===== Compile access_control =====

error: There are multiple `parity-scale-codec` packages in your project, and the specification `parity-scale-codec` is ambiguous.
Please re-run this command with `-p <spec>` where `<spec>` is one of the following:
  parity-scale-codec:2.3.1
  parity-scale-codec:3.1.2
ERROR: Mismatching versions of `parity-scale-codec` were found!
Please ensure that your contract and your ink! dependencies use a compatible version of this package.
An unexpected error occurred:
  • Please let me know how to resolve this error.
s.Takahashi
  • 469
  • 4
  • 15

1 Answers1

0

There are breaking changes in ink! rc-9. Some of them are effective even if you're not using rc-9. Don't know if this is known to you.

https://github.com/paritytech/ink/blob/v3.0.0-rc9/RELEASES.md

One of the changes is about the dependencies of scale. The dependencies should be updated as below:

scale-info = { version = "2", default-features = false, features = ["derive"], optional = true }
scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive", "full"] }
Zenas Chen
  • 471
  • 4
  • 14
  • Thank you for answering the question. However, metis references rc-5. and requires parity-scale-codec: 2.3.1. Therefore, it is not possible to raise it to the rc-9. Side. Even if I lower the version of cargo-contract, I am in trouble because the reference of parity-scale-codec: 3.1.2 is not lost. Is there a way to break this dependency? – s.Takahashi May 01 '22 at 02:34
  • I ran into this problem when my project depended on rc-8. Doing the "scale lines" changes alone actually fixed it. No need for me to upgrade the ink! dep as well (well, actually it depends on whether the ink project uses some deep features of scale). Changing the version of cargo-contract doesn't seem to help. Give it a try of changing the scale lines alone :) – Zenas Chen May 05 '22 at 07:03
  • Thank you for your reply. As you said, I change only "scale" line as follwoing. "scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive", "full"] }". But I got a same error. – s.Takahashi May 06 '22 at 08:06
  • If so, I have no idea. If you're sure you've changed the deps of the desired ink! projects properly, raise an issue at the ink! repo maybe. Actually I don't think the way they break the deps of previous RCs is a good idea. – Zenas Chen May 07 '22 at 12:26