diff --git a/docs/faq/migrating-from-ink-4-to-5.md b/docs/faq/migrating-from-ink-4-to-5.md index 0e9c9c5039..5991080a8f 100644 --- a/docs/faq/migrating-from-ink-4-to-5.md +++ b/docs/faq/migrating-from-ink-4-to-5.md @@ -6,14 +6,14 @@ slug: /faq/migrating-from-ink-4-to-5 We've made a couple of breaking changes from ink! 4.x to ink! 5.0. -On this page we outline how you can migrate existing clients and +On this page we outline how you can migrate existing dApps and contracts from 4.x to 5.0. This release addresses the majority of issues raised in [the OpenZeppelin security review](https://blog.openzeppelin.com/security-review-ink-cargo-contract). In particular, we addressed the proxy selector clashing attack. -You can find the full changelog of the 5.0 release [here](https://github.com/paritytech/ink/blob/master/CHANGELOG.md). +You can find the full changelog of the 5.0 release [here](https://github.com/paritytech/ink/blob/master/CHANGELOG.md#version-500). :::caution This migration guide only considers your code base! Not your storage data! @@ -39,19 +39,17 @@ We've described this in more detail below, in the section ### Substrate/Polkadot SDK -There are two individual new functions that are only compatible with `polkadot-v1.8.0` and -`substrate-contracts-node` v0.39.0: -v2 of `call` and `instantiate` ([explained here](#call-and-instantiate-v2)) - -Additionally, there are two new functions that are only compatible with `polkadot-v1.9.0` and -`substrate-contracts-node` v0.40.0: -`lock_delegate_dependency` and `unlock_delegate_dependency` ([explained here](#upgradeable-contracts-delegate_dependency)) +There are four new functions that are only compatible from particular releases upwards: +* v2 of `call` and `instantiate`: `>= polkadot-v1.8.0` and `substrate-contracts-node >= v0.39.0` +([explained here](#call-and-instantiate-v2)). +* `lock_delegate_dependency` and `unlock_delegate_dependency`: +`>= polkadot-v1.9.0` and `substrate-contracts-node >= v0.40.0` ([explained here](#upgradeable-contracts-delegate_dependency)). These four functions are all opt-in! None of them are required to use ink! 5.0, they are only required if you want to access the particular functionality they provide. -Please see the link explainers for more details about them. +Please see the linked explainers for more details about them. -If you are not using any of those four functions, the same requirements as for ink! 4.0 hold: +If you are not using any of those four functions, the same requirements as for ink! 4.0 holds: * `pallet-contracts` >= `polkadot-v0.9.37`. * `substrate-contracts-node` >= `v0.24.0` @@ -59,9 +57,10 @@ If you are not using any of those four functions, the same requirements as for i ### How do I find out if a chain is compatible with ink! 5? You can query `contracts::palletVersion()` via the chain state RPCs. It has to -be `>= 9` for ink! 5.0 to be compatible, excluding the four functions mentioned above. +be `>= 9` for ink! 5.0 to be compatible, if you don't use any of the four functions +mentioned above. For the above mentioned four functions please see the respective sections on this page, -we explain how to find out if a chain supports them there. +there we explain how to find out if a chain supports them there. You can use the [polakdot.js app](https://polkadot.js.org/apps/) to do this: Developer » Chain State » `contracts` » `palletVersion()` » Click on the `+` on the right. @@ -69,7 +68,7 @@ Developer » Chain State » `contracts` » `palletVersion()` » Click on the `+` -The following chains are in production and support ink! 5.0 if you are not using any of the +The following chains are in production and support ink! 5.0, if you are not using any of the four functions mentioned above:
@@ -109,6 +108,11 @@ four functions mentioned above:
+
+ + + +
@@ -641,7 +645,8 @@ info (e.g. `cargo contract storage --help`). * `cargo contract info --all`: displays all addresses of deployed contracts on a particular chain ([#1319](https://github.com/paritytech/cargo-contract/pull/1319)) * `cargo contract storage`: displays the storage of an on-chain contract ([#1395](https://github.com/paritytech/cargo-contract/pull/1395), [#1414](https://github.com/paritytech/cargo-contract/pull/1414)) - +
+ ### Alternative off-chain E2E testing backend support: DRink! diff --git a/static/img/api-version-1.png b/static/img/api-version-1.png index e8c44d25fb..7235c4dccd 100644 Binary files a/static/img/api-version-1.png and b/static/img/api-version-1.png differ diff --git a/static/img/api-version-2.png b/static/img/api-version-2.png index db5e0aa9c2..bf85ea358d 100644 Binary files a/static/img/api-version-2.png and b/static/img/api-version-2.png differ diff --git a/static/img/cargo-contract-info.png b/static/img/cargo-contract-info.png new file mode 100644 index 0000000000..14104c20c6 Binary files /dev/null and b/static/img/cargo-contract-info.png differ diff --git a/static/img/cargo-contract-storage.png b/static/img/cargo-contract-storage.png new file mode 100644 index 0000000000..e30d03f35c Binary files /dev/null and b/static/img/cargo-contract-storage.png differ diff --git a/static/img/contract-storage.png b/static/img/contract-storage.png deleted file mode 100644 index a29904170e..0000000000 Binary files a/static/img/contract-storage.png and /dev/null differ diff --git a/static/img/pallet-version.png b/static/img/pallet-version.png index 24f1b61ab1..721300b36c 100644 Binary files a/static/img/pallet-version.png and b/static/img/pallet-version.png differ