In the cargo contract v3 release, breaking changes were made for how contracts are built (cdylib -> bin) and specifying no_main.

I've found that cargo contract v2 produces contracts compatible with substrate-contracts-node version 0.24 and below but incompatible with version 0.25 and above.

Conversely I've found that cargo contract v3 produces contracts that are not compatible with substrate-contracts-node version 0.24 and below but compatible with v0.25 upwards.

So my question is this: how do chains deal with this breaking change? If my chain is currently running version 0.24 of substrate-contracts-node and all contracts are built using cargo contract version 2, the new contracts from cargo-contract v3 are incompatible and are rejected on code upload (we're experiencing this with rococo contracts node at the moment!).

I assume the chain has to upgrade, but what happens to the existing contracts which are in the old format (cargo-contract v2 format)? Do they get purged? Do they run in some legacy mode? are they rebuilt in the correct (v3) format?

Context: I don't run my own chain, I build smart contracts and am curious :)

1 Answer 1


Contracts are upgraded between releases of the contracts pallet, see here

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.