diff --git a/Cargo.lock b/Cargo.lock index bfcf9ae98a..69b3ebf525 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -194,11 +194,12 @@ dependencies = [ "frame-try-runtime", "hex-literal 0.3.3", "log", + "merkle-distributor", "node-primitives", "orml-benchmarking", "orml-currencies", - "orml-tokens 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?rev=5ba42f532b72d71a28aaa18421855de003b9ca71)", - "orml-traits 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?rev=5ba42f532b72d71a28aaa18421855de003b9ca71)", + "orml-tokens", + "orml-traits", "orml-unknown-tokens", "orml-xcm", "orml-xcm-support", @@ -637,8 +638,8 @@ dependencies = [ "frame-system", "node-primitives", "num-bigint 0.4.3", - "orml-tokens 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?rev=5ba42f532b72d71a28aaa18421855de003b9ca71)", - "orml-traits 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?rev=5ba42f532b72d71a28aaa18421855de003b9ca71)", + "orml-tokens", + "orml-traits", "parity-scale-codec", "scale-info", "serde", @@ -666,8 +667,8 @@ dependencies = [ "node-primitives", "num-traits", "orml-currencies", - "orml-tokens 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?rev=5ba42f532b72d71a28aaa18421855de003b9ca71)", - "orml-traits 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?rev=5ba42f532b72d71a28aaa18421855de003b9ca71)", + "orml-tokens", + "orml-traits", "pallet-balances", "parity-scale-codec", "scale-info", @@ -684,8 +685,8 @@ dependencies = [ "frame-support", "frame-system", "node-primitives", - "orml-tokens 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?rev=5ba42f532b72d71a28aaa18421855de003b9ca71)", - "orml-traits 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?rev=5ba42f532b72d71a28aaa18421855de003b9ca71)", + "orml-tokens", + "orml-traits", "pallet-balances", "parity-scale-codec", "scale-info", @@ -709,8 +710,8 @@ dependencies = [ "impl-trait-for-tuples", "node-primitives", "orml-currencies", - "orml-tokens 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?rev=5ba42f532b72d71a28aaa18421855de003b9ca71)", - "orml-traits 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?rev=5ba42f532b72d71a28aaa18421855de003b9ca71)", + "orml-tokens", + "orml-traits", "pallet-balances", "pallet-transaction-payment", "pallet-xcm", @@ -763,8 +764,8 @@ dependencies = [ "frame-support", "frame-system", "node-primitives", - "orml-tokens 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?rev=5ba42f532b72d71a28aaa18421855de003b9ca71)", - "orml-traits 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?rev=5ba42f532b72d71a28aaa18421855de003b9ca71)", + "orml-tokens", + "orml-traits", "pallet-collective", "parity-scale-codec", "scale-info", @@ -785,8 +786,8 @@ dependencies = [ "frame-system", "node-primitives", "orml-currencies", - "orml-tokens 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?rev=5ba42f532b72d71a28aaa18421855de003b9ca71)", - "orml-traits 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?rev=5ba42f532b72d71a28aaa18421855de003b9ca71)", + "orml-tokens", + "orml-traits", "pallet-balances", "pallet-collective", "parity-scale-codec", @@ -833,8 +834,8 @@ dependencies = [ "frame-system", "node-primitives", "orml-currencies", - "orml-tokens 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?rev=5ba42f532b72d71a28aaa18421855de003b9ca71)", - "orml-traits 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?rev=5ba42f532b72d71a28aaa18421855de003b9ca71)", + "orml-tokens", + "orml-traits", "pallet-balances", "parity-scale-codec", "scale-info", @@ -878,10 +879,11 @@ dependencies = [ "frame-try-runtime", "hex-literal 0.3.3", "log", + "merkle-distributor", "node-primitives", "orml-currencies", - "orml-tokens 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?rev=5ba42f532b72d71a28aaa18421855de003b9ca71)", - "orml-traits 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?rev=5ba42f532b72d71a28aaa18421855de003b9ca71)", + "orml-tokens", + "orml-traits", "orml-unknown-tokens", "orml-xcm", "orml-xcm-support", @@ -957,8 +959,8 @@ dependencies = [ "log", "node-primitives", "orml-currencies", - "orml-tokens 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?rev=5ba42f532b72d71a28aaa18421855de003b9ca71)", - "orml-traits 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?rev=5ba42f532b72d71a28aaa18421855de003b9ca71)", + "orml-tokens", + "orml-traits", "pallet-collator-selection", "pallet-collective", "pallet-democracy", @@ -1007,8 +1009,8 @@ dependencies = [ "log", "node-primitives", "orml-currencies", - "orml-tokens 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?rev=5ba42f532b72d71a28aaa18421855de003b9ca71)", - "orml-traits 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?rev=5ba42f532b72d71a28aaa18421855de003b9ca71)", + "orml-tokens", + "orml-traits", "pallet-balances", "pallet-multisig", "pallet-xcm", @@ -1037,8 +1039,8 @@ dependencies = [ "log", "node-primitives", "orml-currencies", - "orml-tokens 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?rev=5ba42f532b72d71a28aaa18421855de003b9ca71)", - "orml-traits 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?rev=5ba42f532b72d71a28aaa18421855de003b9ca71)", + "orml-tokens", + "orml-traits", "pallet-balances", "pallet-multisig", "parity-scale-codec", @@ -1087,8 +1089,8 @@ dependencies = [ "frame-system", "node-primitives", "orml-currencies", - "orml-tokens 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?rev=5ba42f532b72d71a28aaa18421855de003b9ca71)", - "orml-traits 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?rev=5ba42f532b72d71a28aaa18421855de003b9ca71)", + "orml-tokens", + "orml-traits", "pallet-balances", "pallet-collective", "parity-scale-codec", @@ -1122,8 +1124,8 @@ dependencies = [ "frame-support", "frame-system", "node-primitives", - "orml-tokens 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?rev=5ba42f532b72d71a28aaa18421855de003b9ca71)", - "orml-traits 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?rev=5ba42f532b72d71a28aaa18421855de003b9ca71)", + "orml-tokens", + "orml-traits", "parity-scale-codec", "scale-info", "sp-core", @@ -1142,8 +1144,8 @@ dependencies = [ "frame-system", "node-primitives", "orml-currencies", - "orml-tokens 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?rev=5ba42f532b72d71a28aaa18421855de003b9ca71)", - "orml-traits 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?rev=5ba42f532b72d71a28aaa18421855de003b9ca71)", + "orml-tokens", + "orml-traits", "pallet-balances", "parity-scale-codec", "scale-info", @@ -4697,6 +4699,26 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71d96e3f3c0b6325d8ccd83c33b28acb183edcb6c67938ba104ec546854b0882" +[[package]] +name = "merkle-distributor" +version = "0.1.0" +source = "git+https://github.com/zenlinkpro/merkle-distributor?rev=b5d697e37824707eefebb5521d535d6fafd59590#b5d697e37824707eefebb5521d535d6fafd59590" +dependencies = [ + "frame-support", + "frame-system", + "hex-literal 0.3.3", + "orml-tokens", + "orml-traits", + "pallet-balances", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + [[package]] name = "merlin" version = "2.0.1" @@ -5345,8 +5367,8 @@ source = "git+https://github.com/open-web3-stack/open-runtime-module-library?rev dependencies = [ "frame-support", "frame-system", - "orml-traits 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?rev=5ba42f532b72d71a28aaa18421855de003b9ca71)", - "orml-utilities 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?rev=5ba42f532b72d71a28aaa18421855de003b9ca71)", + "orml-traits", + "orml-utilities", "parity-scale-codec", "scale-info", "serde", @@ -5355,21 +5377,6 @@ dependencies = [ "sp-std", ] -[[package]] -name = "orml-tokens" -version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=master#5ba42f532b72d71a28aaa18421855de003b9ca71" -dependencies = [ - "frame-support", - "frame-system", - "orml-traits 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?branch=master)", - "parity-scale-codec", - "scale-info", - "serde", - "sp-runtime", - "sp-std", -] - [[package]] name = "orml-tokens" version = "0.4.1-dev" @@ -5377,7 +5384,7 @@ source = "git+https://github.com/open-web3-stack/open-runtime-module-library?rev dependencies = [ "frame-support", "frame-system", - "orml-traits 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?rev=5ba42f532b72d71a28aaa18421855de003b9ca71)", + "orml-traits", "parity-scale-codec", "scale-info", "serde", @@ -5385,24 +5392,6 @@ dependencies = [ "sp-std", ] -[[package]] -name = "orml-traits" -version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=master#5ba42f532b72d71a28aaa18421855de003b9ca71" -dependencies = [ - "frame-support", - "impl-trait-for-tuples", - "num-traits", - "orml-utilities 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?branch=master)", - "parity-scale-codec", - "scale-info", - "serde", - "sp-io", - "sp-runtime", - "sp-std", - "xcm", -] - [[package]] name = "orml-traits" version = "0.4.1-dev" @@ -5411,7 +5400,7 @@ dependencies = [ "frame-support", "impl-trait-for-tuples", "num-traits", - "orml-utilities 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?rev=5ba42f532b72d71a28aaa18421855de003b9ca71)", + "orml-utilities", "parity-scale-codec", "scale-info", "serde", @@ -5436,20 +5425,6 @@ dependencies = [ "xcm", ] -[[package]] -name = "orml-utilities" -version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=master#5ba42f532b72d71a28aaa18421855de003b9ca71" -dependencies = [ - "frame-support", - "parity-scale-codec", - "scale-info", - "serde", - "sp-io", - "sp-runtime", - "sp-std", -] - [[package]] name = "orml-utilities" version = "0.4.1-dev" @@ -5484,7 +5459,7 @@ version = "0.4.1-dev" source = "git+https://github.com/open-web3-stack/open-runtime-module-library?rev=5ba42f532b72d71a28aaa18421855de003b9ca71#5ba42f532b72d71a28aaa18421855de003b9ca71" dependencies = [ "frame-support", - "orml-traits 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?rev=5ba42f532b72d71a28aaa18421855de003b9ca71)", + "orml-traits", "parity-scale-codec", "sp-runtime", "sp-std", @@ -5500,7 +5475,7 @@ dependencies = [ "cumulus-primitives-core", "frame-support", "frame-system", - "orml-traits 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?rev=5ba42f532b72d71a28aaa18421855de003b9ca71)", + "orml-traits", "orml-xcm-support", "parity-scale-codec", "scale-info", @@ -11766,14 +11741,14 @@ dependencies = [ [[package]] name = "zenlink-protocol" version = "0.4.4" -source = "git+https://github.com/zenlinkpro/Zenlink-DEX-Module?rev=16a17a3023620bd66f657a46496734bf6cb34f25#16a17a3023620bd66f657a46496734bf6cb34f25" +source = "git+https://github.com/zenlinkpro/Zenlink-DEX-Module?rev=75601732b89f9f6ece8e3af8781640347871b1ec#75601732b89f9f6ece8e3af8781640347871b1ec" dependencies = [ "cumulus-primitives-core", "frame-support", "frame-system", "log", - "orml-tokens 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?branch=master)", - "orml-traits 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?branch=master)", + "orml-tokens", + "orml-traits", "pallet-balances", "parity-scale-codec", "scale-info", @@ -11789,7 +11764,7 @@ dependencies = [ [[package]] name = "zenlink-protocol-rpc" version = "0.4.4" -source = "git+https://github.com/zenlinkpro/Zenlink-DEX-Module?rev=16a17a3023620bd66f657a46496734bf6cb34f25#16a17a3023620bd66f657a46496734bf6cb34f25" +source = "git+https://github.com/zenlinkpro/Zenlink-DEX-Module?rev=75601732b89f9f6ece8e3af8781640347871b1ec#75601732b89f9f6ece8e3af8781640347871b1ec" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -11806,7 +11781,7 @@ dependencies = [ [[package]] name = "zenlink-protocol-runtime-api" version = "0.4.4" -source = "git+https://github.com/zenlinkpro/Zenlink-DEX-Module?rev=16a17a3023620bd66f657a46496734bf6cb34f25#16a17a3023620bd66f657a46496734bf6cb34f25" +source = "git+https://github.com/zenlinkpro/Zenlink-DEX-Module?rev=75601732b89f9f6ece8e3af8781640347871b1ec#75601732b89f9f6ece8e3af8781640347871b1ec" dependencies = [ "parity-scale-codec", "sp-api", diff --git a/Cargo.toml b/Cargo.toml index 5d6afb049d..ef35ea8454 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -193,9 +193,11 @@ substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.12" } substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.12" } -zenlink-protocol = { git = "https://github.com/zenlinkpro/Zenlink-DEX-Module", rev = "16a17a3023620bd66f657a46496734bf6cb34f25"} -zenlink-protocol-rpc = { git = "https://github.com/zenlinkpro/Zenlink-DEX-Module", rev = "16a17a3023620bd66f657a46496734bf6cb34f25" } -zenlink-protocol-runtime-api = { git = "https://github.com/zenlinkpro/Zenlink-DEX-Module", rev = "16a17a3023620bd66f657a46496734bf6cb34f25" } +zenlink-protocol = { git = "https://github.com/zenlinkpro/Zenlink-DEX-Module", rev = "75601732b89f9f6ece8e3af8781640347871b1ec"} +zenlink-protocol-rpc = { git = "https://github.com/zenlinkpro/Zenlink-DEX-Module", rev = "75601732b89f9f6ece8e3af8781640347871b1ec" } +zenlink-protocol-runtime-api = { git = "https://github.com/zenlinkpro/Zenlink-DEX-Module", rev = "75601732b89f9f6ece8e3af8781640347871b1ec" } +merkle-distributor = { git = "https://github.com/zenlinkpro/merkle-distributor", rev = "b5d697e37824707eefebb5521d535d6fafd59590" } + orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "5ba42f532b72d71a28aaa18421855de003b9ca71" } orml-currencies = {git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "5ba42f532b72d71a28aaa18421855de003b9ca71" } diff --git a/runtime/asgard/Cargo.toml b/runtime/asgard/Cargo.toml index 89eff95a14..b78fe14585 100644 --- a/runtime/asgard/Cargo.toml +++ b/runtime/asgard/Cargo.toml @@ -115,6 +115,7 @@ orml-benchmarking = { version = "0.4.1-dev", default-features = false, optional zenlink-protocol = { version = "*", default-features = false } zenlink-protocol-runtime-api = { version = "*", default-features = false } +merkle-distributor = {version = "*", default-features = false } [build-dependencies] substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.12" } @@ -208,6 +209,7 @@ std = [ "orml-benchmarking/std", "zenlink-protocol/std", "zenlink-protocol-runtime-api/std", + "merkle-distributor/std", ] runtime-benchmarks = [ diff --git a/runtime/asgard/src/lib.rs b/runtime/asgard/src/lib.rs index 68fee3eab1..cdc9e1e32e 100644 --- a/runtime/asgard/src/lib.rs +++ b/runtime/asgard/src/lib.rs @@ -282,6 +282,7 @@ parameter_types! { pub const LiquidityMiningPalletId: PalletId = PalletId(*b"bf/lm###"); pub const LiquidityMiningDOTPalletId: PalletId = PalletId(*b"bf/lmdot"); pub const LighteningRedeemPalletId: PalletId = PalletId(*b"bf/ltnrd"); + pub const MerkleDirtributorPalletId: PalletId = PalletId(*b"bf/mklds"); } pub fn get_all_pallet_accounts() -> Vec { @@ -1479,6 +1480,21 @@ impl bifrost_call_switchgear::Config for Runtime { // bifrost runtime end // zenlink runtime start +parameter_types! { + pub const StringLimit: u32 = 50; +} + +impl merkle_distributor::Config for Runtime { + type Event = Event; + type CurrencyId = CurrencyId; + type MultiCurrency = Currencies; + type Balance = Balance; + type MerkleDistributorId = u32; + type PalletId = MerkleDirtributorPalletId; + type StringLimit = StringLimit; + type WeightInfo = (); +} + parameter_types! { pub const ZenlinkPalletId: PalletId = PalletId(*b"/zenlink"); pub const GetExchangeFee: (u32, u32) = (3, 1000); // 0.3% @@ -1646,6 +1662,7 @@ construct_runtime! { OrmlXcm: orml_xcm::{Pallet, Call, Event} = 74, ZenlinkProtocol: zenlink_protocol::{Pallet, Call, Storage, Event} = 80, + MerkleDistributor: merkle_distributor::{Pallet, Call, Storage, Event} = 81, // Bifrost modules FlexibleFee: bifrost_flexible_fee::{Pallet, Call, Storage, Event} = 100, diff --git a/runtime/bifrost/Cargo.toml b/runtime/bifrost/Cargo.toml index e92f3d2818..a957be4f86 100644 --- a/runtime/bifrost/Cargo.toml +++ b/runtime/bifrost/Cargo.toml @@ -109,6 +109,7 @@ orml-xcm-support = { version = "0.4.1-dev", default-features = false } zenlink-protocol = { version = "*", default-features = false } zenlink-protocol-runtime-api = { version = "*", default-features = false } +merkle-distributor = {version = "*", default-features = false } [build-dependencies] substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.12" } @@ -187,6 +188,7 @@ std = [ "bifrost-lightening-redeem/std", "zenlink-protocol/std", "zenlink-protocol-runtime-api/std", + "merkle-distributor/std", "xcm-support/std" ] with-tracing = ["frame-executive/with-tracing"] diff --git a/runtime/bifrost/src/lib.rs b/runtime/bifrost/src/lib.rs index 259a8a6fee..7f1e71d919 100644 --- a/runtime/bifrost/src/lib.rs +++ b/runtime/bifrost/src/lib.rs @@ -285,6 +285,7 @@ parameter_types! { pub const LiquidityMiningPalletId: PalletId = PalletId(*b"bf/lm###"); pub const LiquidityMiningDOTPalletId: PalletId = PalletId(*b"bf/lmdot"); pub const LighteningRedeemPalletId: PalletId = PalletId(*b"bf/ltnrd"); + pub const MerkleDirtributorPalletId: PalletId = PalletId(*b"bf/mklds"); } impl frame_system::Config for Runtime { @@ -1451,6 +1452,22 @@ impl bifrost_call_switchgear::Config for Runtime { // Bifrost modules end // zenlink runtime start + +parameter_types! { + pub const StringLimit: u32 = 50; +} + +impl merkle_distributor::Config for Runtime { + type Event = Event; + type CurrencyId = CurrencyId; + type MultiCurrency = Currencies; + type Balance = Balance; + type MerkleDistributorId = u32; + type PalletId = MerkleDirtributorPalletId; + type StringLimit = StringLimit; + type WeightInfo = (); +} + parameter_types! { pub const ZenlinkPalletId: PalletId = PalletId(*b"/zenlink"); pub const GetExchangeFee: (u32, u32) = (3, 1000); // 0.3% @@ -1615,6 +1632,7 @@ construct_runtime! { UnknownTokens: orml_unknown_tokens::{Pallet, Storage, Event} = 73, OrmlXcm: orml_xcm::{Pallet, Call, Event} = 74, ZenlinkProtocol: zenlink_protocol::{Pallet, Call, Storage, Event} = 80, + MerkleDistributor: merkle_distributor::{Pallet, Call, Storage, Event} = 81, // Bifrost modules FlexibleFee: bifrost_flexible_fee::{Pallet, Call, Storage, Event} = 100,