From 0021ed7b69e1e18ccc02127d3b2e1c80c4592db9 Mon Sep 17 00:00:00 2001 From: Sebastian Miasojed Date: Wed, 13 Mar 2024 15:01:55 +0100 Subject: [PATCH] Update to ink 5.0.0 --- basic-contract-caller/Cargo.toml | 6 +- .../other-contract/Cargo.toml | 6 +- call-runtime/Cargo.toml | 6 +- combined-extension/Cargo.toml | 4 +- conditional-compilation/Cargo.toml | 6 +- contract-storage/Cargo.toml | 6 +- contract-terminate/Cargo.toml | 6 +- contract-transfer/Cargo.toml | 6 +- cross-contract-calls/Cargo.toml | 6 +- cross-contract-calls/e2e_tests.rs | 12 +- cross-contract-calls/lib.rs | 10 +- .../other-contract/Cargo.toml | 6 +- custom-allocator/Cargo.toml | 6 +- custom-environment/Cargo.toml | 6 +- dns/Cargo.toml | 4 +- e2e-call-runtime/Cargo.toml | 6 +- e2e-runtime-only-backend/.gitignore | 9 + e2e-runtime-only-backend/Cargo.toml | 23 + e2e-runtime-only-backend/lib.rs | 165 +++++++ erc1155/Cargo.toml | 4 +- erc20/Cargo.toml | 6 +- erc721/Cargo.toml | 4 +- events/.gitignore | 9 + events/Cargo.toml | 35 ++ events/event-def-unused/Cargo.toml | 13 + events/event-def-unused/src/lib.rs | 15 + events/event-def/Cargo.toml | 13 + events/event-def/src/lib.rs | 14 + events/event-def2/Cargo.toml | 13 + events/event-def2/src/lib.rs | 9 + events/lib.rs | 415 ++++++++++++++++++ flipper/Cargo.toml | 6 +- incrementer/Cargo.toml | 4 +- lazyvec/Cargo.toml | 6 +- mapping/Cargo.toml | 6 +- multi-contract-caller/Cargo.toml | 6 +- multi-contract-caller/accumulator/Cargo.toml | 4 +- multi-contract-caller/adder/Cargo.toml | 4 +- multi-contract-caller/subber/Cargo.toml | 4 +- multisig/Cargo.toml | 4 +- payment-channel/Cargo.toml | 4 +- psp22-extension/Cargo.toml | 4 +- rand-extension/Cargo.toml | 4 +- static-buffer/Cargo.toml | 6 +- trait-dyn-cross-contract-calls/Cargo.toml | 6 +- .../contracts/incrementer/Cargo.toml | 4 +- .../traits/Cargo.toml | 4 +- trait-erc20/Cargo.toml | 4 +- trait-flipper/Cargo.toml | 4 +- trait-incrementer/Cargo.toml | 4 +- trait-incrementer/traits/Cargo.toml | 4 +- upgradeable-contracts/delegator/Cargo.toml | 6 +- .../delegator/delegatee/Cargo.toml | 4 +- .../delegator/delegatee2/Cargo.toml | 4 +- .../set-code-hash-migration/Cargo.toml | 6 +- .../migration/Cargo.toml | 4 +- .../updated-incrementer/Cargo.toml | 4 +- .../set-code-hash/Cargo.toml | 6 +- .../updated-incrementer/Cargo.toml | 4 +- vesting/Cargo.toml | 4 +- wildcard-selector/Cargo.toml | 6 +- workspace-contracts/Cargo.toml | 4 +- workspace-contracts/flipper/Cargo.toml | 2 +- workspace-contracts/incrementer/Cargo.toml | 2 +- 64 files changed, 865 insertions(+), 132 deletions(-) create mode 100644 e2e-runtime-only-backend/.gitignore create mode 100644 e2e-runtime-only-backend/Cargo.toml create mode 100644 e2e-runtime-only-backend/lib.rs create mode 100644 events/.gitignore create mode 100644 events/Cargo.toml create mode 100644 events/event-def-unused/Cargo.toml create mode 100644 events/event-def-unused/src/lib.rs create mode 100644 events/event-def/Cargo.toml create mode 100644 events/event-def/src/lib.rs create mode 100644 events/event-def2/Cargo.toml create mode 100644 events/event-def2/src/lib.rs create mode 100644 events/lib.rs diff --git a/basic-contract-caller/Cargo.toml b/basic-contract-caller/Cargo.toml index f42e4d3c..8d88c014 100755 --- a/basic-contract-caller/Cargo.toml +++ b/basic-contract-caller/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "basic-contract-caller" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" publish = false [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } # Note: We **need** to specify the `ink-as-dependency` feature. # @@ -14,7 +14,7 @@ ink = { version = "5.0.0-rc.2", default-features = false } other-contract = { path = "other-contract", default-features = false, features = ["ink-as-dependency"] } [dev-dependencies] -ink_e2e = { version = "5.0.0-rc.2" } +ink_e2e = { version = "5.0.0" } [lib] path = "lib.rs" diff --git a/basic-contract-caller/other-contract/Cargo.toml b/basic-contract-caller/other-contract/Cargo.toml index 947bd1f7..5d086631 100755 --- a/basic-contract-caller/other-contract/Cargo.toml +++ b/basic-contract-caller/other-contract/Cargo.toml @@ -1,15 +1,15 @@ [package] name = "other-contract" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" publish = false [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } [dev-dependencies] -ink_e2e = { version = "5.0.0-rc.2" } +ink_e2e = { version = "5.0.0" } [lib] path = "lib.rs" diff --git a/call-runtime/Cargo.toml b/call-runtime/Cargo.toml index 6d2f9010..d7269184 100644 --- a/call-runtime/Cargo.toml +++ b/call-runtime/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "call-runtime" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" publish = false [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } # Substrate # @@ -18,7 +18,7 @@ sp-io = { version = "23.0.0", default-features = false, features = ["disable_pan sp-runtime = { version = "24.0.0", default-features = false } [dev-dependencies] -ink_e2e = { version = "5.0.0-rc.2" } +ink_e2e = { version = "5.0.0" } [lib] path = "lib.rs" diff --git a/combined-extension/Cargo.toml b/combined-extension/Cargo.toml index 2830764a..2d119dd1 100755 --- a/combined-extension/Cargo.toml +++ b/combined-extension/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "combined_extension" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" publish = false [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } psp22_extension = { path = "../psp22-extension", default-features = false, features = ["ink-as-dependency"] } rand_extension = { path = "../rand-extension", default-features = false, features = ["ink-as-dependency"] } diff --git a/conditional-compilation/Cargo.toml b/conditional-compilation/Cargo.toml index f7c0d9b9..f57789ce 100755 --- a/conditional-compilation/Cargo.toml +++ b/conditional-compilation/Cargo.toml @@ -1,14 +1,14 @@ [package] name = "conditional-compilation" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } [dev-dependencies] -ink_e2e = { version = "5.0.0-rc.2" } +ink_e2e = { version = "5.0.0" } [lib] path = "lib.rs" diff --git a/contract-storage/Cargo.toml b/contract-storage/Cargo.toml index 15606532..37a40e23 100755 --- a/contract-storage/Cargo.toml +++ b/contract-storage/Cargo.toml @@ -1,15 +1,15 @@ [package] name = "contract-storage" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" publish = false [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } [dev-dependencies] -ink_e2e = { version = "5.0.0-rc.2" } +ink_e2e = { version = "5.0.0" } [lib] path = "lib.rs" diff --git a/contract-terminate/Cargo.toml b/contract-terminate/Cargo.toml index 9f48c84c..78a54a29 100644 --- a/contract-terminate/Cargo.toml +++ b/contract-terminate/Cargo.toml @@ -1,15 +1,15 @@ [package] name = "contract_terminate" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" publish = false [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } [dev-dependencies] -ink_e2e = { version = "5.0.0-rc.2" } +ink_e2e = { version = "5.0.0" } [lib] path = "lib.rs" diff --git a/contract-transfer/Cargo.toml b/contract-transfer/Cargo.toml index d0710384..01592ff3 100644 --- a/contract-transfer/Cargo.toml +++ b/contract-transfer/Cargo.toml @@ -1,15 +1,15 @@ [package] name = "contract_transfer" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" publish = false [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } [dev-dependencies] -ink_e2e = { version = "5.0.0-rc.2" } +ink_e2e = { version = "5.0.0" } [lib] path = "lib.rs" diff --git a/cross-contract-calls/Cargo.toml b/cross-contract-calls/Cargo.toml index bc5acdff..89a31d81 100755 --- a/cross-contract-calls/Cargo.toml +++ b/cross-contract-calls/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "cross-contract-calls" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" publish = false [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } # Note: We **need** to specify the `ink-as-dependency` feature. # @@ -14,7 +14,7 @@ ink = { version = "5.0.0-rc.2", default-features = false } other-contract = { path = "other-contract", default-features = false, features = ["ink-as-dependency"] } [dev-dependencies] -ink_e2e = { version = "5.0.0-rc.2" } +ink_e2e = { version = "5.0.0" } [lib] path = "lib.rs" diff --git a/cross-contract-calls/e2e_tests.rs b/cross-contract-calls/e2e_tests.rs index ea66516d..26d168aa 100644 --- a/cross-contract-calls/e2e_tests.rs +++ b/cross-contract-calls/e2e_tests.rs @@ -46,13 +46,13 @@ async fn instantiate_v2_with_insufficient_storage_deposit_limit( .expect("other_contract upload failed"); const REF_TIME_LIMIT: u64 = 500_000_000; - const PROOF_TIME_LIMIT: u64 = 100_000; + const PROOF_SIZE_LIMIT: u64 = 100_000; const STORAGE_DEPOSIT_LIMIT: u128 = 500_000_000_000; let mut constructor = CrossContractCallsRef::new_v2_with_limits( other_contract_code.code_hash, REF_TIME_LIMIT, - PROOF_TIME_LIMIT, + PROOF_SIZE_LIMIT, STORAGE_DEPOSIT_LIMIT, ); let contract = client @@ -147,13 +147,13 @@ async fn flip_and_get_v2(mut client: Client) -> E2EResult<() let mut call_builder = contract.call_builder::(); const REF_TIME_LIMIT: u64 = 500_000_000; - const PROOF_TIME_LIMIT: u64 = 100_000; + const PROOF_SIZE_LIMIT: u64 = 100_000; const STORAGE_DEPOSIT_LIMIT: u128 = 1_000_000_000; // when let call = call_builder.flip_and_get_invoke_v2_with_limits( REF_TIME_LIMIT, - PROOF_TIME_LIMIT, + PROOF_SIZE_LIMIT, STORAGE_DEPOSIT_LIMIT, ); let result = client diff --git a/cross-contract-calls/lib.rs b/cross-contract-calls/lib.rs index 33561715..297c544d 100755 --- a/cross-contract-calls/lib.rs +++ b/cross-contract-calls/lib.rs @@ -18,7 +18,7 @@ mod cross_contract_calls { pub fn new_v2_with_limits( other_contract_code_hash: Hash, ref_time_limit: u64, - proof_time_limit: u64, + proof_size_limit: u64, storage_deposit_limit: Balance, ) -> Self { let other_contract = OtherContractRef::new(true) @@ -26,7 +26,7 @@ mod cross_contract_calls { .endowment(0) .salt_bytes([0xDE, 0xAD, 0xBE, 0xEF]) .ref_time_limit(ref_time_limit) - .proof_time_limit(proof_time_limit) + .proof_size_limit(proof_size_limit) .storage_deposit_limit(storage_deposit_limit) .instantiate(); @@ -82,7 +82,7 @@ mod cross_contract_calls { pub fn flip_and_get_invoke_v2_with_limits( &mut self, ref_time_limit: u64, - proof_time_limit: u64, + proof_size_limit: u64, storage_deposit_limit: Balance, ) -> bool { let call_builder = self.other_contract.call_mut(); @@ -90,14 +90,14 @@ mod cross_contract_calls { call_builder .flip() .ref_time_limit(ref_time_limit) - .proof_time_limit(proof_time_limit) + .proof_size_limit(proof_size_limit) .storage_deposit_limit(storage_deposit_limit) .invoke(); call_builder .get() .ref_time_limit(ref_time_limit) - .proof_time_limit(proof_time_limit) + .proof_size_limit(proof_size_limit) .storage_deposit_limit(storage_deposit_limit) .invoke() } diff --git a/cross-contract-calls/other-contract/Cargo.toml b/cross-contract-calls/other-contract/Cargo.toml index 947bd1f7..5d086631 100755 --- a/cross-contract-calls/other-contract/Cargo.toml +++ b/cross-contract-calls/other-contract/Cargo.toml @@ -1,15 +1,15 @@ [package] name = "other-contract" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" publish = false [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } [dev-dependencies] -ink_e2e = { version = "5.0.0-rc.2" } +ink_e2e = { version = "5.0.0" } [lib] path = "lib.rs" diff --git a/custom-allocator/Cargo.toml b/custom-allocator/Cargo.toml index 7b9138e7..943e765e 100755 --- a/custom-allocator/Cargo.toml +++ b/custom-allocator/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "custom-allocator" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" publish = false @@ -8,13 +8,13 @@ publish = false [dependencies] # We're going to use a different allocator than the one provided by ink!. To do that we # first need to disable the included memory allocator. -ink = { version = "5.0.0-rc.2", default-features = false, features = ["no-allocator"] } +ink = { version = "5.0.0", default-features = false, features = ["no-allocator"] } # This is going to be our new global memory allocator. dlmalloc = {version = "0.2", default-features = false, features = ["global"] } [dev-dependencies] -ink_e2e = { version = "5.0.0-rc.2" } +ink_e2e = { version = "5.0.0" } [lib] path = "lib.rs" diff --git a/custom-environment/Cargo.toml b/custom-environment/Cargo.toml index c155e634..ae278342 100644 --- a/custom-environment/Cargo.toml +++ b/custom-environment/Cargo.toml @@ -1,15 +1,15 @@ [package] name = "custom-environment" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" publish = false [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } [dev-dependencies] -ink_e2e = { version = "5.0.0-rc.2" } +ink_e2e = { version = "5.0.0" } [lib] path = "lib.rs" diff --git a/dns/Cargo.toml b/dns/Cargo.toml index e5c66422..35ca4fe1 100644 --- a/dns/Cargo.toml +++ b/dns/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "dns" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" publish = false [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } [lib] path = "lib.rs" diff --git a/e2e-call-runtime/Cargo.toml b/e2e-call-runtime/Cargo.toml index 8a5447f2..0a2256cf 100644 --- a/e2e-call-runtime/Cargo.toml +++ b/e2e-call-runtime/Cargo.toml @@ -1,15 +1,15 @@ [package] name = "e2e_call_runtime" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" publish = false [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } [dev-dependencies] -ink_e2e = { version = "5.0.0-rc.2" } +ink_e2e = { version = "5.0.0" } [lib] path = "lib.rs" diff --git a/e2e-runtime-only-backend/.gitignore b/e2e-runtime-only-backend/.gitignore new file mode 100644 index 00000000..bf910de1 --- /dev/null +++ b/e2e-runtime-only-backend/.gitignore @@ -0,0 +1,9 @@ +# Ignore build artifacts from the local tests sub-crate. +/target/ + +# Ignore backup files creates by cargo fmt. +**/*.rs.bk + +# Remove Cargo.lock when creating an executable, leave it for libraries +# More information here http://doc.crates.io/guide.html#cargotoml-vs-cargolock +Cargo.lock \ No newline at end of file diff --git a/e2e-runtime-only-backend/Cargo.toml b/e2e-runtime-only-backend/Cargo.toml new file mode 100644 index 00000000..146d9e1e --- /dev/null +++ b/e2e-runtime-only-backend/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "e2e-runtime-only-backend" +version = "5.0.0" +authors = ["Parity Technologies "] +edition = "2021" +publish = false + +[dependencies] +ink = { version = "5.0.0", default-features = false } + +[dev-dependencies] +ink_e2e = { version = "5.0.0" } + +[lib] +path = "lib.rs" + +[features] +default = ["std"] +std = [ + "ink/std", +] +ink-as-dependency = [] +e2e-tests = [] diff --git a/e2e-runtime-only-backend/lib.rs b/e2e-runtime-only-backend/lib.rs new file mode 100644 index 00000000..8f190740 --- /dev/null +++ b/e2e-runtime-only-backend/lib.rs @@ -0,0 +1,165 @@ +#![cfg_attr(not(feature = "std"), no_std, no_main)] + +#[ink::contract] +pub mod flipper { + #[ink(storage)] + pub struct Flipper { + value: bool, + } + + impl Flipper { + /// Creates a new flipper smart contract initialized with the given value. + #[ink(constructor)] + pub fn new(init_value: bool) -> Self { + Self { value: init_value } + } + + /// Creates a new flipper smart contract initialized to `false`. + #[ink(constructor)] + pub fn new_default() -> Self { + Self::new(Default::default()) + } + + /// Flips the current value of the Flipper's boolean. + #[ink(message)] + pub fn flip(&mut self) { + self.value = !self.value; + } + + /// Returns the current value of the Flipper's boolean. + #[ink(message)] + pub fn get(&self) -> bool { + self.value + } + + /// Returns the current balance of the Flipper. + #[ink(message)] + pub fn get_contract_balance(&self) -> Balance { + self.env().balance() + } + } + + #[cfg(all(test, feature = "e2e-tests"))] + mod e2e_tests { + use super::*; + use ink_e2e::{ + subxt::dynamic::Value, + ChainBackend, + ContractsBackend, + }; + + type E2EResult = std::result::Result>; + + /// Tests standard flipper scenario: + /// - deploy the flipper contract with initial value `false` + /// - flip the flipper + /// - get the flipper's value + /// - assert that the value is `true` + #[ink_e2e::test(backend(runtime_only))] + async fn it_works(mut client: Client) -> E2EResult<()> { + // given + const INITIAL_VALUE: bool = false; + let mut constructor = FlipperRef::new(INITIAL_VALUE); + + let contract = client + .instantiate( + "e2e-runtime-only-backend", + &ink_e2e::alice(), + &mut constructor, + ) + .submit() + .await + .expect("deploy failed"); + + // when + let mut call_builder = contract.call_builder::(); + let _flip_res = client + .call(&ink_e2e::bob(), &call_builder.flip()) + .submit() + .await; + + // then + let get_res = client + .call(&ink_e2e::bob(), &call_builder.get()) + .dry_run() + .await?; + assert_eq!(get_res.return_value(), !INITIAL_VALUE); + + Ok(()) + } + + /// Tests runtime call scenario: + /// - deploy the flipper contract + /// - get the contract's balance + /// - transfer some funds to the contract using runtime call + /// - get the contract's balance again + /// - assert that the contract's balance increased by the transferred amount + #[ink_e2e::test(backend(runtime_only))] + async fn runtime_call_works() -> E2EResult<()> { + // given + let mut constructor = FlipperRef::new(false); + + let contract = client + .instantiate( + "e2e-runtime-only-backend", + &ink_e2e::alice(), + &mut constructor, + ) + .submit() + .await + .expect("deploy failed"); + let call_builder = contract.call_builder::(); + + let old_balance = client + .call(&ink_e2e::alice(), &call_builder.get_contract_balance()) + .submit() + .await + .expect("get_contract_balance failed") + .return_value(); + + const ENDOWMENT: u128 = 10; + + // when + let call_data = vec![ + Value::unnamed_variant("Id", [Value::from_bytes(contract.account_id)]), + Value::u128(ENDOWMENT), + ]; + client + .runtime_call( + &ink_e2e::alice(), + "Balances", + "transfer_allow_death", + call_data, + ) + .await + .expect("runtime call failed"); + + // then + let new_balance = client + .call(&ink_e2e::alice(), &call_builder.get_contract_balance()) + .submit() + .await + .expect("get_contract_balance failed") + .return_value(); + + assert_eq!(old_balance + ENDOWMENT, new_balance); + Ok(()) + } + + /// Just instantiate a contract using non-default runtime. + #[ink_e2e::test(backend(runtime_only(sandbox = ink_e2e::MinimalSandbox)))] + async fn custom_runtime(mut client: Client) -> E2EResult<()> { + client + .instantiate( + "e2e-runtime-only-backend", + &ink_e2e::alice(), + &mut FlipperRef::new(false), + ) + .submit() + .await + .expect("instantiate failed"); + + Ok(()) + } + } +} diff --git a/erc1155/Cargo.toml b/erc1155/Cargo.toml index b08d5499..455e9f8d 100644 --- a/erc1155/Cargo.toml +++ b/erc1155/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "erc1155" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" publish = false [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } [lib] path = "lib.rs" diff --git a/erc20/Cargo.toml b/erc20/Cargo.toml index a8118a7d..add29a41 100644 --- a/erc20/Cargo.toml +++ b/erc20/Cargo.toml @@ -1,15 +1,15 @@ [package] name = "erc20" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" publish = false [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } [dev-dependencies] -ink_e2e = { version = "5.0.0-rc.2" } +ink_e2e = { version = "5.0.0" } [lib] path = "lib.rs" diff --git a/erc721/Cargo.toml b/erc721/Cargo.toml index 5eeb8c11..3e744f4a 100644 --- a/erc721/Cargo.toml +++ b/erc721/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "erc721" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" publish = false [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } [lib] path = "lib.rs" diff --git a/events/.gitignore b/events/.gitignore new file mode 100644 index 00000000..bf910de1 --- /dev/null +++ b/events/.gitignore @@ -0,0 +1,9 @@ +# Ignore build artifacts from the local tests sub-crate. +/target/ + +# Ignore backup files creates by cargo fmt. +**/*.rs.bk + +# Remove Cargo.lock when creating an executable, leave it for libraries +# More information here http://doc.crates.io/guide.html#cargotoml-vs-cargolock +Cargo.lock \ No newline at end of file diff --git a/events/Cargo.toml b/events/Cargo.toml new file mode 100644 index 00000000..7fdb146a --- /dev/null +++ b/events/Cargo.toml @@ -0,0 +1,35 @@ +[package] +name = "events" +version = "5.0.0" +authors = ["Parity Technologies "] +edition = "2021" +publish = false + +[dependencies] +ink = { version = "5.0.0", default-features = false } + +event-def = { path = "event-def", default-features = false } +event-def2 = { path = "event-def2", default-features = false } +event-def-unused = { path = "event-def-unused", default-features = false } + +[dev-dependencies] +ink_e2e = { version = "5.0.0" } + +[lib] +path = "lib.rs" + +[features] +default = ["std"] +std = [ + "ink/std", + "event-def/std", + "event-def2/std", + "event-def-unused/std", +] +ink-as-dependency = [] +e2e-tests = [] + +[profile.test] +# Need this for linkme crate to work for the event metadata unit test. +# See https://github.com/dtolnay/linkme/issues/61#issuecomment-1503653702 +lto = "thin" diff --git a/events/event-def-unused/Cargo.toml b/events/event-def-unused/Cargo.toml new file mode 100644 index 00000000..a41f0422 --- /dev/null +++ b/events/event-def-unused/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "event-def-unused" +version = "0.1.0" +edition = "2021" + +[dependencies] +ink = { version = "5.0.0", default-features = false } + +[features] +default = ["std"] +std = [ + "ink/std", +] diff --git a/events/event-def-unused/src/lib.rs b/events/event-def-unused/src/lib.rs new file mode 100644 index 00000000..cbf2d719 --- /dev/null +++ b/events/event-def-unused/src/lib.rs @@ -0,0 +1,15 @@ +#![cfg_attr(not(feature = "std"), no_std, no_main)] + +#[ink::trait_definition] +pub trait FlipperTrait { + #[ink(message)] + fn flip(&mut self); +} + +#[ink::event] +pub struct EventDefUnused { + #[ink(topic)] + pub hash: [u8; 32], + #[ink(topic)] + pub maybe_hash: Option<[u8; 32]>, +} diff --git a/events/event-def/Cargo.toml b/events/event-def/Cargo.toml new file mode 100644 index 00000000..78cbff7f --- /dev/null +++ b/events/event-def/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "event-def" +version = "0.1.0" +edition = "2021" + +[dependencies] +ink = { version = "5.0.0", default-features = false } + +[features] +default = ["std"] +std = [ + "ink/std", +] diff --git a/events/event-def/src/lib.rs b/events/event-def/src/lib.rs new file mode 100644 index 00000000..4f9e8ffa --- /dev/null +++ b/events/event-def/src/lib.rs @@ -0,0 +1,14 @@ +#![cfg_attr(not(feature = "std"), no_std, no_main)] + +#[ink::event] +pub struct ForeignFlipped { + pub value: bool, +} + +#[ink::event] +pub struct ThirtyTwoByteTopics { + #[ink(topic)] + pub hash: [u8; 32], + #[ink(topic)] + pub maybe_hash: Option<[u8; 32]>, +} diff --git a/events/event-def2/Cargo.toml b/events/event-def2/Cargo.toml new file mode 100644 index 00000000..d7ed2993 --- /dev/null +++ b/events/event-def2/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "event-def2" +version = "0.1.0" +edition = "2021" + +[dependencies] +ink = { version = "5.0.0", default-features = false } + +[features] +default = ["std"] +std = [ + "ink/std", +] diff --git a/events/event-def2/src/lib.rs b/events/event-def2/src/lib.rs new file mode 100644 index 00000000..f27050f8 --- /dev/null +++ b/events/event-def2/src/lib.rs @@ -0,0 +1,9 @@ +#![cfg_attr(not(feature = "std"), no_std, no_main)] + +#[ink::event] +pub struct EventDefAnotherCrate { + #[ink(topic)] + pub hash: [u8; 32], + #[ink(topic)] + pub maybe_hash: Option<[u8; 32]>, +} diff --git a/events/lib.rs b/events/lib.rs new file mode 100644 index 00000000..211b55b3 --- /dev/null +++ b/events/lib.rs @@ -0,0 +1,415 @@ +#![cfg_attr(not(feature = "std"), no_std, no_main)] + +#[ink::event(anonymous)] +pub struct AnonymousEvent { + #[ink(topic)] + pub topic: [u8; 32], + pub field_1: u32, +} + +#[ink::contract] +pub mod events { + #[ink(storage)] + pub struct Events { + value: bool, + } + + #[ink(event)] + pub struct InlineFlipped { + value: bool, + } + + #[ink( + event, + signature_topic = "1111111111111111111111111111111111111111111111111111111111111111" + )] + pub struct InlineCustomFlipped { + value: bool, + } + + #[ink(event)] + #[ink(anonymous)] + pub struct InlineAnonymousEvent { + #[ink(topic)] + pub topic: [u8; 32], + pub field_1: u32, + } + + impl Events { + /// Creates a new events smart contract initialized with the given value. + #[ink(constructor)] + pub fn new(init_value: bool) -> Self { + Self { value: init_value } + } + + /// Flips the current value of the boolean. + #[ink(message)] + pub fn flip_with_foreign_event(&mut self) { + self.value = !self.value; + self.env() + .emit_event(event_def::ForeignFlipped { value: self.value }) + } + + /// Flips the current value of the boolean. + #[ink(message)] + pub fn flip_with_inline_event(&mut self) { + self.value = !self.value; + self.env().emit_event(InlineFlipped { value: self.value }) + } + + /// Flips the current value of the boolean. + #[ink(message)] + pub fn flip_with_inline_custom_event(&mut self) { + self.value = !self.value; + self.env() + .emit_event(InlineCustomFlipped { value: self.value }) + } + + /// Emit an event with a 32 byte topic. + #[ink(message)] + pub fn emit_32_byte_topic_event(&self, maybe_hash: Option<[u8; 32]>) { + self.env().emit_event(event_def::ThirtyTwoByteTopics { + hash: [0x42; 32], + maybe_hash, + }) + } + + /// Emit an event from a different crate. + #[ink(message)] + pub fn emit_event_from_a_different_crate(&self, maybe_hash: Option<[u8; 32]>) { + self.env().emit_event(event_def2::EventDefAnotherCrate { + hash: [0x42; 32], + maybe_hash, + }) + } + + /// Emit a inline and standalone anonymous events + #[ink(message)] + pub fn emit_anonymous_events(&self, topic: [u8; 32]) { + self.env() + .emit_event(InlineAnonymousEvent { topic, field_1: 42 }); + self.env() + .emit_event(super::AnonymousEvent { topic, field_1: 42 }); + } + } + + /// Implementing the trait from the `event_def_unused` crate includes all defined + /// events there. + impl event_def_unused::FlipperTrait for Events { + #[ink(message)] + fn flip(&mut self) { + self.value = !self.value; + } + } + + #[cfg(test)] + mod tests { + use super::*; + use ink::scale::Decode as _; + + #[test] + fn collects_specs_for_all_linked_and_used_events() { + let event_specs = ink::metadata::collect_events(); + assert_eq!(8, event_specs.len()); + + assert!(event_specs + .iter() + .any(|evt| evt.label() == &"ForeignFlipped")); + assert!(event_specs + .iter() + .any(|evt| evt.label() == &"InlineFlipped")); + assert!(event_specs + .iter() + .any(|evt| evt.label() == &"InlineCustomFlipped")); + assert!(event_specs + .iter() + .any(|evt| evt.label() == &"ThirtyTwoByteTopics")); + assert!(event_specs + .iter() + .any(|evt| evt.label() == &"EventDefAnotherCrate")); + assert!(event_specs + .iter() + .any(|evt| evt.label() == &"AnonymousEvent")); + assert!(event_specs + .iter() + .any(|evt| evt.label() == &"InlineAnonymousEvent")); + + // The event is not used in the code by being included in the metadata + // because we implement trait form `event_def_unused` crate. + assert!(event_specs + .iter() + .any(|evt| evt.label() == &"EventDefUnused")); + } + + #[ink::test] + fn it_works() { + let mut events = Events::new(false); + events.flip_with_foreign_event(); + + let emitted_events = ink::env::test::recorded_events().collect::>(); + assert_eq!(1, emitted_events.len()); + let event = &emitted_events[0]; + + let decoded_event = ::decode(&mut &event.data[..]) + .expect("encountered invalid contract event data buffer"); + assert!(decoded_event.value); + } + + #[ink::test] + fn option_topic_some_has_topic() { + let events = Events::new(false); + events.emit_32_byte_topic_event(Some([0xAA; 32])); + + let emitted_events = ink::env::test::recorded_events().collect::>(); + assert_eq!(1, emitted_events.len()); + let event = &emitted_events[0]; + + assert_eq!(event.topics.len(), 3); + let signature_topic = + ::SIGNATURE_TOPIC + .map(|topic| topic.to_vec()); + assert_eq!(Some(&event.topics[0]), signature_topic.as_ref()); + assert_eq!(event.topics[1], [0x42; 32]); + assert_eq!( + event.topics[2], [0xAA; 32], + "option topic should be published" + ); + } + + #[ink::test] + fn option_topic_none_encoded_as_0() { + let events = Events::new(false); + events.emit_32_byte_topic_event(None); + + let emitted_events = ink::env::test::recorded_events().collect::>(); + assert_eq!(1, emitted_events.len()); + let event = &emitted_events[0]; + + let signature_topic = + ::SIGNATURE_TOPIC + .map(|topic| topic.to_vec()) + .unwrap(); + + let expected_topics = vec![ + signature_topic, + [0x42; 32].to_vec(), + [0x00; 32].to_vec(), // None is encoded as 0x00 + ]; + assert_eq!(expected_topics, event.topics); + } + + #[ink::test] + fn custom_signature_topic() { + let mut events = Events::new(false); + events.flip_with_inline_custom_event(); + + let emitted_events = ink::env::test::recorded_events().collect::>(); + assert_eq!(1, emitted_events.len()); + + let signature_topic = + ::SIGNATURE_TOPIC; + + assert_eq!(Some([17u8; 32]), signature_topic); + } + + #[ink::test] + fn anonymous_events_emit_no_signature_topics() { + let events = Events::new(false); + let topic = [0x42; 32]; + events.emit_anonymous_events(topic); + + let emitted_events = ink::env::test::recorded_events().collect::>(); + assert_eq!(2, emitted_events.len()); + + let event = &emitted_events[0]; + assert_eq!(event.topics.len(), 1); + assert_eq!(event.topics[0], topic); + + let event = &emitted_events[1]; + assert_eq!(event.topics.len(), 1); + assert_eq!(event.topics[0], topic); + + let signature_topic = + ::SIGNATURE_TOPIC; + assert_eq!(None, signature_topic); + } + } + + #[cfg(all(test, feature = "e2e-tests"))] + mod e2e_tests { + use super::*; + use ink_e2e::{ + ContractsBackend, + H256, + }; + + type E2EResult = std::result::Result>; + + #[ink_e2e::test] + async fn emits_foreign_event( + mut client: Client, + ) -> E2EResult<()> { + // given + let init_value = false; + let mut constructor = EventsRef::new(init_value); + let contract = client + .instantiate("events", &ink_e2e::alice(), &mut constructor) + .submit() + .await + .expect("instantiate failed"); + let mut call_builder = contract.call_builder::(); + + // when + let flip = call_builder.flip_with_foreign_event(); + let flip_res = client + .call(&ink_e2e::bob(), &flip) + .submit() + .await + .expect("flip failed"); + + let contract_events = flip_res.contract_emitted_events()?; + + // then + assert_eq!(1, contract_events.len()); + let contract_event = &contract_events[0]; + let flipped: event_def::ForeignFlipped = + ink::scale::Decode::decode(&mut &contract_event.event.data[..]) + .expect("encountered invalid contract event data buffer"); + assert_eq!(!init_value, flipped.value); + + let signature_topic = + ::SIGNATURE_TOPIC + .map(H256::from) + .unwrap(); + + let expected_topics = vec![signature_topic]; + assert_eq!(expected_topics, contract_event.topics); + + Ok(()) + } + + #[ink_e2e::test] + async fn emits_inline_event( + mut client: Client, + ) -> E2EResult<()> { + // given + let init_value = false; + let mut constructor = EventsRef::new(init_value); + let contract = client + .instantiate("events", &ink_e2e::alice(), &mut constructor) + .submit() + .await + .expect("instantiate failed"); + let mut call_builder = contract.call_builder::(); + + // when + let flip = call_builder.flip_with_inline_event(); + let flip_res = client + .call(&ink_e2e::bob(), &flip) + .submit() + .await + .expect("flip failed"); + + let contract_events = flip_res.contract_emitted_events()?; + + // then + assert_eq!(1, contract_events.len()); + let contract_event = &contract_events[0]; + let flipped: InlineFlipped = + ink::scale::Decode::decode(&mut &contract_event.event.data[..]) + .expect("encountered invalid contract event data buffer"); + assert_eq!(!init_value, flipped.value); + + let signature_topic = ::SIGNATURE_TOPIC + .map(H256::from) + .unwrap(); + + let expected_topics = vec![signature_topic]; + assert_eq!(expected_topics, contract_event.topics); + + Ok(()) + } + + #[ink_e2e::test] + async fn emits_event_with_option_topic_none( + mut client: Client, + ) -> E2EResult<()> { + // given + let init_value = false; + let mut constructor = EventsRef::new(init_value); + let contract = client + .instantiate("events", &ink_e2e::alice(), &mut constructor) + .submit() + .await + .expect("instantiate failed"); + let call_builder = contract.call_builder::(); + + // when + let call = call_builder.emit_32_byte_topic_event(None); + let call_res = client + .call(&ink_e2e::bob(), &call) + .submit() + .await + .expect("emit_32_byte_topic_event failed"); + + let contract_events = call_res.contract_emitted_events()?; + + // then + assert_eq!(1, contract_events.len()); + let contract_event = &contract_events[0]; + let event: event_def::ThirtyTwoByteTopics = + ink::scale::Decode::decode(&mut &contract_event.event.data[..]) + .expect("encountered invalid contract event data buffer"); + assert!(event.maybe_hash.is_none()); + + let signature_topic = + ::SIGNATURE_TOPIC + .map(H256::from) + .unwrap(); + + let expected_topics = vec![ + signature_topic, + [0x42; 32].into(), + [0x00; 32].into(), // None is encoded as 0x00 + ]; + assert_eq!(expected_topics, contract_event.topics); + + Ok(()) + } + + #[ink_e2e::test] + async fn emits_custom_signature_event( + mut client: Client, + ) -> E2EResult<()> { + // given + let init_value = false; + let mut constructor = EventsRef::new(init_value); + let contract = client + .instantiate("events", &ink_e2e::alice(), &mut constructor) + .submit() + .await + .expect("instantiate failed"); + let mut call_builder = contract.call_builder::(); + + // when + let call = call_builder.flip_with_inline_custom_event(); + let call_res = client + .call(&ink_e2e::bob(), &call) + .submit() + .await + .expect("flip_with_inline_custom_event failed"); + + let contract_events = call_res.contract_emitted_events()?; + + // then + assert_eq!(1, contract_events.len()); + + let signature_topic = + ::SIGNATURE_TOPIC; + + assert_eq!(Some([17u8; 32]), signature_topic); + + Ok(()) + } + } +} diff --git a/flipper/Cargo.toml b/flipper/Cargo.toml index 2ef81829..ef17b3c8 100644 --- a/flipper/Cargo.toml +++ b/flipper/Cargo.toml @@ -1,15 +1,15 @@ [package] name = "flipper" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" publish = false [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } [dev-dependencies] -ink_e2e = { version = "5.0.0-rc.2" } +ink_e2e = { version = "5.0.0" } hex = { version = "0.4.3" } [lib] diff --git a/incrementer/Cargo.toml b/incrementer/Cargo.toml index 7643b5bf..38bcd46c 100644 --- a/incrementer/Cargo.toml +++ b/incrementer/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "incrementer" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" publish = false [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } [lib] path = "lib.rs" diff --git a/lazyvec/Cargo.toml b/lazyvec/Cargo.toml index ab850b0c..266612cd 100755 --- a/lazyvec/Cargo.toml +++ b/lazyvec/Cargo.toml @@ -1,15 +1,15 @@ [package] name = "lazyvec-integration-tests" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" publish = false [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } [dev-dependencies] -ink_e2e = { version = "5.0.0-rc.2" } +ink_e2e = { version = "5.0.0" } [lib] path = "lib.rs" diff --git a/mapping/Cargo.toml b/mapping/Cargo.toml index c6630f63..49c4517d 100755 --- a/mapping/Cargo.toml +++ b/mapping/Cargo.toml @@ -1,15 +1,15 @@ [package] name = "mapping-integration-tests" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" publish = false [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } [dev-dependencies] -ink_e2e = { version = "5.0.0-rc.2" } +ink_e2e = { version = "5.0.0" } [lib] path = "lib.rs" diff --git a/multi-contract-caller/Cargo.toml b/multi-contract-caller/Cargo.toml index 903aba31..fbfb1e28 100644 --- a/multi-contract-caller/Cargo.toml +++ b/multi-contract-caller/Cargo.toml @@ -1,19 +1,19 @@ [package] name = "multi-contract-caller" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" publish = false [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } adder = { path = "adder", default-features = false, features = ["ink-as-dependency"] } subber = { path = "subber", default-features = false, features = ["ink-as-dependency"] } accumulator = { path = "accumulator", default-features = false, features = ["ink-as-dependency"] } [dev-dependencies] -ink_e2e = { version = "5.0.0-rc.2" } +ink_e2e = { version = "5.0.0" } [lib] path = "lib.rs" diff --git a/multi-contract-caller/accumulator/Cargo.toml b/multi-contract-caller/accumulator/Cargo.toml index 5a6c1b92..c1dfcd32 100644 --- a/multi-contract-caller/accumulator/Cargo.toml +++ b/multi-contract-caller/accumulator/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "accumulator" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } [lib] path = "lib.rs" diff --git a/multi-contract-caller/adder/Cargo.toml b/multi-contract-caller/adder/Cargo.toml index 55cca22d..03c54803 100644 --- a/multi-contract-caller/adder/Cargo.toml +++ b/multi-contract-caller/adder/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "adder" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } accumulator = { path = "../accumulator", default-features = false, features = ["ink-as-dependency"] } diff --git a/multi-contract-caller/subber/Cargo.toml b/multi-contract-caller/subber/Cargo.toml index 267bab6b..bf130fcf 100644 --- a/multi-contract-caller/subber/Cargo.toml +++ b/multi-contract-caller/subber/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "subber" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } accumulator = { path = "../accumulator", default-features = false, features = ["ink-as-dependency"] } diff --git a/multisig/Cargo.toml b/multisig/Cargo.toml index 0064d04c..0c30482a 100755 --- a/multisig/Cargo.toml +++ b/multisig/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "multisig" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" publish = false [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } [lib] path = "lib.rs" diff --git a/payment-channel/Cargo.toml b/payment-channel/Cargo.toml index fda9412e..aaeaed7b 100755 --- a/payment-channel/Cargo.toml +++ b/payment-channel/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "payment_channel" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" publish = false [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } [dev-dependencies] hex-literal = { version = "0.4.1" } diff --git a/psp22-extension/Cargo.toml b/psp22-extension/Cargo.toml index cbaa3c2f..44460531 100755 --- a/psp22-extension/Cargo.toml +++ b/psp22-extension/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "psp22_extension" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" publish = false [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } [lib] path = "lib.rs" diff --git a/rand-extension/Cargo.toml b/rand-extension/Cargo.toml index c8e1f54e..f89972a0 100755 --- a/rand-extension/Cargo.toml +++ b/rand-extension/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "rand_extension" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" publish = false [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } [lib] path = "lib.rs" diff --git a/static-buffer/Cargo.toml b/static-buffer/Cargo.toml index 6cc5d736..7bb97c88 100644 --- a/static-buffer/Cargo.toml +++ b/static-buffer/Cargo.toml @@ -1,15 +1,15 @@ [package] name = "static-buffer" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" publish = false [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } [dev-dependencies] -ink_e2e = { version = "5.0.0-rc.2" } +ink_e2e = { version = "5.0.0" } [lib] path = "lib.rs" diff --git a/trait-dyn-cross-contract-calls/Cargo.toml b/trait-dyn-cross-contract-calls/Cargo.toml index 3202e8b7..9fb688ee 100644 --- a/trait-dyn-cross-contract-calls/Cargo.toml +++ b/trait-dyn-cross-contract-calls/Cargo.toml @@ -1,17 +1,17 @@ [package] name = "trait-incrementer-caller" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" publish = false [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } dyn-traits = { path = "./traits", default-features = false } [dev-dependencies] -ink_e2e = { version = "5.0.0-rc.2" } +ink_e2e = { version = "5.0.0" } trait-incrementer = { path = "./contracts/incrementer", default-features = false, features = ["ink-as-dependency"] } [lib] diff --git a/trait-dyn-cross-contract-calls/contracts/incrementer/Cargo.toml b/trait-dyn-cross-contract-calls/contracts/incrementer/Cargo.toml index 963a0bd0..912d192c 100644 --- a/trait-dyn-cross-contract-calls/contracts/incrementer/Cargo.toml +++ b/trait-dyn-cross-contract-calls/contracts/incrementer/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "trait-incrementer" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" publish = false [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } dyn-traits = { path = "../../traits", default-features = false } diff --git a/trait-dyn-cross-contract-calls/traits/Cargo.toml b/trait-dyn-cross-contract-calls/traits/Cargo.toml index 47ca4847..bf9fbf61 100644 --- a/trait-dyn-cross-contract-calls/traits/Cargo.toml +++ b/trait-dyn-cross-contract-calls/traits/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "dyn-traits" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" publish = false [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } [lib] path = "lib.rs" diff --git a/trait-erc20/Cargo.toml b/trait-erc20/Cargo.toml index 4ff939b9..bf98f528 100644 --- a/trait-erc20/Cargo.toml +++ b/trait-erc20/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "trait_erc20" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" publish = false [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } [lib] path = "lib.rs" diff --git a/trait-flipper/Cargo.toml b/trait-flipper/Cargo.toml index 902bf50e..599d0015 100644 --- a/trait-flipper/Cargo.toml +++ b/trait-flipper/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "trait_flipper" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" publish = false [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } [lib] path = "lib.rs" diff --git a/trait-incrementer/Cargo.toml b/trait-incrementer/Cargo.toml index 0424e129..b6bd3b2e 100644 --- a/trait-incrementer/Cargo.toml +++ b/trait-incrementer/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "trait-incrementer" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" publish = false [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } traits = { path = "./traits", default-features = false } diff --git a/trait-incrementer/traits/Cargo.toml b/trait-incrementer/traits/Cargo.toml index a1bd0255..03a36241 100644 --- a/trait-incrementer/traits/Cargo.toml +++ b/trait-incrementer/traits/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "traits" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" publish = false [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } [lib] name = "traits" diff --git a/upgradeable-contracts/delegator/Cargo.toml b/upgradeable-contracts/delegator/Cargo.toml index 95fe9f30..b0dd136b 100644 --- a/upgradeable-contracts/delegator/Cargo.toml +++ b/upgradeable-contracts/delegator/Cargo.toml @@ -1,17 +1,17 @@ [package] name = "delegator" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" publish = false [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } delegatee = { path = "delegatee", default-features = false, features = ["ink-as-dependency"] } delegatee2 = { path = "delegatee2", default-features = false, features = ["ink-as-dependency"] } [dev-dependencies] -ink_e2e = { version = "5.0.0-rc.2" } +ink_e2e = { version = "5.0.0" } [lib] path = "lib.rs" diff --git a/upgradeable-contracts/delegator/delegatee/Cargo.toml b/upgradeable-contracts/delegator/delegatee/Cargo.toml index 3db5e598..23c72e72 100644 --- a/upgradeable-contracts/delegator/delegatee/Cargo.toml +++ b/upgradeable-contracts/delegator/delegatee/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "delegatee" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" publish = false [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } [lib] path = "lib.rs" diff --git a/upgradeable-contracts/delegator/delegatee2/Cargo.toml b/upgradeable-contracts/delegator/delegatee2/Cargo.toml index feffe279..8bf01ca0 100644 --- a/upgradeable-contracts/delegator/delegatee2/Cargo.toml +++ b/upgradeable-contracts/delegator/delegatee2/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "delegatee2" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" publish = false [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } [lib] path = "lib.rs" diff --git a/upgradeable-contracts/set-code-hash-migration/Cargo.toml b/upgradeable-contracts/set-code-hash-migration/Cargo.toml index 2ba291b7..2eb6850d 100644 --- a/upgradeable-contracts/set-code-hash-migration/Cargo.toml +++ b/upgradeable-contracts/set-code-hash-migration/Cargo.toml @@ -1,18 +1,18 @@ [package] name = "incrementer" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" publish = false [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } migration = { path = "./migration", default-features = false, features = ["ink-as-dependency"] } updated-incrementer = { path = "./updated-incrementer", default-features = false, features = ["ink-as-dependency"] } [dev-dependencies] -ink_e2e = { version = "5.0.0-rc.2" } +ink_e2e = { version = "5.0.0" } [lib] path = "lib.rs" diff --git a/upgradeable-contracts/set-code-hash-migration/migration/Cargo.toml b/upgradeable-contracts/set-code-hash-migration/migration/Cargo.toml index 07841671..8ff2d5ef 100644 --- a/upgradeable-contracts/set-code-hash-migration/migration/Cargo.toml +++ b/upgradeable-contracts/set-code-hash-migration/migration/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "migration" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" publish = false [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } [lib] path = "lib.rs" diff --git a/upgradeable-contracts/set-code-hash-migration/updated-incrementer/Cargo.toml b/upgradeable-contracts/set-code-hash-migration/updated-incrementer/Cargo.toml index a541ecb9..269e6f63 100644 --- a/upgradeable-contracts/set-code-hash-migration/updated-incrementer/Cargo.toml +++ b/upgradeable-contracts/set-code-hash-migration/updated-incrementer/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "updated-incrementer" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" publish = false [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } [lib] path = "lib.rs" diff --git a/upgradeable-contracts/set-code-hash/Cargo.toml b/upgradeable-contracts/set-code-hash/Cargo.toml index c2a6cf89..b1f585bd 100644 --- a/upgradeable-contracts/set-code-hash/Cargo.toml +++ b/upgradeable-contracts/set-code-hash/Cargo.toml @@ -1,15 +1,15 @@ [package] name = "incrementer" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" publish = false [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } [dev-dependencies] -ink_e2e = { version = "5.0.0-rc.2" } +ink_e2e = { version = "5.0.0" } updated-incrementer = { path = "updated-incrementer", default-features = false, features = ["ink-as-dependency"] } [lib] diff --git a/upgradeable-contracts/set-code-hash/updated-incrementer/Cargo.toml b/upgradeable-contracts/set-code-hash/updated-incrementer/Cargo.toml index a541ecb9..269e6f63 100644 --- a/upgradeable-contracts/set-code-hash/updated-incrementer/Cargo.toml +++ b/upgradeable-contracts/set-code-hash/updated-incrementer/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "updated-incrementer" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" publish = false [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } [lib] path = "lib.rs" diff --git a/vesting/Cargo.toml b/vesting/Cargo.toml index c522e392..d9b9f27d 100755 --- a/vesting/Cargo.toml +++ b/vesting/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "vesting" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } [dev-dependencies] diff --git a/wildcard-selector/Cargo.toml b/wildcard-selector/Cargo.toml index 271d53e0..5e367d6e 100644 --- a/wildcard-selector/Cargo.toml +++ b/wildcard-selector/Cargo.toml @@ -1,15 +1,15 @@ [package] name = "wildcard-selector" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" publish = false [dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } +ink = { version = "5.0.0", default-features = false } [dev-dependencies] -ink_e2e = { version = "5.0.0-rc.2" } +ink_e2e = { version = "5.0.0" } [lib] path = "lib.rs" diff --git a/workspace-contracts/Cargo.toml b/workspace-contracts/Cargo.toml index f9e6c032..8e120b69 100644 --- a/workspace-contracts/Cargo.toml +++ b/workspace-contracts/Cargo.toml @@ -4,5 +4,5 @@ exclude = [".cargo", "target"] resolver = "2" [workspace.dependencies] -ink = { version = "5.0.0-rc.2", default-features = false } -ink_e2e = "5.0.0-rc.2" +ink = { version = "5.0.0", default-features = false } +ink_e2e = "5.0.0" diff --git a/workspace-contracts/flipper/Cargo.toml b/workspace-contracts/flipper/Cargo.toml index fc97e94f..76359cfc 100644 --- a/workspace-contracts/flipper/Cargo.toml +++ b/workspace-contracts/flipper/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "flipper" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" publish = false diff --git a/workspace-contracts/incrementer/Cargo.toml b/workspace-contracts/incrementer/Cargo.toml index c41ed021..29a65787 100644 --- a/workspace-contracts/incrementer/Cargo.toml +++ b/workspace-contracts/incrementer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "incrementer" -version = "5.0.0-rc.2" +version = "5.0.0" authors = ["Parity Technologies "] edition = "2021" publish = false