From 73ae1b2ca0499463ac27b772d04c4c0b8100e7f5 Mon Sep 17 00:00:00 2001 From: deuszx Date: Wed, 30 Aug 2023 10:46:51 +0200 Subject: [PATCH] Fix compilation issue with mismatched versions of ink packages. --- Cargo.lock | 80 ++++++++++++++----------- farm/contracts/Cargo.toml | 2 +- farm/psp22-traits/Cargo.toml | 2 +- uniswap-v2/contracts/factory/Cargo.toml | 14 +++-- uniswap-v2/contracts/pair/Cargo.toml | 17 ++++-- uniswap-v2/contracts/psp22/Cargo.toml | 21 +++---- uniswap-v2/contracts/router/Cargo.toml | 20 +++++-- uniswap-v2/contracts/wnative/Cargo.toml | 16 +++-- uniswap-v2/logics/Cargo.toml | 32 ++++++---- uniswap-v2/logics/traits/types.rs | 10 ++-- 10 files changed, 129 insertions(+), 85 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ef5ec19e..bb41636d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -481,9 +481,9 @@ dependencies = [ [[package]] name = "ink" -version = "4.2.1" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "311a988dada2242dc748834b86f330bb37ff25482ceef8767104f512a3c465a7" +checksum = "e9fd4f77d66c94aa7f27a7cf41cd2edbc2229afe34ec475c3f32b6e8fdf561a0" dependencies = [ "derive_more", "ink_env", @@ -497,18 +497,18 @@ dependencies = [ [[package]] name = "ink_allocator" -version = "4.2.1" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cb3178f207f6a37c3512142c8c6c2561a2aac61d60baa934d08d1e55a67d4a8" +checksum = "870914970470fd77a3f42d3c5d1918b562817af127fd063ee8b1d9fbf59aa1fe" dependencies = [ "cfg-if", ] [[package]] name = "ink_codegen" -version = "4.2.1" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0b22c0517e5c249d7997cb20e7bd6fbf2076708d39e7b114465c2cb9c1d5c9c" +checksum = "22d79057b2565df31a10af6510a44b161093f110c5f9c22ad02c20af9cea4c29" dependencies = [ "blake2 0.10.6", "derive_more", @@ -530,9 +530,9 @@ dependencies = [ [[package]] name = "ink_engine" -version = "4.2.1" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c9abc50b932893113e782761ac719c46214ecd10c423a3f626dce30a0c61b45" +checksum = "722ec3a5eb557124b001c60ff8f961079f6d566af643edea579f152b15822fe5" dependencies = [ "blake2 0.10.6", "derive_more", @@ -545,9 +545,9 @@ dependencies = [ [[package]] name = "ink_env" -version = "4.2.1" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aef653137381ff5f37ce2ff9130d11dd1b25f6e9734d97d687c3b953dee4d14f" +checksum = "584e73bc0982f6f1a067bb63ebc75262f6dc54ed2a17060efa73eaba84dc9308" dependencies = [ "arrayref", "blake2 0.10.6", @@ -573,9 +573,9 @@ dependencies = [ [[package]] name = "ink_ir" -version = "4.2.1" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bb9a2826cae9617d8ed2d547ed6e595deb334c1b69ff0a579abd86a76e48c30" +checksum = "5b529c941518e8f450395fab9fe8ebba0a7acbb18778fc7e0a87f6248286ec72" dependencies = [ "blake2 0.10.6", "either", @@ -587,9 +587,9 @@ dependencies = [ [[package]] name = "ink_macro" -version = "4.2.1" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0399b6423e892efb4d39eb76ed9286e4e93fab8141f89b4f4348ee77065b81d" +checksum = "8579576c995ca9baa032584beca19155cbd63b6739570aa9da4d35a0415f4be8" dependencies = [ "ink_codegen", "ink_ir", @@ -603,9 +603,9 @@ dependencies = [ [[package]] name = "ink_metadata" -version = "4.2.1" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5fb2b5ad83f725a6d0c8886ca737964d0013a193ca2d21c7e514fd427672416" +checksum = "3fddff95ce3e01f42002fdaf96edda691dbccb08c9ae76d7101daa1fa634e601" dependencies = [ "derive_more", "impl-serde", @@ -617,18 +617,18 @@ dependencies = [ [[package]] name = "ink_prelude" -version = "4.2.1" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6f174d742ff929abe66716ad8159f324441b4ff5161a3b0e282f416afbbac1" +checksum = "d8cfdf91d2b442f08efb34dd3780fd6fbd3d033f63b42f62684fe47534948ef6" dependencies = [ "cfg-if", ] [[package]] name = "ink_primitives" -version = "4.2.1" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14b4e4772e1b9384233103c1f488df9854d24b3c16168bcf23613b7d98fb363f" +checksum = "6414bcad12ebf0c3abbbb192a09e4d06e22f662cf3e19545204e1b0684be12a1" dependencies = [ "derive_more", "ink_prelude", @@ -641,9 +641,9 @@ dependencies = [ [[package]] name = "ink_storage" -version = "4.2.1" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a0f0858c90d5660dc6ec76d31388919a9609aab74723262ccf893d81aafd06c" +checksum = "bd728409de235de0489f71ee2d1beb320613fdb50dda9fa1c564825f4ad06daa" dependencies = [ "array-init", "cfg-if", @@ -659,9 +659,9 @@ dependencies = [ [[package]] name = "ink_storage_traits" -version = "4.2.1" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4179f00b052e5955ab7535c1a69042a468771217e9db6a12de2cdbfcb03c861" +checksum = "a8dcb50f70377ac35c28d63b06383a0a3cbb79542ea4cdc5b00e3e2b3de4a549" dependencies = [ "ink_metadata", "ink_prelude", @@ -1171,9 +1171,9 @@ checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" [[package]] name = "scale-bits" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dd7aca73785181cc41f0bbe017263e682b585ca660540ba569133901d013ecf" +checksum = "036575c29af9b6e4866ffb7fa055dbf623fe7a9cc159b33786de6013a6969d89" dependencies = [ "parity-scale-codec", "scale-info", @@ -1181,22 +1181,23 @@ dependencies = [ [[package]] name = "scale-decode" -version = "0.5.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7e5527e4b3bf079d4c0b2f253418598c380722ba37ef20fac9088081407f2b6" +checksum = "7789f5728e4e954aaa20cadcc370b99096fb8645fca3c9333ace44bb18f30095" dependencies = [ + "derive_more", "parity-scale-codec", "scale-bits", "scale-decode-derive", "scale-info", - "thiserror", + "smallvec", ] [[package]] name = "scale-decode-derive" -version = "0.5.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b38741b2f78e4391b94eac6b102af0f6ea2b0f7fe65adb55d7f4004f507854db" +checksum = "27873eb6005868f8cc72dcfe109fae664cf51223d35387bc2f28be4c28d94c47" dependencies = [ "darling", "proc-macro-crate", @@ -1207,21 +1208,22 @@ dependencies = [ [[package]] name = "scale-encode" -version = "0.1.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15546e5efbb45f0fc2291f7e202dee8623274c5d8bbfdf9c6886cc8b44a7ced3" +checksum = "6d70cb4b29360105483fac1ed567ff95d65224a14dd275b6303ed0a654c78de5" dependencies = [ + "derive_more", "parity-scale-codec", "scale-encode-derive", "scale-info", - "thiserror", + "smallvec", ] [[package]] name = "scale-encode-derive" -version = "0.1.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd983cf0a9effd76138554ead18a6de542d1af175ac12fd5e91836c5c0268082" +checksum = "995491f110efdc6bea96d6a746140e32bfceb4ea47510750a5467295a4707a25" dependencies = [ "darling", "proc-macro-crate", @@ -1345,6 +1347,12 @@ dependencies = [ "keccak", ] +[[package]] +name = "smallvec" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" + [[package]] name = "sp-arithmetic" version = "6.0.0" diff --git a/farm/contracts/Cargo.toml b/farm/contracts/Cargo.toml index 857e964e..64cf7c72 100644 --- a/farm/contracts/Cargo.toml +++ b/farm/contracts/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Cardinal Cryptography"] edition = "2021" [dependencies] -ink = { version = "=4.2.1", default-features = false } +ink = { version = "=4.3.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = [ "derive", diff --git a/farm/psp22-traits/Cargo.toml b/farm/psp22-traits/Cargo.toml index 0fe59b7b..36f10381 100644 --- a/farm/psp22-traits/Cargo.toml +++ b/farm/psp22-traits/Cargo.toml @@ -5,7 +5,7 @@ authors = ["filip.bielejec@cardinals.cc"] edition = "2021" [dependencies] -ink = { version = "=4.2.1", default-features = false } +ink = { version = "=4.3.0", default-features = false } scale = { package = "parity-scale-codec", version = "3", default-features = false, features = [ "derive", diff --git a/uniswap-v2/contracts/factory/Cargo.toml b/uniswap-v2/contracts/factory/Cargo.toml index dcb1cc8e..1353f6c1 100644 --- a/uniswap-v2/contracts/factory/Cargo.toml +++ b/uniswap-v2/contracts/factory/Cargo.toml @@ -5,12 +5,18 @@ authors = ["Stake Technologies "] edition = "2021" [dependencies] -ink = { version = "=4.2.1", default-features = false} +ink = { version = "=4.3.0", default-features = false } -scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } +scale = { package = "parity-scale-codec", version = "3", default-features = false, features = [ + "derive", +] } +scale-info = { version = "2.3", default-features = false, features = [ + "derive", +], optional = true } -pair_contract = { path = "../pair", default-features = false, features = ["ink-as-dependency"] } +pair_contract = { path = "../pair", default-features = false, features = [ + "ink-as-dependency", +] } openbrush = { git = "https://github.com/727-Ventures/openbrush-contracts", tag = "3.1.1", default-features = false } uniswap_v2 = { path = "../../logics", default-features = false } diff --git a/uniswap-v2/contracts/pair/Cargo.toml b/uniswap-v2/contracts/pair/Cargo.toml index bf803d01..095d5ac2 100644 --- a/uniswap-v2/contracts/pair/Cargo.toml +++ b/uniswap-v2/contracts/pair/Cargo.toml @@ -5,12 +5,19 @@ authors = ["Stake Technologies "] edition = "2021" [dependencies] -ink = { version = "=4.2.1", default-features = false} +ink = { version = "=4.3.0", default-features = false } -scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } +scale = { package = "parity-scale-codec", version = "3", default-features = false, features = [ + "derive", +] } +scale-info = { version = "2.3", default-features = false, features = [ + "derive", +], optional = true } -openbrush = { git = "https://github.com/727-Ventures/openbrush-contracts", tag = "3.1.1", default-features = false, features = ["psp22", "reentrancy_guard"] } +openbrush = { git = "https://github.com/727-Ventures/openbrush-contracts", tag = "3.1.1", default-features = false, features = [ + "psp22", + "reentrancy_guard", +] } uniswap_v2 = { path = "../../logics", default-features = false } [lib] @@ -25,7 +32,7 @@ std = [ "scale/std", "scale-info/std", "openbrush/std", - "uniswap_v2/std" + "uniswap_v2/std", ] ink-as-dependency = [] diff --git a/uniswap-v2/contracts/psp22/Cargo.toml b/uniswap-v2/contracts/psp22/Cargo.toml index dc6387c5..6d1e97d6 100644 --- a/uniswap-v2/contracts/psp22/Cargo.toml +++ b/uniswap-v2/contracts/psp22/Cargo.toml @@ -5,12 +5,18 @@ authors = ["Supercolony "] edition = "2021" [dependencies] -ink = { version = "=4.2.1", default-features = false} +ink = { version = "=4.3.0", default-features = false } -scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } +scale = { package = "parity-scale-codec", version = "3", default-features = false, features = [ + "derive", +] } +scale-info = { version = "2.3", default-features = false, features = [ + "derive", +], optional = true } -openbrush = { git = "https://github.com/727-Ventures/openbrush-contracts", tag = "3.1.1", default-features = false, features = ["psp22"] } +openbrush = { git = "https://github.com/727-Ventures/openbrush-contracts", tag = "3.1.1", default-features = false, features = [ + "psp22", +] } [lib] name = "psp22_token" @@ -18,10 +24,5 @@ path = "lib.rs" [features] default = ["std"] -std = [ - "ink/std", - "scale/std", - "scale-info/std", - "openbrush/std", -] +std = ["ink/std", "scale/std", "scale-info/std", "openbrush/std"] ink-as-dependency = [] diff --git a/uniswap-v2/contracts/router/Cargo.toml b/uniswap-v2/contracts/router/Cargo.toml index 3c90bd03..cfb126f6 100755 --- a/uniswap-v2/contracts/router/Cargo.toml +++ b/uniswap-v2/contracts/router/Cargo.toml @@ -5,13 +5,21 @@ authors = ["Stake Technologies "] edition = "2021" [dependencies] -primitive-types = { version = "0.11.1", default-features = false, features = ["num-traits"] } -ink = { version = "=4.2.1", default-features = false} +primitive-types = { version = "0.11.1", default-features = false, features = [ + "num-traits", +] } +ink = { version = "=4.3.0", default-features = false } -scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } +scale = { package = "parity-scale-codec", version = "3", default-features = false, features = [ + "derive", +] } +scale-info = { version = "2.3", default-features = false, features = [ + "derive", +], optional = true } -openbrush = { git = "https://github.com/727-Ventures/openbrush-contracts", tag = "3.1.1", default-features = false, features = ["psp22"] } +openbrush = { git = "https://github.com/727-Ventures/openbrush-contracts", tag = "3.1.1", default-features = false, features = [ + "psp22", +] } uniswap_v2 = { path = "../../logics", default-features = false } [lib] @@ -26,7 +34,7 @@ std = [ "scale-info", "scale-info/std", "openbrush/std", - "uniswap_v2/std" + "uniswap_v2/std", ] ink-as-dependency = [] diff --git a/uniswap-v2/contracts/wnative/Cargo.toml b/uniswap-v2/contracts/wnative/Cargo.toml index 6873a1eb..80c38452 100644 --- a/uniswap-v2/contracts/wnative/Cargo.toml +++ b/uniswap-v2/contracts/wnative/Cargo.toml @@ -5,12 +5,18 @@ authors = ["Stake Technologies "] edition = "2021" [dependencies] -ink = { version = "=4.2.1", default-features = false} +ink = { version = "=4.3.0", default-features = false } -scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } +scale = { package = "parity-scale-codec", version = "3", default-features = false, features = [ + "derive", +] } +scale-info = { version = "2.3", default-features = false, features = [ + "derive", +], optional = true } -openbrush = { git = "https://github.com/727-Ventures/openbrush-contracts", tag = "3.1.1", default-features = false, features = ["psp22"] } +openbrush = { git = "https://github.com/727-Ventures/openbrush-contracts", tag = "3.1.1", default-features = false, features = [ + "psp22", +] } uniswap_v2 = { path = "../../logics", default-features = false } [lib] @@ -25,7 +31,7 @@ std = [ "scale-info", "scale-info/std", "openbrush/std", - "uniswap_v2/std" + "uniswap_v2/std", ] ink-as-dependency = [] diff --git a/uniswap-v2/logics/Cargo.toml b/uniswap-v2/logics/Cargo.toml index 2cc21bf4..b1739ca8 100644 --- a/uniswap-v2/logics/Cargo.toml +++ b/uniswap-v2/logics/Cargo.toml @@ -5,26 +5,34 @@ authors = ["Stake Technologies "] edition = "2021" [dependencies] -ink = { version = "=4.2.1", default-features = false} -ink_metadata = { version = "=4.2.1", features = ["derive"], optional = true } +ink = { version = "=4.3.0", default-features = false } +ink_metadata = { version = "=4.3.0", features = ["derive"], optional = true } -scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true } +scale = { package = "parity-scale-codec", version = "3", default-features = false, features = [ + "derive", +] } +scale-info = { version = "2.3", default-features = false, features = [ + "derive", +], optional = true } -openbrush = { git = "https://github.com/727-Ventures/openbrush-contracts", tag = "3.1.1", default-features = false, features = ["psp22", "ownable", "reentrancy_guard"] } -primitive-types = { version = "0.11.1", default-features = false, features = ["codec"] } -sp-arithmetic = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.37"} +openbrush = { git = "https://github.com/727-Ventures/openbrush-contracts", tag = "3.1.1", default-features = false, features = [ + "psp22", + "ownable", + "reentrancy_guard", +] } +primitive-types = { version = "0.11.1", default-features = false, features = [ + "codec", +] } +sp-arithmetic = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.37" } [dev-dependencies] -curve25519-dalek = { version = "4.0.0-rc.2", features = [ "digest" ] } +curve25519-dalek = { version = "4.0.0-rc.2", features = ["digest"] } sha2 = "0.10.6" [lib] name = "uniswap_v2" path = "lib.rs" -crate-type = [ - "rlib", -] +crate-type = ["rlib"] [features] default = ["std"] @@ -37,5 +45,5 @@ std = [ "openbrush/std", "primitive-types/std", "primitive-types/scale-info", - "sp-arithmetic/std" + "sp-arithmetic/std", ] diff --git a/uniswap-v2/logics/traits/types.rs b/uniswap-v2/logics/traits/types.rs index 5fa83989..dff11015 100644 --- a/uniswap-v2/logics/traits/types.rs +++ b/uniswap-v2/logics/traits/types.rs @@ -1,13 +1,13 @@ #[cfg(feature = "std")] -use ink::primitives::Key; -#[cfg(feature = "std")] -use ink::storage::traits::StorageLayout; -#[cfg(feature = "std")] -use ink_metadata::layout::{ +use ink::metadata::layout::{ Layout, LayoutKey, LeafLayout, }; +#[cfg(feature = "std")] +use ink::primitives::Key; +#[cfg(feature = "std")] +use ink::storage::traits::StorageLayout; use primitive_types::U256; use scale::{ Decode,