I have followed this tutorial, which adds the Contracts pallet to a Substrate runtime, and get the following error:

amit@amit-Swift-SF315-41:~/Substrate/New/substrate-node-template$ cargo check -p node-template-runtime
    Blocking waiting for file lock on package cache
    Updating git repository `https://github.com/paritytech/substrate.git`
    Updating git repository `https://github.com/paritytech/substrate.git`
error: failed to get `pallet-contracts` as a dependency of package `node-template-runtime v4.0.0-dev (/home/amit/Substrate/New/substrate-node-template/runtime)`

Caused by:
  failed to load source for dependency `pallet-contracts`

Caused by:
  Unable to update https://github.com/paritytech/substrate.git?tag=latest

Caused by:
  failed to find tag `latest`

Caused by:
  reference 'refs/remotes/origin/tags/latest' not found; class=Reference (4); code=NotFound (-3)

1 Answer 1


The version of your pallet contracts dependencies are wrong (I am assuming you are using the current substrate-node-template).

Below are the needed dependencies:

pallet-contracts = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23", default-features = false }
pallet-contracts-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23", default-features = false }
pallet-contracts-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.23", default-features = false }

I have a detailed blog on this: http://tinyurl.com/yckd2axc

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.