diff --git a/.config/cargo_spellcheck.dic b/.config/cargo_spellcheck.dic index eb424cac9b3..6a430c8bc3c 100644 --- a/.config/cargo_spellcheck.dic +++ b/.config/cargo_spellcheck.dic @@ -104,5 +104,3 @@ natively payability unpayable initializer - -^#[0-9a-fA-F]{5,}$ \ No newline at end of file diff --git a/.config/cargo_spellcheck.toml b/.config/cargo_spellcheck.toml index f5c0b7b3dc2..58ceb4556f3 100644 --- a/.config/cargo_spellcheck.toml +++ b/.config/cargo_spellcheck.toml @@ -16,3 +16,4 @@ use_builtin = true [Hunspell.quirks] allow_concatenation = true allow_dashes = true +transform_regex = ["^[0-9a-fA-F]{5,}$"] diff --git a/Cargo.toml b/Cargo.toml index 154fbd1a1ae..ded10b8e9da 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,6 +12,7 @@ members = [ "crates/primitives", "crates/engine", "crates/env", + "crates/eth_compatibility", "crates/storage", "crates/storage/derive", ] diff --git a/RELEASES.md b/RELEASES.md index f3ff4064c17..6eb255b731f 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,5 +1,39 @@ # [Unreleased] +# Version 3.3.0 + +This release restores SemVer compatibility in the `v3.x` series of releases, as well as +compatibility with the [`v0.13.0`](https://github.com/paritytech/substrate-contracts-node/releases/tag/v0.13.0) +release of the `substrate-contracts-node`. + +## Compatibility +This version will work fine with *substrate-contracts-node* versions from +[0.13.0](https://github.com/paritytech/substrate-contracts-node/releases/tag/v0.13.0) up +to [0.16.0](https://github.com/paritytech/substrate-contracts-node/releases/tag/v0.16.0). + +## Changed +*Context: user-reported issues on our SE unveiled backward incompatibility introduced in 3.1.0 release.* +1. [CodeRejected when using ink! v3.1.0](https://substrate.stackexchange.com/questions/2721/cargo-contract-3-0-1) +1. [Incompatibility between ink! v3.0.1 and v3.2.0 ](https://substrate.stackexchange.com/questions/2870/cargo-contract-throws-error-about-supplied-arguments-in-inkconstructor-f) + +The following has been done to restore backward compatibility: +- Reverted backward-incompatible piece of [#1224](https://github.com/paritytech/ink/pull/1224). + - The return signature of `ink_env::set_contract_storage()` was changed to return an + `Option`. This could have broken existing code, so this should've been done in + a `MAJOR` release. + - Under the hood the PR also changed `Mapping::insert()` to use a new SEAL API + (`[seal1] seal_set_storage`), which resulted in `CodeRejected` errors in nodes which + did not have this API (e.g `substrate-contracts-node@0.13.0`). +- Reverted "Optimise deny_payment. Use everywhere semantic of deny ([#1267](https://github.com/paritytech/ink/pull/1267))" + - This one is to restore compatibility between minor versions of ink! crates; see + @HCastano's SE [answer](https://substrate.stackexchange.com/a/3000/472) in this + regard. +- Reverted backward-incompatible piece of [#1233](https://github.com/paritytech/ink/pull/1233). + - The removal of the `eth_compatibility` crate should have been done in a `MAJOR` + release. + +All these breaking changes are subjects to the upcoming MAJOR *ink!* release 4.0.0. + # Version 3.2.0 ## Compatibility @@ -11,13 +45,13 @@ This is the case in the latest release of the [`substrate-contracts-node`](https [v0.16.0](https://github.com/paritytech/substrate-contracts-node/releases/tag/v0.16.0). ## Added -- Contract size optimization in case contract doesn't accept payment ‒ [#1267](https://github.com/paritytech/ink/pull/1270) [#1273](https://github.com/paritytech/ink/pull/1267) (thanks [@xgreenx](https://github.com/xgreenx)). +- Contract size optimization in case contract doesn't accept payment ‒ [#1267](https://github.com/paritytech/ink/pull/1267) (thanks [@xgreenx](https://github.com/xgreenx)). ## Changed - Two functions have been stabilized: [`ink_env::ecdsa_recover`](https://paritytech.github.io/ink/ink_env/fn.ecdsa_recover.html) and [`ink_env::ecdsa_to_eth_address`](https://paritytech.github.io/ink/ink_env/fn.ecdsa_to_eth_address.html) ‒ [#1270](https://github.com/paritytech/ink/pull/1270) [#1273](https://github.com/paritytech/ink/pull/1273) ## Fixed -- Fixed bug with recent Rust and `cargo test` ‒ [#1272](https://github.com/paritytech/ink/pull/1270) [#1273](https://github.com/paritytech/ink/pull/1272) (thanks [@xgreenx](https://github.com/xgreenx)). +- Fixed bug with recent Rust and `cargo test` ‒ [#1272](https://github.com/paritytech/ink/pull/1272) (thanks [@xgreenx](https://github.com/xgreenx)). # Version 3.1.0 diff --git a/crates/allocator/Cargo.toml b/crates/allocator/Cargo.toml index 98f83f60380..9c773f79660 100644 --- a/crates/allocator/Cargo.toml +++ b/crates/allocator/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ink_allocator" -version = "3.2.0" +version = "3.3.0" authors = ["Parity Technologies ", "Robin Freyler "] edition = "2021" diff --git a/crates/engine/Cargo.toml b/crates/engine/Cargo.toml index a688ce568be..a3a808678ff 100644 --- a/crates/engine/Cargo.toml +++ b/crates/engine/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ink_engine" -version = "3.2.0" +version = "3.3.0" authors = ["Parity Technologies ", "Michael Müller "] edition = "2021" diff --git a/crates/engine/src/ext.rs b/crates/engine/src/ext.rs index d784d12094b..2a6cc01de13 100644 --- a/crates/engine/src/ext.rs +++ b/crates/engine/src/ext.rs @@ -227,9 +227,35 @@ impl Engine { }); } + /// Writes the encoded value into the storage at the given key. + pub fn set_storage(&mut self, key: &[u8; 32], encoded_value: &[u8]) { + let callee = self.get_callee(); + let account_id = AccountId::from_bytes(&callee[..]); + + self.debug_info.inc_writes(account_id.clone()); + self.debug_info + .record_cell_for_account(account_id, key.to_vec()); + + // We ignore if storage is already set for this key + let _ = self.database.insert_into_contract_storage( + &callee, + key, + encoded_value.to_vec(), + ); + } + /// Writes the encoded value into the storage at the given key. /// Returns the size of the previously stored value at the key if any. - pub fn set_storage(&mut self, key: &[u8; 32], encoded_value: &[u8]) -> Option { + /// + /// # Note + /// + /// This is an equivalent to the [`set_storage`][`Self::set_storage`] method, + /// but gives the information on the pre-existing value size. + pub fn set_storage_return_size( + &mut self, + key: &[u8; 32], + encoded_value: &[u8], + ) -> Option { let callee = self.get_callee(); let account_id = AccountId::from_bytes(&callee[..]); diff --git a/crates/env/Cargo.toml b/crates/env/Cargo.toml index 82ab3cc2eaf..8dc34d28ce2 100644 --- a/crates/env/Cargo.toml +++ b/crates/env/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ink_env" -version = "3.2.0" +version = "3.3.0" authors = ["Parity Technologies ", "Robin Freyler "] edition = "2021" @@ -15,10 +15,10 @@ categories = ["no-std", "embedded"] include = ["Cargo.toml", "src/**/*.rs", "README.md", "LICENSE"] [dependencies] -ink_metadata = { version = "3.2.0", path = "../metadata/", default-features = false, features = ["derive"], optional = true } -ink_allocator = { version = "3.2.0", path = "../allocator/", default-features = false } -ink_primitives = { version = "3.2.0", path = "../primitives/", default-features = false } -ink_prelude = { version = "3.2.0", path = "../prelude/", default-features = false } +ink_metadata = { version = "3.3.0", path = "../metadata/", default-features = false, features = ["derive"], optional = true } +ink_allocator = { version = "3.3.0", path = "../allocator/", default-features = false } +ink_primitives = { version = "3.3.0", path = "../primitives/", default-features = false } +ink_prelude = { version = "3.3.0", path = "../prelude/", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive", "full"] } derive_more = { version = "0.99", default-features = false, features = ["from", "display"] } @@ -32,7 +32,7 @@ static_assertions = "1.1" rlibc = "1" [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -ink_engine = { version = "3.2.0", path = "../engine/", optional = true } +ink_engine = { version = "3.3.0", path = "../engine/", optional = true } # Hashes for the off-chain environment. sha2 = { version = "0.10", optional = true } diff --git a/crates/env/src/api.rs b/crates/env/src/api.rs index 581d7dabb4f..fc5acd3bfca 100644 --- a/crates/env/src/api.rs +++ b/crates/env/src/api.rs @@ -183,18 +183,47 @@ where }) } -/// Writes the value to the contract storage under the given key and returns -/// the size of pre-existing value at the specified key if any. +/// Writes the value to the contract storage under the given key. /// /// # Panics /// /// - If the encode length of value exceeds the configured maximum value length of a storage entry. -pub fn set_contract_storage(key: &Key, value: &V) -> Option +#[deprecated( + since = "3.3.0", + note = "`set_contract_storage_return_size()` provides more information, and will be made the standard in the future." +)] +pub fn set_contract_storage(key: &Key, value: &V) where V: scale::Encode, { ::on_instance(|instance| { EnvBackend::set_contract_storage::(instance, key, value) + }); +} + +/// Writes the value to the contract storage under the given key and returns +/// the size of the pre-existing value at the specified key if any. +/// +/// # Compatibility +/// +/// This function requires minimum `substrate-contracts-node` version [`v0.15.1`](https://github.com/paritytech/substrate-contracts-node/releases/tag/v0.15.1), +/// or any node built with Substrate version later than +/// [#7d233c2](https://github.com/paritytech/substrate/tree/7d233c2446b5a60662400a0a4bcfb78bb3b79ff7). +/// +/// # Panics +/// +/// - If the encode length of value exceeds the configured maximum value length of a storage entry. +/// +/// # Note +/// +/// This is equivalent to the [`set_contract_storage`] method, +/// but gives the information on the pre-existing value size. +pub fn set_contract_storage_return_size(key: &Key, value: &V) -> Option +where + V: scale::Encode, +{ + ::on_instance(|instance| { + EnvBackend::set_contract_storage_return_size::(instance, key, value) }) } diff --git a/crates/env/src/backend.rs b/crates/env/src/backend.rs index 43ee3252332..2c8f56207c1 100644 --- a/crates/env/src/backend.rs +++ b/crates/env/src/backend.rs @@ -162,9 +162,23 @@ impl CallFlags { /// Environmental contract functionality that does not require `Environment`. pub trait EnvBackend { + /// Writes the value to the contract storage under the given key. + fn set_contract_storage(&mut self, key: &Key, value: &V) + where + V: scale::Encode; + /// Writes the value to the contract storage under the given key and returns /// the size of the pre-existing value at the specified key if any. - fn set_contract_storage(&mut self, key: &Key, value: &V) -> Option + /// + /// # Note + /// + /// This is an equivalent to the [`set_contract_storage`][`Self::set_contract_storage`] method, + /// but gives the information on the pre-existing value size. + fn set_contract_storage_return_size( + &mut self, + key: &Key, + value: &V, + ) -> Option where V: scale::Encode; diff --git a/crates/env/src/engine/off_chain/impls.rs b/crates/env/src/engine/off_chain/impls.rs index 26e1e3b4f1a..75bd5993091 100644 --- a/crates/env/src/engine/off_chain/impls.rs +++ b/crates/env/src/engine/off_chain/impls.rs @@ -184,12 +184,20 @@ impl EnvInstance { } impl EnvBackend for EnvInstance { - fn set_contract_storage(&mut self, key: &Key, value: &V) -> Option + fn set_contract_storage(&mut self, key: &Key, value: &V) where V: scale::Encode, { let v = scale::Encode::encode(value); - self.engine.set_storage(key.as_ref(), &v[..]) + self.engine.set_storage(key.as_ref(), &v[..]); + } + + fn set_contract_storage_return_size(&mut self, key: &Key, value: &V) -> Option + where + V: scale::Encode, + { + let v = scale::Encode::encode(value); + self.engine.set_storage_return_size(key.as_ref(), &v[..]) } fn get_contract_storage(&mut self, key: &Key) -> Result> diff --git a/crates/env/src/engine/on_chain/ext.rs b/crates/env/src/engine/on_chain/ext.rs index 0ab029e22c3..5f75272bd16 100644 --- a/crates/env/src/engine/on_chain/ext.rs +++ b/crates/env/src/engine/on_chain/ext.rs @@ -231,6 +231,12 @@ mod sys { data_len: u32, ); + pub fn seal_set_storage( + key_ptr: Ptr32<[u8]>, + value_ptr: Ptr32<[u8]>, + value_len: u32, + ); + pub fn seal_get_storage( key_ptr: Ptr32<[u8]>, output_ptr: Ptr32Mut<[u8]>, @@ -375,7 +381,8 @@ mod sys { output_len_ptr: Ptr32Mut, ) -> ReturnCode; - pub fn seal_set_storage( + #[link_name = "seal_set_storage"] + pub fn seal_set_storage_return_size( key_ptr: Ptr32<[u8]>, value_ptr: Ptr32<[u8]>, value_len: u32, @@ -495,13 +502,23 @@ pub fn deposit_event(topics: &[u8], data: &[u8]) { } } -pub fn set_storage(key: &[u8], encoded_value: &[u8]) -> Option { - let ret_code = unsafe { +pub fn set_storage(key: &[u8], encoded_value: &[u8]) { + unsafe { sys::seal_set_storage( Ptr32::from_slice(key), Ptr32::from_slice(encoded_value), encoded_value.len() as u32, ) + } +} + +pub fn set_storage_return_size(key: &[u8], encoded_value: &[u8]) -> Option { + let ret_code = unsafe { + sys::seal_set_storage_return_size( + Ptr32::from_slice(key), + Ptr32::from_slice(encoded_value), + encoded_value.len() as u32, + ) }; ret_code.into() } diff --git a/crates/env/src/engine/on_chain/impls.rs b/crates/env/src/engine/on_chain/impls.rs index e8a98d71c6f..225279a5877 100644 --- a/crates/env/src/engine/on_chain/impls.rs +++ b/crates/env/src/engine/on_chain/impls.rs @@ -219,12 +219,20 @@ impl EnvInstance { } impl EnvBackend for EnvInstance { - fn set_contract_storage(&mut self, key: &Key, value: &V) -> Option + fn set_contract_storage(&mut self, key: &Key, value: &V) where V: scale::Encode, { let buffer = self.scoped_buffer().take_encoded(value); - ext::set_storage(key.as_ref(), buffer) + ext::set_storage(key.as_ref(), buffer); + } + + fn set_contract_storage_return_size(&mut self, key: &Key, value: &V) -> Option + where + V: scale::Encode, + { + let buffer = self.scoped_buffer().take_encoded(value); + ext::set_storage_return_size(key.as_ref(), buffer) } fn get_contract_storage(&mut self, key: &Key) -> Result> diff --git a/crates/eth_compatibility/Cargo.toml b/crates/eth_compatibility/Cargo.toml new file mode 100644 index 00000000000..2c30a464b5f --- /dev/null +++ b/crates/eth_compatibility/Cargo.toml @@ -0,0 +1,30 @@ +[package] +name = "ink_eth_compatibility" +version = "3.0.1" +authors = ["Parity Technologies "] +edition = "2021" + +license = "Apache-2.0" +readme = "README.md" +repository = "https://github.com/paritytech/ink" +documentation = "https://docs.rs/ink_eth_compatibility/" +homepage = "https://www.parity.io/" +description = "[ink!] Ethereum related stuff." +keywords = ["wasm", "parity", "webassembly", "blockchain", "ethereum"] +categories = ["no-std", "embedded"] +include = ["Cargo.toml", "src/**/*.rs", "/README.md", "/LICENSE"] + +[dependencies] +ink_env = { version = "3.0.1", path = "../env", default-features = false } + +[target.'cfg(not(target_os = "windows"))'.dependencies] +# We do not include `libsecp256k1` on Windows, since it's incompatible. +# We have https://github.com/paritytech/ink/issues/1068 for removing +# this dependency altogether. +libsecp256k1 = { version = "0.7.0", default-features = false } + +[features] +default = ["std"] +std = [ + "ink_env/std", +] diff --git a/crates/eth_compatibility/LICENSE b/crates/eth_compatibility/LICENSE new file mode 120000 index 00000000000..30cff7403da --- /dev/null +++ b/crates/eth_compatibility/LICENSE @@ -0,0 +1 @@ +../../LICENSE \ No newline at end of file diff --git a/crates/eth_compatibility/README.md b/crates/eth_compatibility/README.md new file mode 120000 index 00000000000..fe840054137 --- /dev/null +++ b/crates/eth_compatibility/README.md @@ -0,0 +1 @@ +../../README.md \ No newline at end of file diff --git a/crates/eth_compatibility/src/lib.rs b/crates/eth_compatibility/src/lib.rs new file mode 100644 index 00000000000..f08dba141bc --- /dev/null +++ b/crates/eth_compatibility/src/lib.rs @@ -0,0 +1,150 @@ +// Copyright 2018-2022 Parity Technologies (UK) Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#![no_std] + +use ink_env::{ + DefaultEnvironment, + Environment, +}; + +/// The ECDSA compressed public key. +#[derive(Debug, Copy, Clone)] +pub struct ECDSAPublicKey([u8; 33]); + +impl Default for ECDSAPublicKey { + fn default() -> Self { + // Default is not implemented for [u8; 33], so we can't derive it for ECDSAPublicKey + // But clippy thinks that it is possible. So it is workaround for clippy. + let empty = [0; 33]; + Self(empty) + } +} + +impl AsRef<[u8; 33]> for ECDSAPublicKey { + fn as_ref(&self) -> &[u8; 33] { + &self.0 + } +} + +impl AsMut<[u8; 33]> for ECDSAPublicKey { + fn as_mut(&mut self) -> &mut [u8; 33] { + &mut self.0 + } +} + +impl From<[u8; 33]> for ECDSAPublicKey { + fn from(bytes: [u8; 33]) -> Self { + Self(bytes) + } +} + +/// The address of an Ethereum account. +#[derive(Debug, Default, Copy, Clone)] +pub struct EthereumAddress([u8; 20]); + +impl AsRef<[u8; 20]> for EthereumAddress { + fn as_ref(&self) -> &[u8; 20] { + &self.0 + } +} + +impl AsMut<[u8; 20]> for EthereumAddress { + fn as_mut(&mut self) -> &mut [u8; 20] { + &mut self.0 + } +} + +impl From<[u8; 20]> for EthereumAddress { + fn from(bytes: [u8; 20]) -> Self { + Self(bytes) + } +} + +impl ECDSAPublicKey { + /// Returns Ethereum address from the ECDSA compressed public key. + /// + /// # Example + /// + /// ``` + /// use ink_eth_compatibility::{ECDSAPublicKey, EthereumAddress}; + /// let pub_key: ECDSAPublicKey = [ + /// 2, 121, 190, 102, 126, 249, 220, 187, 172, 85, 160, 98, 149, 206, 135, 11, + /// 7, 2, 155, 252, 219, 45, 206, 40, 217, 89, 242, 129, 91, 22, 248, 23, + /// 152, + /// ].into(); + /// + /// let EXPECTED_ETH_ADDRESS: EthereumAddress = [ + /// 126, 95, 69, 82, 9, 26, 105, 18, 93, 93, 252, 183, 184, 194, 101, 144, 41, 57, 91, 223 + /// ].into(); + /// + /// assert_eq!(pub_key.to_eth_address().as_ref(), EXPECTED_ETH_ADDRESS.as_ref()); + /// ``` + // We do not include this function on Windows, since it depends on `libsecp256k1`, + // which is incompatible with Windows. + // We have https://github.com/paritytech/ink/issues/1068 for removing this + // dependency altogether. + #[cfg(not(target_os = "windows"))] + pub fn to_eth_address(&self) -> EthereumAddress { + use ink_env::hash; + use libsecp256k1::PublicKey; + + // Transform compressed public key into uncompressed. + let pub_key = PublicKey::parse_compressed(&self.0) + .expect("Unable to parse the compressed ECDSA public key"); + let uncompressed = pub_key.serialize(); + + // Hash the uncompressed public key by Keccak256 algorithm. + let mut hash = ::Type::default(); + // The first byte indicates that the public key is uncompressed. + // Let's skip it for hashing the public key directly. + ink_env::hash_bytes::(&uncompressed[1..], &mut hash); + + // Take the last 20 bytes as an Address + let mut result = EthereumAddress::default(); + result.as_mut().copy_from_slice(&hash[12..]); + + result + } + + /// Returns the default Substrate's `AccountId` from the ECDSA compressed public key. + /// It hashes the compressed public key with the `blake2b_256` algorithm like in substrate. + /// + /// # Example + /// + /// ``` + /// use ink_eth_compatibility::ECDSAPublicKey; + /// let pub_key: ECDSAPublicKey = [ + /// 2, 121, 190, 102, 126, 249, 220, 187, 172, 85, 160, 98, 149, 206, 135, 11, + /// 7, 2, 155, 252, 219, 45, 206, 40, 217, 89, 242, 129, 91, 22, 248, 23, + /// 152, + /// ].into(); + /// + /// const EXPECTED_ACCOUNT_ID: [u8; 32] = [ + /// 41, 117, 241, 210, 139, 146, 182, 232, 68, 153, 184, 59, 7, 151, 239, 82, + /// 53, 85, 62, 235, 126, 218, 160, 206, 162, 67, 193, 18, 140, 47, 231, 55, + /// ]; + /// + /// assert_eq!(pub_key.to_default_account_id(), EXPECTED_ACCOUNT_ID.into()); + pub fn to_default_account_id( + &self, + ) -> ::AccountId { + use ink_env::hash; + + let mut output = ::Type::default(); + ink_env::hash_bytes::(&self.0[..], &mut output); + + output.into() + } +} diff --git a/crates/lang/Cargo.toml b/crates/lang/Cargo.toml index e91f01ffb38..dfc2c3ee823 100644 --- a/crates/lang/Cargo.toml +++ b/crates/lang/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ink_lang" -version = "3.2.0" +version = "3.3.0" authors = ["Parity Technologies ", "Robin Freyler "] edition = "2021" @@ -15,19 +15,19 @@ categories = ["no-std", "embedded"] include = ["Cargo.toml", "src/**/*.rs", "README.md", "LICENSE"] [dependencies] -ink_env = { version = "3.2.0", path = "../env", default-features = false } -ink_storage = { version = "3.2.0", path = "../storage", default-features = false } -ink_primitives = { version = "3.2.0", path = "../primitives", default-features = false } -ink_metadata = { version = "3.2.0", path = "../metadata", default-features = false, optional = true } -ink_prelude = { version = "3.2.0", path = "../prelude", default-features = false } -ink_lang_macro = { version = "3.2.0", path = "macro", default-features = false } +ink_env = { version = "3.3.0", path = "../env", default-features = false } +ink_storage = { version = "3.3.0", path = "../storage", default-features = false } +ink_primitives = { version = "3.3.0", path = "../primitives", default-features = false } +ink_metadata = { version = "3.3.0", path = "../metadata", default-features = false, optional = true } +ink_prelude = { version = "3.3.0", path = "../prelude", default-features = false } +ink_lang_macro = { version = "3.3.0", path = "macro", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive", "full"] } derive_more = { version = "0.99", default-features = false, features = ["from"] } [dev-dependencies] -ink_lang_ir = { version = "3.2.0", path = "ir" } -ink_metadata = { version = "3.2.0", default-features = false, path = "../metadata" } +ink_lang_ir = { version = "3.3.0", path = "ir" } +ink_metadata = { version = "3.3.0", default-features = false, path = "../metadata" } trybuild = { version = "1.0.60", features = ["diff"] } # Required for the doctest of `env_access::EnvAccess::instantiate_contract` diff --git a/crates/lang/codegen/Cargo.toml b/crates/lang/codegen/Cargo.toml index 46b771c02a3..d9378d603b2 100644 --- a/crates/lang/codegen/Cargo.toml +++ b/crates/lang/codegen/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ink_lang_codegen" -version = "3.2.0" +version = "3.3.0" authors = ["Parity Technologies ", "Robin Freyler "] edition = "2021" @@ -18,7 +18,7 @@ include = ["Cargo.toml", "src/**/*.rs", "README.md", "LICENSE"] name = "ink_lang_codegen" [dependencies] -ir = { version = "3.2.0", package = "ink_lang_ir", path = "../ir", default-features = false } +ir = { version = "3.3.0", package = "ink_lang_ir", path = "../ir", default-features = false } quote = "1" syn = { version = "1.0", features = ["parsing", "full", "extra-traits"] } proc-macro2 = "1.0" diff --git a/crates/lang/codegen/src/generator/dispatch.rs b/crates/lang/codegen/src/generator/dispatch.rs index c9b05580c44..fee922033e5 100644 --- a/crates/lang/codegen/src/generator/dispatch.rs +++ b/crates/lang/codegen/src/generator/dispatch.rs @@ -532,8 +532,6 @@ impl Dispatch<'_> { } } }; - let any_constructor_accept_payment = - self.any_constructor_accepts_payment_expr(constructor_spans); let constructor_execute = (0..count_constructors).map(|index| { let constructor_span = constructor_spans[index]; @@ -545,8 +543,9 @@ impl Dispatch<'_> { }>>::IDS[#index] }>>::CALLABLE ); - let deny_payment = quote_spanned!(constructor_span=> - !<#storage_ident as ::ink_lang::reflect::DispatchableConstructorInfo<{ + let accepts_payment = quote_spanned!(constructor_span=> + false || + <#storage_ident as ::ink_lang::reflect::DispatchableConstructorInfo<{ <#storage_ident as ::ink_lang::reflect::ContractDispatchableConstructors<{ <#storage_ident as ::ink_lang::reflect::ContractAmountDispatchables>::CONSTRUCTORS }>>::IDS[#index] @@ -555,12 +554,10 @@ impl Dispatch<'_> { quote_spanned!(constructor_span=> Self::#constructor_ident(input) => { - if #any_constructor_accept_payment && #deny_payment { - ::ink_lang::codegen::deny_payment::< - <#storage_ident as ::ink_lang::reflect::ContractEnv>::Env>()?; - } - ::ink_lang::codegen::execute_constructor::<#storage_ident, _, _>( + ::ink_lang::codegen::ExecuteConstructorConfig { + payable: #accepts_payment, + }, move || { #constructor_callable(input) } ) } @@ -695,8 +692,6 @@ impl Dispatch<'_> { } } }; - let any_message_accept_payment = - self.any_message_accepts_payment_expr(message_spans); let message_execute = (0..count_messages).map(|index| { let message_span = message_spans[index]; @@ -734,7 +729,7 @@ impl Dispatch<'_> { Self::#message_ident(input) => { use ::core::default::Default; - if #any_message_accept_payment && #deny_payment { + if #deny_payment { ::ink_lang::codegen::deny_payment::< <#storage_ident as ::ink_lang::reflect::ContractEnv>::Env>()?; } diff --git a/crates/lang/ir/Cargo.toml b/crates/lang/ir/Cargo.toml index d4c67874efc..b019c9a8c48 100644 --- a/crates/lang/ir/Cargo.toml +++ b/crates/lang/ir/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ink_lang_ir" -version = "3.2.0" +version = "3.3.0" authors = ["Parity Technologies ", "Robin Freyler "] edition = "2021" diff --git a/crates/lang/macro/Cargo.toml b/crates/lang/macro/Cargo.toml index 033ba02ba16..1a26e8f858a 100644 --- a/crates/lang/macro/Cargo.toml +++ b/crates/lang/macro/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ink_lang_macro" -version = "3.2.0" +version = "3.3.0" authors = ["Parity Technologies ", "Robin Freyler "] edition = "2021" @@ -15,19 +15,19 @@ categories = ["no-std", "embedded"] include = ["Cargo.toml", "src/**/*.rs", "README.md", "LICENSE"] [dependencies] -ink_lang_ir = { version = "3.2.0", path = "../ir", default-features = false } -ink_lang_codegen = { version = "3.2.0", path = "../codegen", default-features = false } -ink_primitives = { version = "3.2.0", path = "../../primitives/", default-features = false } +ink_lang_ir = { version = "3.3.0", path = "../ir", default-features = false } +ink_lang_codegen = { version = "3.3.0", path = "../codegen", default-features = false } +ink_primitives = { version = "3.3.0", path = "../../primitives/", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } syn = "1" proc-macro2 = "1" [dev-dependencies] -ink_metadata = { version = "3.2.0", path = "../../metadata/" } -ink_env = { version = "3.2.0", path = "../../env/" } -ink_storage = { version = "3.2.0", path = "../../storage/" } -ink_lang = { version = "3.2.0", path = ".." } +ink_metadata = { version = "3.3.0", path = "../../metadata/" } +ink_env = { version = "3.3.0", path = "../../env/" } +ink_storage = { version = "3.3.0", path = "../../storage/" } +ink_lang = { version = "3.3.0", path = ".." } scale-info = { version = "2", default-features = false, features = ["derive"] } [lib] diff --git a/crates/lang/src/codegen/dispatch/execution.rs b/crates/lang/src/codegen/dispatch/execution.rs index 749b1d841dc..41cfe88c1ab 100644 --- a/crates/lang/src/codegen/dispatch/execution.rs +++ b/crates/lang/src/codegen/dispatch/execution.rs @@ -64,6 +64,13 @@ where Ok(()) } +/// Configuration for execution of ink! constructor. +#[derive(Debug, Copy, Clone)] +pub struct ExecuteConstructorConfig { + /// Yields `true` if the ink! constructor accepts payment. + pub payable: bool, +} + /// Executes the given ink! constructor. /// /// # Note @@ -71,13 +78,19 @@ where /// The closure is supposed to already contain all the arguments that the real /// constructor message requires and forwards them. #[inline] -pub fn execute_constructor(f: F) -> Result<(), DispatchError> +pub fn execute_constructor( + config: ExecuteConstructorConfig, + f: F, +) -> Result<(), DispatchError> where Contract: SpreadLayout + ContractRootKey + ContractEnv, F: FnOnce() -> R, as ConstructorReturnType>::ReturnValue: scale::Encode, private::Seal: ConstructorReturnType, { + if !config.payable { + deny_payment::<::Env>()?; + } let result = ManuallyDrop::new(private::Seal(f())); match result.as_result() { Ok(contract) => { diff --git a/crates/lang/src/codegen/dispatch/mod.rs b/crates/lang/src/codegen/dispatch/mod.rs index 3908e094fba..93429dddfed 100644 --- a/crates/lang/src/codegen/dispatch/mod.rs +++ b/crates/lang/src/codegen/dispatch/mod.rs @@ -22,6 +22,7 @@ pub use self::{ execute_constructor, initialize_contract, ContractRootKey, + ExecuteConstructorConfig, }, info::ContractCallBuilder, type_check::{ diff --git a/crates/lang/src/codegen/mod.rs b/crates/lang/src/codegen/mod.rs index e22b0079021..b11c5ca71cb 100644 --- a/crates/lang/src/codegen/mod.rs +++ b/crates/lang/src/codegen/mod.rs @@ -30,6 +30,7 @@ pub use self::{ ContractRootKey, DispatchInput, DispatchOutput, + ExecuteConstructorConfig, }, env::{ Env, diff --git a/crates/metadata/Cargo.toml b/crates/metadata/Cargo.toml index e9e780945f2..0da3de9d69d 100644 --- a/crates/metadata/Cargo.toml +++ b/crates/metadata/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ink_metadata" -version = "3.2.0" +version = "3.3.0" authors = ["Parity Technologies ", "Robin Freyler "] edition = "2021" @@ -15,8 +15,8 @@ categories = ["no-std", "embedded"] include = ["Cargo.toml", "src/**/*.rs", "README.md", "LICENSE"] [dependencies] -ink_prelude = { version = "3.2.0", path = "../prelude/", default-features = false } -ink_primitives = { version = "3.2.0", path = "../primitives/", default-features = false } +ink_prelude = { version = "3.3.0", path = "../prelude/", default-features = false } +ink_primitives = { version = "3.3.0", path = "../primitives/", default-features = false } serde = { version = "1.0", default-features = false, features = ["derive", "alloc"] } impl-serde = "0.3.1" diff --git a/crates/prelude/Cargo.toml b/crates/prelude/Cargo.toml index 62cff59607a..34fbd4b3493 100644 --- a/crates/prelude/Cargo.toml +++ b/crates/prelude/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ink_prelude" -version = "3.2.0" +version = "3.3.0" authors = ["Parity Technologies ", "Robin Freyler "] edition = "2021" diff --git a/crates/primitives/Cargo.toml b/crates/primitives/Cargo.toml index 63ab4f06eb5..45e2cc283c7 100644 --- a/crates/primitives/Cargo.toml +++ b/crates/primitives/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ink_primitives" -version = "3.2.0" +version = "3.3.0" authors = ["Parity Technologies ", "Robin Freyler "] edition = "2021" @@ -15,7 +15,7 @@ categories = ["no-std", "embedded"] include = ["/Cargo.toml", "src/**/*.rs", "/README.md", "/LICENSE"] [dependencies] -ink_prelude = { version = "3.2.0", path = "../prelude/", default-features = false } +ink_prelude = { version = "3.3.0", path = "../prelude/", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive", "full"] } scale-info = { version = "2", default-features = false, features = ["derive"], optional = true } cfg-if = "1" diff --git a/crates/storage/Cargo.toml b/crates/storage/Cargo.toml index fa4f6832a0c..c574554d682 100644 --- a/crates/storage/Cargo.toml +++ b/crates/storage/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ink_storage" -version = "3.2.0" +version = "3.3.0" authors = ["Parity Technologies ", "Robin Freyler "] edition = "2021" @@ -15,11 +15,11 @@ categories = ["no-std", "embedded"] include = ["Cargo.toml", "src/**/*.rs", "README.md", "LICENSE"] [dependencies] -ink_env = { version = "3.2.0", path = "../env/", default-features = false } -ink_metadata = { version = "3.2.0", path = "../metadata/", default-features = false, features = ["derive"], optional = true } -ink_primitives = { version = "3.2.0", path = "../primitives/", default-features = false } -ink_storage_derive = { version = "3.2.0", path = "derive", default-features = false } -ink_prelude = { version = "3.2.0", path = "../prelude/", default-features = false } +ink_env = { version = "3.3.0", path = "../env/", default-features = false } +ink_metadata = { version = "3.3.0", path = "../metadata/", default-features = false, features = ["derive"], optional = true } +ink_primitives = { version = "3.3.0", path = "../primitives/", default-features = false } +ink_storage_derive = { version = "3.3.0", path = "derive", default-features = false } +ink_prelude = { version = "3.3.0", path = "../prelude/", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive", "full"] } derive_more = { version = "0.99", default-features = false, features = ["from", "display"] } @@ -33,7 +33,7 @@ quickcheck_macros = "1.0" itertools = "0.10" paste = "1.0" -ink_lang = { version = "3.2.0", path = "../lang/", default-features = false } +ink_lang = { version = "3.3.0", path = "../lang/", default-features = false } [features] default = ["std"] diff --git a/crates/storage/derive/Cargo.toml b/crates/storage/derive/Cargo.toml index 66ba233965b..100cb7da597 100644 --- a/crates/storage/derive/Cargo.toml +++ b/crates/storage/derive/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ink_storage_derive" -version = "3.2.0" +version = "3.3.0" authors = ["Parity Technologies ", "Robin Freyler "] edition = "2021" @@ -25,8 +25,8 @@ synstructure = "0.12.4" [dev-dependencies] scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive", "full"] } -ink_env = { version = "3.2.0", path = "../../env" } -ink_primitives = { version = "3.2.0", path = "../../primitives" } -ink_metadata = { version = "3.2.0", path = "../../metadata" } -ink_prelude = { version = "3.2.0", path = "../../prelude/" } -ink_storage = { version = "3.2.0", path = ".." } +ink_env = { version = "3.3.0", path = "../../env" } +ink_primitives = { version = "3.3.0", path = "../../primitives" } +ink_metadata = { version = "3.3.0", path = "../../metadata" } +ink_prelude = { version = "3.3.0", path = "../../prelude/" } +ink_storage = { version = "3.3.0", path = ".." } diff --git a/crates/storage/src/lazy/mapping.rs b/crates/storage/src/lazy/mapping.rs index c1d5b78ba6b..7d6ad46c4ce 100644 --- a/crates/storage/src/lazy/mapping.rs +++ b/crates/storage/src/lazy/mapping.rs @@ -22,6 +22,7 @@ use crate::traits::{ pull_packed_root_opt, push_packed_root, + push_packed_root_return_size, ExtKeyPtr, KeyPtr, PackedLayout, @@ -143,7 +144,7 @@ where Q: scale::EncodeLike, R: scale::EncodeLike + PackedLayout, { - push_packed_root(value, &self.storage_key(&key)) + push_packed_root_return_size(value, &self.storage_key(&key)) } /// Get the `value` at `key` from the contract storage. diff --git a/crates/storage/src/traits/mod.rs b/crates/storage/src/traits/mod.rs index f89c1f580be..09cb7702061 100644 --- a/crates/storage/src/traits/mod.rs +++ b/crates/storage/src/traits/mod.rs @@ -187,21 +187,38 @@ where /// Pushes the entity to the contract storage using packed layout. /// -/// The root key denotes the offset into the contract storage where the -/// instance of type `T` is being pushed to. -/// /// # Note /// /// - The routine will push the given entity to the contract storage using /// packed layout. /// - Users should prefer using this function directly instead of using the /// trait methods on [`PackedLayout`]. -pub fn push_packed_root(entity: &T, root_key: &Key) -> Option +pub fn push_packed_root(entity: &T, root_key: &Key) +where + T: PackedLayout, +{ + ::push_packed(entity, root_key); + + #[allow(deprecated)] + ink_env::set_contract_storage(root_key, entity); +} + +/// Pushes the entity to the contract storage using packed layout and +/// returns the size of the pre-existing value if any. +/// +/// The root key denotes the offset into the contract storage where the +/// instance of type `T` is being pushed to. +/// +/// # Note +/// +/// This is an equivalent to [`push_packed_root`], +/// but gives the information on the pre-existing value size. +pub fn push_packed_root_return_size(entity: &T, root_key: &Key) -> Option where T: PackedLayout, { ::push_packed(entity, root_key); - ink_env::set_contract_storage(root_key, entity) + ink_env::set_contract_storage_return_size(root_key, entity) } /// Clears the entity from the contract storage using packed layout. diff --git a/examples/contract-terminate/Cargo.toml b/examples/contract-terminate/Cargo.toml index 93037a5da10..61c1f9a8092 100644 --- a/examples/contract-terminate/Cargo.toml +++ b/examples/contract-terminate/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "contract_terminate" -version = "3.2.0" +version = "3.3.0" authors = ["Parity Technologies "] edition = "2021" publish = false diff --git a/examples/contract-transfer/Cargo.toml b/examples/contract-transfer/Cargo.toml index c5683626fa4..29aa9361d1b 100644 --- a/examples/contract-transfer/Cargo.toml +++ b/examples/contract-transfer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "contract_transfer" -version = "3.2.0" +version = "3.3.0" authors = ["Parity Technologies "] edition = "2021" publish = false diff --git a/examples/delegator/Cargo.toml b/examples/delegator/Cargo.toml index 003547185ec..132e151b565 100644 --- a/examples/delegator/Cargo.toml +++ b/examples/delegator/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "delegator" -version = "3.2.0" +version = "3.3.0" authors = ["Parity Technologies "] edition = "2021" publish = false diff --git a/examples/delegator/accumulator/Cargo.toml b/examples/delegator/accumulator/Cargo.toml index 2423ea2e81f..27d704df054 100644 --- a/examples/delegator/accumulator/Cargo.toml +++ b/examples/delegator/accumulator/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "accumulator" -version = "3.2.0" +version = "3.3.0" authors = ["Parity Technologies "] edition = "2021" diff --git a/examples/delegator/adder/Cargo.toml b/examples/delegator/adder/Cargo.toml index bd54fbd9a72..88f2ae527c2 100644 --- a/examples/delegator/adder/Cargo.toml +++ b/examples/delegator/adder/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "adder" -version = "3.2.0" +version = "3.3.0" authors = ["Parity Technologies "] edition = "2021" diff --git a/examples/delegator/subber/Cargo.toml b/examples/delegator/subber/Cargo.toml index 4376c7b6ad0..8ac033a1f2e 100644 --- a/examples/delegator/subber/Cargo.toml +++ b/examples/delegator/subber/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subber" -version = "3.2.0" +version = "3.3.0" authors = ["Parity Technologies "] edition = "2021" diff --git a/examples/dns/Cargo.toml b/examples/dns/Cargo.toml index 67945cf0595..8b09c34d261 100644 --- a/examples/dns/Cargo.toml +++ b/examples/dns/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dns" -version = "3.2.0" +version = "3.3.0" authors = ["Parity Technologies "] edition = "2021" publish = false diff --git a/examples/erc1155/Cargo.toml b/examples/erc1155/Cargo.toml index 59e800b444e..c281884f6eb 100644 --- a/examples/erc1155/Cargo.toml +++ b/examples/erc1155/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "erc1155" -version = "3.2.0" +version = "3.3.0" authors = ["Parity Technologies "] edition = "2021" publish = false diff --git a/examples/erc20/Cargo.toml b/examples/erc20/Cargo.toml index 1125b46212d..4d42b87d6c5 100644 --- a/examples/erc20/Cargo.toml +++ b/examples/erc20/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "erc20" -version = "3.2.0" +version = "3.3.0" authors = ["Parity Technologies "] edition = "2021" publish = false diff --git a/examples/erc721/Cargo.toml b/examples/erc721/Cargo.toml index 90ee3bdbaa6..a3c0ca60fba 100644 --- a/examples/erc721/Cargo.toml +++ b/examples/erc721/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "erc721" -version = "3.2.0" +version = "3.3.0" authors = ["Parity Technologies "] edition = "2021" publish = false diff --git a/examples/flipper/Cargo.toml b/examples/flipper/Cargo.toml index 2117d38f5eb..b728b6dbf7f 100644 --- a/examples/flipper/Cargo.toml +++ b/examples/flipper/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "flipper" -version = "3.2.0" +version = "3.3.0" authors = ["Parity Technologies "] edition = "2021" publish = false diff --git a/examples/incrementer/Cargo.toml b/examples/incrementer/Cargo.toml index 46b62df511f..798c5733728 100644 --- a/examples/incrementer/Cargo.toml +++ b/examples/incrementer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "incrementer" -version = "3.2.0" +version = "3.3.0" authors = ["Parity Technologies "] edition = "2021" publish = false diff --git a/examples/multisig/Cargo.toml b/examples/multisig/Cargo.toml index 1346bf63910..3cff2ca4a38 100755 --- a/examples/multisig/Cargo.toml +++ b/examples/multisig/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "multisig" -version = "3.2.0" +version = "3.3.0" authors = ["Parity Technologies "] edition = "2021" publish = false diff --git a/examples/rand-extension/Cargo.toml b/examples/rand-extension/Cargo.toml index 58808a267b1..76abed6a9f4 100755 --- a/examples/rand-extension/Cargo.toml +++ b/examples/rand-extension/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rand_extension" -version = "3.2.0" +version = "3.3.0" authors = ["Parity Technologies "] edition = "2021" publish = false diff --git a/examples/trait-erc20/Cargo.toml b/examples/trait-erc20/Cargo.toml index d328b24cf56..54e1567f417 100644 --- a/examples/trait-erc20/Cargo.toml +++ b/examples/trait-erc20/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "trait_erc20" -version = "3.2.0" +version = "3.3.0" authors = ["Parity Technologies "] edition = "2021" publish = false diff --git a/examples/trait-flipper/Cargo.toml b/examples/trait-flipper/Cargo.toml index ccdfcc532a9..3886952b167 100644 --- a/examples/trait-flipper/Cargo.toml +++ b/examples/trait-flipper/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "trait_flipper" -version = "3.2.0" +version = "3.3.0" authors = ["Parity Technologies "] edition = "2021" publish = false diff --git a/examples/trait-incrementer/Cargo.toml b/examples/trait-incrementer/Cargo.toml index 6f9c5a43131..b7887de3ef4 100644 --- a/examples/trait-incrementer/Cargo.toml +++ b/examples/trait-incrementer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "trait-incrementer" -version = "3.2.0" +version = "3.3.0" authors = ["Parity Technologies "] edition = "2021" publish = false diff --git a/examples/trait-incrementer/traits/Cargo.toml b/examples/trait-incrementer/traits/Cargo.toml index 68b43066406..fcac96888fa 100644 --- a/examples/trait-incrementer/traits/Cargo.toml +++ b/examples/trait-incrementer/traits/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "traits" -version = "3.2.0" +version = "3.3.0" authors = ["Parity Technologies "] edition = "2021" publish = false diff --git a/examples/upgradeable-contracts/delegate-calls/Cargo.toml b/examples/upgradeable-contracts/delegate-calls/Cargo.toml index 53f65f0b75b..87502bc1741 100644 --- a/examples/upgradeable-contracts/delegate-calls/Cargo.toml +++ b/examples/upgradeable-contracts/delegate-calls/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "delegate_calls" -version = "3.2.0" +version = "3.3.0" authors = ["Parity Technologies "] edition = "2021" publish = false diff --git a/examples/upgradeable-contracts/delegate-calls/upgradeable-flipper/Cargo.toml b/examples/upgradeable-contracts/delegate-calls/upgradeable-flipper/Cargo.toml index d1d3d5abc07..536c924adfb 100644 --- a/examples/upgradeable-contracts/delegate-calls/upgradeable-flipper/Cargo.toml +++ b/examples/upgradeable-contracts/delegate-calls/upgradeable-flipper/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "upgradeable_flipper" -version = "3.2.0" +version = "3.3.0" authors = ["Parity Technologies "] edition = "2021" publish = false diff --git a/examples/upgradeable-contracts/forward-calls/Cargo.toml b/examples/upgradeable-contracts/forward-calls/Cargo.toml index b607befb9f4..f02a2f160dc 100644 --- a/examples/upgradeable-contracts/forward-calls/Cargo.toml +++ b/examples/upgradeable-contracts/forward-calls/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "forward_calls" -version = "3.2.0" +version = "3.3.0" authors = ["Parity Technologies "] edition = "2021" publish = false diff --git a/examples/upgradeable-contracts/set-code-hash/Cargo.toml b/examples/upgradeable-contracts/set-code-hash/Cargo.toml index 96430ba8cf4..62112f54e36 100644 --- a/examples/upgradeable-contracts/set-code-hash/Cargo.toml +++ b/examples/upgradeable-contracts/set-code-hash/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "incrementer" -version = "3.2.0" +version = "3.3.0" edition = "2021" authors = ["Parity Technologies "] publish = false diff --git a/examples/upgradeable-contracts/set-code-hash/updated-incrementer/Cargo.toml b/examples/upgradeable-contracts/set-code-hash/updated-incrementer/Cargo.toml index 71578227cc0..3b60fce05b7 100644 --- a/examples/upgradeable-contracts/set-code-hash/updated-incrementer/Cargo.toml +++ b/examples/upgradeable-contracts/set-code-hash/updated-incrementer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "updated-incrementer" -version = "3.2.0" +version = "3.3.0" edition = "2021" authors = ["Parity Technologies "] publish = false