diff --git a/Cargo.lock b/Cargo.lock index 689fd1c994..31272c721b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -185,6 +185,7 @@ dependencies = [ "frame-try-runtime", "hex-literal", "log", + "merkle-distributor", "node-primitives", "orml-benchmarking", "orml-currencies", @@ -759,6 +760,7 @@ dependencies = [ "frame-try-runtime", "hex-literal", "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=17a791edf431d7d7aee1ea3dfaeeb7bc21944301)", @@ -4745,6 +4747,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=e9bba954baaa0b1539e2647988da35f5fe81b0b3#e9bba954baaa0b1539e2647988da35f5fe81b0b3" +dependencies = [ + "frame-support", + "frame-system", + "hex-literal", + "orml-tokens 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?rev=17a791edf431d7d7aee1ea3dfaeeb7bc21944301)", + "orml-traits 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?rev=17a791edf431d7d7aee1ea3dfaeeb7bc21944301)", + "pallet-balances", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + [[package]] name = "merlin" version = "2.0.1" @@ -5390,7 +5412,7 @@ dependencies = [ [[package]] name = "orml-tokens" version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=master#17a791edf431d7d7aee1ea3dfaeeb7bc21944301" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=master#8d076372849a4dced5468f0f14db96b7145160ee" dependencies = [ "frame-support", "frame-system", @@ -5420,7 +5442,7 @@ dependencies = [ [[package]] name = "orml-traits" version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=master#17a791edf431d7d7aee1ea3dfaeeb7bc21944301" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=master#8d076372849a4dced5468f0f14db96b7145160ee" dependencies = [ "frame-support", "impl-trait-for-tuples", @@ -5471,7 +5493,7 @@ dependencies = [ [[package]] name = "orml-utilities" version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=master#17a791edf431d7d7aee1ea3dfaeeb7bc21944301" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=master#8d076372849a4dced5468f0f14db96b7145160ee" dependencies = [ "frame-support", "parity-scale-codec", @@ -11716,7 +11738,7 @@ dependencies = [ [[package]] name = "zenlink-protocol" version = "0.4.4" -source = "git+https://github.com/zenlinkpro/Zenlink-DEX-Module?rev=2458c585b0313de495092a5633a547f7e8fa0588#2458c585b0313de495092a5633a547f7e8fa0588" +source = "git+https://github.com/zenlinkpro/Zenlink-DEX-Module?rev=e5747a897cfd0fb5d322781ffe656220ae1e814f#e5747a897cfd0fb5d322781ffe656220ae1e814f" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -11739,7 +11761,7 @@ dependencies = [ [[package]] name = "zenlink-protocol-rpc" version = "0.4.4" -source = "git+https://github.com/zenlinkpro/Zenlink-DEX-Module?rev=2458c585b0313de495092a5633a547f7e8fa0588#2458c585b0313de495092a5633a547f7e8fa0588" +source = "git+https://github.com/zenlinkpro/Zenlink-DEX-Module?rev=e5747a897cfd0fb5d322781ffe656220ae1e814f#e5747a897cfd0fb5d322781ffe656220ae1e814f" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -11756,7 +11778,7 @@ dependencies = [ [[package]] name = "zenlink-protocol-runtime-api" version = "0.4.4" -source = "git+https://github.com/zenlinkpro/Zenlink-DEX-Module?rev=2458c585b0313de495092a5633a547f7e8fa0588#2458c585b0313de495092a5633a547f7e8fa0588" +source = "git+https://github.com/zenlinkpro/Zenlink-DEX-Module?rev=e5747a897cfd0fb5d322781ffe656220ae1e814f#e5747a897cfd0fb5d322781ffe656220ae1e814f" dependencies = [ "parity-scale-codec", "sp-api", diff --git a/Cargo.toml b/Cargo.toml index e4a3ea5b06..6a69a5fd0f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -195,9 +195,11 @@ substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" } substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" } -zenlink-protocol = { git = "https://github.com/zenlinkpro/Zenlink-DEX-Module", rev = "2458c585b0313de495092a5633a547f7e8fa0588"} -zenlink-protocol-rpc = { git = "https://github.com/zenlinkpro/Zenlink-DEX-Module", rev = "2458c585b0313de495092a5633a547f7e8fa0588" } -zenlink-protocol-runtime-api = { git = "https://github.com/zenlinkpro/Zenlink-DEX-Module", rev = "2458c585b0313de495092a5633a547f7e8fa0588" } +zenlink-protocol = { git = "https://github.com/zenlinkpro/Zenlink-DEX-Module", rev = "e5747a897cfd0fb5d322781ffe656220ae1e814f"} +zenlink-protocol-rpc = { git = "https://github.com/zenlinkpro/Zenlink-DEX-Module", rev = "e5747a897cfd0fb5d322781ffe656220ae1e814f" } +zenlink-protocol-runtime-api = { git = "https://github.com/zenlinkpro/Zenlink-DEX-Module", rev = "e5747a897cfd0fb5d322781ffe656220ae1e814f" } +merkle-distributor = { git = "https://github.com/zenlinkpro/merkle-distributor", rev = "e9bba954baaa0b1539e2647988da35f5fe81b0b3" } + orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "17a791edf431d7d7aee1ea3dfaeeb7bc21944301" } orml-currencies = {git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "17a791edf431d7d7aee1ea3dfaeeb7bc21944301" } diff --git a/runtime/asgard/Cargo.toml b/runtime/asgard/Cargo.toml index 683862030d..95c1c9d0b7 100644 --- a/runtime/asgard/Cargo.toml +++ b/runtime/asgard/Cargo.toml @@ -113,6 +113,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.13" } @@ -204,6 +205,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 5f937742e8..c203644d5c 100644 --- a/runtime/asgard/src/lib.rs +++ b/runtime/asgard/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"); } pub fn get_all_pallet_accounts() -> Vec { @@ -1492,6 +1493,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% @@ -1658,6 +1674,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 e2defac371..c3a58c1289 100644 --- a/runtime/bifrost/Cargo.toml +++ b/runtime/bifrost/Cargo.toml @@ -107,6 +107,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.13" } @@ -183,6 +184,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 ca3a9d7be7..3c98dc6d02 100644 --- a/runtime/bifrost/src/lib.rs +++ b/runtime/bifrost/src/lib.rs @@ -287,6 +287,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 { @@ -1465,6 +1466,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% @@ -1629,6 +1646,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,