I want to add contract pallet into polkadot-v0.9.31, but there is no tutorial in [official documentation][1], and it seems that pallet-contracts-rpc-runtime-api not exists. How can I add contract pallet into polkadot-v0.9.31?

cheers [1]: https://docs.substrate.io/tutorials/

1 Answer 1


pallet-contracts-rpc-runtime-api doesn't have to be in the runtime anymore, see this previous StackExchange question: Error when add pallet-contracts in substrate : no matching package named `pallet-contracts-rpc-runtime-api` found location.

And as suggested there use the Contracts Rococo parachain as an example of how to add the pallet contracts: check how to import it in the Cargo.toml, in the runtime of your node and the configuration needed for the pallet contracts.

  • 1
    Thanks! I have added contract pallets in to my template-node.
    – Briza
    Mar 2, 2023 at 11:23
  • but when I deploy flipper contract and execute flip() function, it returns ‘contracts.OutOfGas‘,do you know how to fix it?
    – Briza
    Mar 2, 2023 at 11:25
  • That's related to the Weights v2, how are you interacting with flipper? Check this reponse substrate.stackexchange.com/a/7275/2762
    – Alex Bean
    Mar 2, 2023 at 12:32
  • or this previous SE answer: substrate.stackexchange.com/a/7368/2762
    – Alex Bean
    Mar 2, 2023 at 12:32
  • flip() returns ‘contracts.OutOfGas‘ and read() doesn't response. I have tried contract-UI. Using contracts-ui.substrate.io, I can't click "next" button,and using weightv1--contracts-ui.netlify.app and when I click "upload and instantiate" button, it returns "InstantiateWithCode error". I install local contract-ui and it still don't work. I have to use my local node template rather than contracts-node, maybe there are other methods? Thanks a lot!
    – Briza
    Mar 3, 2023 at 2:02

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.