From 3743d25b66a8e6f846cd4803663e1fbe99d68028 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Tue, 31 Aug 2021 10:32:35 +0200 Subject: [PATCH 01/16] feat: add pint submodule --- .gitmodules | 3 +++ ecosystem-modules/pint | 1 + 2 files changed, 4 insertions(+) create mode 160000 ecosystem-modules/pint diff --git a/.gitmodules b/.gitmodules index 3b5c40e05..5414dbf97 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "stable-asset"] path = ecosystem-modules/stable-asset url = https://github.com/nutsfinance/stable-asset.git +[submodule "pint"] + path = ecosystem-modules/pint + url = https://github.com/ChainSafe/PINT.git diff --git a/ecosystem-modules/pint b/ecosystem-modules/pint new file mode 160000 index 000000000..bb27364eb --- /dev/null +++ b/ecosystem-modules/pint @@ -0,0 +1 @@ +Subproject commit bb27364ebe9cc7021860630aa7502e80bc6b7999 From c166668d176cdf510d86d80123a0d78388dba18e Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Tue, 31 Aug 2021 11:55:59 +0200 Subject: [PATCH 02/16] chore: add orml github patches --- Cargo.toml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 3716b0bfd..8eb15e58e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,6 +46,11 @@ members = [ "ecosystem-modules/starport", "ecosystem-modules/compound-cash", "ecosystem-modules/stable-asset/lib/stable-asset", + + "ecosystem-modules/pint/pallets/asset-index", + "ecosystem-modules/pint/pallets/committee", + "ecosystem-modules/pint/pallets/local-treasury", + "ecosystem-modules/pint/pallets/saft-registry", ] resolver = "2" @@ -300,3 +305,10 @@ pallet-beefy = { git = "https://github.com/paritytech//grandpa-bridge-gadget", r beefy-primitives = { git = "https://github.com/paritytech//grandpa-bridge-gadget", rev = "f40c0ab7b327e874d5c8d699bfa5d762f1759ee0" } beefy-gadget = { git = "https://github.com/paritytech//grandpa-bridge-gadget", rev = "f40c0ab7b327e874d5c8d699bfa5d762f1759ee0" } beefy-gadget-rpc = { git = "https://github.com/paritytech//grandpa-bridge-gadget", rev = "f40c0ab7b327e874d5c8d699bfa5d762f1759ee0" } + +[patch."https://github.com/open-web3-stack/open-runtime-module-library"] +orml-currencies = { path = "./orml/currencies" } +orml-tokens = { path = "./orml/tokens" } +orml-xtokens = { path = "./orml/xtokens" } +orml-xcm-support = { path = "./orml/xcm-support" } +orml-traits = { path = "./orml/traits" } \ No newline at end of file From f7493cc639f150d612e532ad604b92757ad9b997 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Tue, 31 Aug 2021 11:56:18 +0200 Subject: [PATCH 03/16] chore: add pint dependencies --- runtime/mandala/Cargo.toml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/runtime/mandala/Cargo.toml b/runtime/mandala/Cargo.toml index bc7b2c73f..6982c7644 100644 --- a/runtime/mandala/Cargo.toml +++ b/runtime/mandala/Cargo.toml @@ -132,6 +132,11 @@ ecosystem-starport = { path = "../../ecosystem-modules/starport", default-featur ecosystem-compound-cash = { path = "../../ecosystem-modules/compound-cash", default-features = false } chainbridge = { git = "https://github.com/AcalaNetwork/chainbridge-substrate", default-features = false } +pint-committee = { path = "../../ecosystem-modules/pint/pallets/committee", package = "pallet-committee", default-features = false } +pint-saft-registry = { path = "../../ecosystem-modules/pint/pallets/saft-registry", package = "pallet-saft-registry", default-features = false } +pint-asset-index = { path = "../../ecosystem-modules/pint/pallets/asset-index", package = "pallet-asset-index", default-features = false } +pint-local-treasury = { path = "../../ecosystem-modules/pint/pallets/local-treasury", package = "pallet-local-treasury", default-features = false } + [build-dependencies] substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" } @@ -266,6 +271,11 @@ std = [ "ecosystem-starport/std", "ecosystem-compound-cash/std", "chainbridge/std", + + "pint-committee/std", + "pint-saft-registry/std", + "pint-asset-index/std", + "pint-local-treasury/std", ] runtime-benchmarks = [ "frame-benchmarking", @@ -288,6 +298,11 @@ runtime-benchmarks = [ "module-homa-lite/runtime-benchmarks", "sp-api/disable-logging", + + "pint-committee/runtime-benchmarks", + "pint-saft-registry/runtime-benchmarks", + "pint-asset-index/runtime-benchmarks", + "pint-local-treasury/runtime-benchmarks", ] # When enabled, the runtime api will not be build. # From 90bc7ee43cac5ff3bcf93bd8607acc05073b29cb Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Tue, 31 Aug 2021 13:09:11 +0200 Subject: [PATCH 04/16] feat: implement pint pallets --- runtime/mandala/src/lib.rs | 127 ++++++++++++++++++++++++++++++++++++- 1 file changed, 126 insertions(+), 1 deletion(-) diff --git a/runtime/mandala/src/lib.rs b/runtime/mandala/src/lib.rs index 0cb3f3d10..fe0fe02d8 100644 --- a/runtime/mandala/src/lib.rs +++ b/runtime/mandala/src/lib.rs @@ -125,6 +125,14 @@ pub use runtime_common::{ /// Import the stable_asset pallet. pub use nutsfinance_stable_asset; +/// Import the PINT pallets +pub use pint_asset_index; +pub use pint_committee; +pub use pint_local_treasury; +pub use pint_price_feed; +pub use pint_primitives; +pub use pint_saft_registry; + mod authority; mod benchmarking; pub mod constants; @@ -177,6 +185,7 @@ parameter_types! { // Ecosystem modules pub const StarportPalletId: PalletId = PalletId(*b"aca/stpt"); pub const StableAssetPalletId: PalletId = PalletId(*b"nuts/sta"); + pub const PintTreasuryPalletId: PalletId = PalletId(*b"pint/trs"); } pub fn get_all_module_accounts() -> Vec { @@ -798,7 +807,9 @@ parameter_type_with_key! { TokenSymbol::LKSM | TokenSymbol::RENBTC | TokenSymbol::ACA | - TokenSymbol::CASH => Balance::max_value() // unsupported + TokenSymbol::CASH => Balance::max_value(), // unsupported + + TokenSymbol::PINT => 1, // TODO: update this before we enable PINT }, CurrencyId::DexShare(dex_share_0, _) => { let currency_id_0: CurrencyId = (*dex_share_0).into(); @@ -1878,6 +1889,114 @@ impl nutsfinance_stable_asset::Config for Runtime { type EnsurePoolAssetId = EnsurePoolAssetId; } +// PINT pallet implementations +parameter_types! { + pub const MinCouncilVotes: usize = 4; + pub const ProposalSubmissionPeriod: BlockNumber = 10 * MINUTES; + pub const MinimumRedemption: u32 = 0; + pub const WithdrawalPeriod: BlockNumber = 10 * MINUTES; + pub const LockupPeriod: BlockNumber = 5 * MINUTES; + pub DOTContributionLimit: Balance = 100_000 * dollar(CurrencyId::Token(TokenSymbol::DOT)); + pub const IndexTokenLockIdentifier: LockIdentifier = *b"pint/lck"; + pub const BaseWithdrawalFee: pint_primitives::fee::FeeRate = pint_primitives::fee::FeeRate{ numerator: 3, denominator: 1_000,}; + pub const AssetIndexStringLimit: u32 = 50; + pub const PINTAssetId: CurrencyId = CurrencyId::Token(TokenSymbol::PINT); +} + +type EnsureApprovedByCommittee = frame_system::EnsureOneOf< + AccountId, + frame_system::EnsureRoot, + pint_committee::EnsureApprovedByCommittee, +>; + +impl pint_saft_registry::Config for Runtime { + // Using signed as the admin origin for now + type AdminOrigin = frame_system::EnsureSigned; + type AssetRecorder = AssetIndex; + type Balance = Balance; + type AssetId = CurrencyId; + type Event = Event; + type WeightInfo = (); +} + +impl pint_local_treasury::Config for Runtime { + // Using root as the admin origin for now + type AdminOrigin = frame_system::EnsureRoot; + type PalletId = TreasuryPalletId; + type Currency = Balances; + type Event = Event; + type WeightInfo = (); +} + +impl pint_committee::Config for Runtime { + type Origin = Origin; + type Action = Call; + type ProposalNonce = u32; + type ProposalSubmissionPeriod = ProposalSubmissionPeriod; + type VotingPeriod = VotingPeriod; + type MinCouncilVotes = MinCouncilVotes; + type ProposalSubmissionOrigin = frame_system::EnsureSigned; + type ProposalExecutionOrigin = pint_committee::EnsureMember; + type ApprovedByCommitteeOrigin = EnsureApprovedByCommittee; + type Event = Event; + type WeightInfo = (); +} + +impl pint_asset_index::Config for Runtime { + // Using signed as the admin origin for testing now + type AdminOrigin = frame_system::EnsureSigned; + type IndexToken = Balances; + type Balance = Balance; + type LockupPeriod = LockupPeriod; + type IndexTokenLockIdentifier = IndexTokenLockIdentifier; + type MinimumRedemption = MinimumRedemption; + type WithdrawalPeriod = WithdrawalPeriod; + type DOTContributionLimit = DOTContributionLimit; + type RemoteAssetManager = MockRemoteAssetManager; + type AssetId = CurrencyId; + type SelfAssetId = PINTAssetId; + type Currency = Currencies; + type PriceFeed = AggregatedDataProvider; + type SaftRegistry = SaftRegistry; + type BaseWithdrawalFee = BaseWithdrawalFee; + type TreasuryPalletId = TreasuryPalletId; + type Event = Event; + type StringLimit = AssetIndexStringLimit; + type WeightInfo = (); +} + +// Wrapper for the `AggregatedDataProvider` until chainlink pallet is supported +impl pint_price_feed::PriceFeed for AggregatedDataProvider { + fn get_price(base: CurrencyId) -> Result { + >::get(&base) + .ok_or_else(|| module_prices::Error::::AccessPriceFailed.into()) + } + fn get_relative_price_pair( + base: CurrencyId, + quote: CurrencyId, + ) -> Result, sp_runtime::DispatchError> { + use frame_support::sp_runtime::traits::CheckedDiv; + let base_price = Self::get_price(base.clone())?; + let quote_price = Self::get_price(quote.clone())?; + let price = base_price + .checked_div("e_price) + .ok_or(module_prices::Error::::AccessPriceFailed)?; + Ok(pint_price_feed::AssetPricePair::new(base, quote, price)) + } +} + +/// Remote Asset manager that does nothing +pub struct MockRemoteAssetManager; +impl pint_primitives::traits::RemoteAssetManager for MockRemoteAssetManager { + fn transfer_asset(_: AccountId, _: CurrencyId, _: Balance) -> DispatchResult { + Ok(()) + } + + fn deposit(_: CurrencyId, _: Balance) {} + + fn announce_withdrawal(_: CurrencyId, _: Balance) {} +} + impl cumulus_pallet_aura_ext::Config for Runtime {} /// The address format for describing accounts. @@ -2034,6 +2153,12 @@ construct_runtime! { // Stable asset StableAsset: nutsfinance_stable_asset::{Pallet, Call, Storage, Event} = 200, + // PINT + AssetIndex: pint_asset_index::{Pallet, Call, Storage, Event} = 210, + Committee: pint_committee::{Pallet, Call, Storage, Origin, Event, Config} = 211, + LocalTreasury: pint_local_treasury::{Pallet, Call, Storage, Event} = 212, + SaftRegistry: pint_saft_registry::{Pallet, Call, Storage, Event} = 213, + // Dev Sudo: pallet_sudo::{Pallet, Call, Config, Storage, Event} = 255, } From 775b38bc5adeb09517577290a4d604a68aa5c8e4 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Tue, 31 Aug 2021 13:09:42 +0200 Subject: [PATCH 05/16] chore(deps): add pint pallets --- Cargo.lock | 255 ++++++++++++++++++++++++++++++++++++- Cargo.toml | 2 + runtime/mandala/Cargo.toml | 9 +- 3 files changed, 258 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7ea1e0933..dd8d8915e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4228,7 +4228,7 @@ dependencies = [ "orml-rewards", "orml-tokens", "orml-traits", - "orml-unknown-tokens", + "orml-unknown-tokens 0.4.1-dev", "orml-vesting", "orml-xcm", "orml-xcm-support", @@ -5144,24 +5144,29 @@ dependencies = [ "orml-rewards", "orml-tokens", "orml-traits", - "orml-unknown-tokens", + "orml-unknown-tokens 0.4.1-dev", "orml-vesting", "orml-xcm", "orml-xcm-support", "orml-xtokens", + "pallet-asset-index", "pallet-aura", "pallet-authorship", "pallet-balances", "pallet-bounties", "pallet-collective", + "pallet-committee", "pallet-democracy", "pallet-elections-phragmen", "pallet-indices", + "pallet-local-treasury", "pallet-membership", "pallet-multisig", "pallet-offences", + "pallet-price-feed", "pallet-proxy", "pallet-recovery", + "pallet-saft-registry", "pallet-scheduler", "pallet-session", "pallet-sudo", @@ -5175,6 +5180,7 @@ dependencies = [ "parachain-info", "parity-scale-codec", "polkadot-parachain", + "primitives", "runtime-common", "serde", "serde_json", @@ -6605,6 +6611,20 @@ dependencies = [ "xcm", ] +[[package]] +name = "orml-unknown-tokens" +version = "0.4.1-dev" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=master#5babe0b71cf60538ca23d41231f9558816c52ae9" +dependencies = [ + "frame-support", + "frame-system", + "orml-xcm-support", + "parity-scale-codec", + "serde", + "sp-std", + "xcm", +] + [[package]] name = "orml-utilities" version = "0.4.1-dev" @@ -6703,7 +6723,7 @@ dependencies = [ "xcm", "xcm-builder", "xcm-executor", - "xcm-simulator", + "xcm-simulator 0.9.9-1", ] [[package]] @@ -6721,6 +6741,45 @@ dependencies = [ "stable_deref_trait", ] +[[package]] +name = "pallet-asset-index" +version = "0.0.1" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "orml-tokens", + "orml-traits", + "pallet-balances", + "pallet-chainlink-feed", + "pallet-price-feed", + "pallet-saft-registry", + "parity-scale-codec", + "polkadot-parachain", + "primitives", + "rand 0.8.4", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "xcm", + "xcm-executor", +] + +[[package]] +name = "pallet-assets" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.9#91061a7d925b5bc597804293da283477512ba4ff" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-aura" version = "4.0.0-dev" @@ -6916,6 +6975,22 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-chainlink-feed" +version = "0.1.0" +source = "git+https://github.com/smartcontractkit/chainlink-polkadot?branch=polkadot-v0.9.8#124646ec14d25b9c6b5b3100c5422ebb53c804a0" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "serde", + "sp-arithmetic", + "sp-core", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-collective" version = "4.0.0-dev" @@ -6932,6 +7007,17 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-committee" +version = "0.0.1" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "sp-core", +] + [[package]] name = "pallet-democracy" version = "4.0.0-dev" @@ -7071,6 +7157,21 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-local-treasury" +version = "0.0.1" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "pallet-balances", + "parity-scale-codec", + "serde", + "sp-core", + "sp-io", + "sp-runtime", +] + [[package]] name = "pallet-membership" version = "4.0.0-dev" @@ -7203,6 +7304,24 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-price-feed" +version = "0.0.1" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "pallet-balances", + "pallet-chainlink-feed", + "pallet-timestamp", + "parity-scale-codec", + "primitives", + "serde", + "sp-core", + "sp-io", + "sp-runtime", +] + [[package]] name = "pallet-proxy" version = "4.0.0-dev" @@ -7232,6 +7351,78 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-remote-asset-manager" +version = "0.0.1" +dependencies = [ + "cumulus-pallet-dmp-queue", + "cumulus-pallet-parachain-system", + "cumulus-pallet-xcm", + "cumulus-pallet-xcmp-queue", + "cumulus-primitives-core", + "frame-benchmarking", + "frame-election-provider-support", + "frame-support", + "frame-system", + "log", + "orml-currencies", + "orml-tokens", + "orml-traits", + "orml-unknown-tokens 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?branch=master)", + "orml-xcm-support", + "orml-xtokens", + "pallet-asset-index", + "pallet-assets", + "pallet-balances", + "pallet-collective", + "pallet-price-feed", + "pallet-proxy", + "pallet-saft-registry", + "pallet-session", + "pallet-staking", + "pallet-staking-reward-curve", + "pallet-timestamp", + "pallet-xcm", + "parachain-info", + "parity-scale-codec", + "polkadot-parachain", + "polkadot-runtime-parachains", + "primitives", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-staking", + "sp-std", + "xcm", + "xcm-builder", + "xcm-calls", + "xcm-executor", + "xcm-simulator 0.1.0", +] + +[[package]] +name = "pallet-saft-registry" +version = "0.0.1" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "orml-tokens", + "orml-traits", + "pallet-asset-index", + "pallet-balances", + "pallet-price-feed", + "pallet-remote-asset-manager", + "parity-scale-codec", + "primitives", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "xcm", +] + [[package]] name = "pallet-scheduler" version = "4.0.0-dev" @@ -9017,6 +9208,17 @@ dependencies = [ "uint", ] +[[package]] +name = "primitives" +version = "0.0.1" +dependencies = [ + "frame-support", + "frame-system", + "parity-scale-codec", + "serde", + "xcm", +] + [[package]] name = "primitives-proc-macro" version = "1.3.1" @@ -9826,7 +10028,7 @@ dependencies = [ "orml-rewards", "orml-tokens", "orml-traits", - "orml-unknown-tokens", + "orml-unknown-tokens 0.4.1-dev", "orml-vesting", "orml-xcm", "orml-xcm-support", @@ -13311,8 +13513,8 @@ version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f559b464de2e2bdabcac6a210d12e9b5a5973c251e102c44c585c71d51bd78e" dependencies = [ - "cfg-if 0.1.10", - "rand 0.3.23", + "cfg-if 1.0.0", + "rand 0.8.4", "static_assertions", ] @@ -14111,6 +14313,28 @@ dependencies = [ "xcm-executor", ] +[[package]] +name = "xcm-calls" +version = "0.0.1" +dependencies = [ + "frame-election-provider-support", + "frame-support", + "frame-system", + "pallet-assets", + "pallet-balances", + "pallet-proxy", + "pallet-session", + "pallet-staking", + "pallet-staking-reward-curve", + "pallet-timestamp", + "parity-scale-codec", + "serde", + "sp-core", + "sp-runtime", + "sp-staking", + "xcm", +] + [[package]] name = "xcm-emulator" version = "0.1.0" @@ -14152,6 +14376,25 @@ dependencies = [ "xcm", ] +[[package]] +name = "xcm-simulator" +version = "0.1.0" +source = "git+https://github.com/shaunxw/xcm-simulator?branch=master#b6cf9973c8a81fb1a68036d1d8ef0c922f0e7551" +dependencies = [ + "cumulus-pallet-dmp-queue", + "cumulus-pallet-xcmp-queue", + "cumulus-primitives-core", + "frame-support", + "parity-scale-codec", + "paste", + "polkadot-parachain", + "polkadot-runtime-parachains", + "sp-io", + "sp-std", + "xcm", + "xcm-executor", +] + [[package]] name = "xcm-simulator" version = "0.9.9-1" diff --git a/Cargo.toml b/Cargo.toml index 8eb15e58e..05f2c4731 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,7 +50,9 @@ members = [ "ecosystem-modules/pint/pallets/asset-index", "ecosystem-modules/pint/pallets/committee", "ecosystem-modules/pint/pallets/local-treasury", + "ecosystem-modules/pint/pallets/price-feed", "ecosystem-modules/pint/pallets/saft-registry", + "ecosystem-modules/pint/primitives/primitives", ] resolver = "2" diff --git a/runtime/mandala/Cargo.toml b/runtime/mandala/Cargo.toml index 6982c7644..ce593b4f2 100644 --- a/runtime/mandala/Cargo.toml +++ b/runtime/mandala/Cargo.toml @@ -132,10 +132,12 @@ ecosystem-starport = { path = "../../ecosystem-modules/starport", default-featur ecosystem-compound-cash = { path = "../../ecosystem-modules/compound-cash", default-features = false } chainbridge = { git = "https://github.com/AcalaNetwork/chainbridge-substrate", default-features = false } -pint-committee = { path = "../../ecosystem-modules/pint/pallets/committee", package = "pallet-committee", default-features = false } -pint-saft-registry = { path = "../../ecosystem-modules/pint/pallets/saft-registry", package = "pallet-saft-registry", default-features = false } pint-asset-index = { path = "../../ecosystem-modules/pint/pallets/asset-index", package = "pallet-asset-index", default-features = false } +pint-committee = { path = "../../ecosystem-modules/pint/pallets/committee", package = "pallet-committee", default-features = false } pint-local-treasury = { path = "../../ecosystem-modules/pint/pallets/local-treasury", package = "pallet-local-treasury", default-features = false } +pint-price-feed = { path = "../../ecosystem-modules/pint/pallets/price-feed", package = "pallet-price-feed", default-features = false } +pint-saft-registry = { path = "../../ecosystem-modules/pint/pallets/saft-registry", package = "pallet-saft-registry", default-features = false } +pint-primitives = { path = "../../ecosystem-modules/pint/primitives/primitives", package = "primitives", default-features = false } [build-dependencies] substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.9" } @@ -276,6 +278,8 @@ std = [ "pint-saft-registry/std", "pint-asset-index/std", "pint-local-treasury/std", + "pint-primitives/std", + "pint-price-feed/std" ] runtime-benchmarks = [ "frame-benchmarking", @@ -303,6 +307,7 @@ runtime-benchmarks = [ "pint-saft-registry/runtime-benchmarks", "pint-asset-index/runtime-benchmarks", "pint-local-treasury/runtime-benchmarks", + "pint-price-feed/runtime-benchmarks" ] # When enabled, the runtime api will not be build. # From 2597c043800fc50cc0f2024f2865106cf6a3bb0a Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Tue, 31 Aug 2021 13:10:27 +0200 Subject: [PATCH 06/16] feat: add PINT tokensymbol --- primitives/src/currency.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/primitives/src/currency.rs b/primitives/src/currency.rs index 7d9337051..4ab8043af 100644 --- a/primitives/src/currency.rs +++ b/primitives/src/currency.rs @@ -199,6 +199,7 @@ create_currency_id! { // 149: Reserved for renBTC // 150: Reserved for CASH // 168 - 255: Kusama parachain tokens + PINT("PINT", 12) = 151, } } From 9b3b561fdf4902bf1e8d15d2f3004bc704b93a04 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Tue, 31 Aug 2021 14:28:04 +0200 Subject: [PATCH 07/16] chore: update pint --- ecosystem-modules/pint | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ecosystem-modules/pint b/ecosystem-modules/pint index bb27364eb..8f0a83eb2 160000 --- a/ecosystem-modules/pint +++ b/ecosystem-modules/pint @@ -1 +1 @@ -Subproject commit bb27364ebe9cc7021860630aa7502e80bc6b7999 +Subproject commit 8f0a83eb28e9299f0f767798c6a4915f4552dae3 From 0512dceb62e0e6e84e2488c08423fc9e922d8268 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Tue, 31 Aug 2021 15:54:37 +0200 Subject: [PATCH 08/16] chore: update pint ecosystem --- ecosystem-modules/pint | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ecosystem-modules/pint b/ecosystem-modules/pint index 8f0a83eb2..930178a73 160000 --- a/ecosystem-modules/pint +++ b/ecosystem-modules/pint @@ -1 +1 @@ -Subproject commit 8f0a83eb28e9299f0f767798c6a4915f4552dae3 +Subproject commit 930178a732dd20080a3f66da7e5f2493cc64ff1c From 5213cc0f40dd0b6eee7e68631e4abac1825abd13 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Tue, 31 Aug 2021 17:19:57 +0200 Subject: [PATCH 09/16] chore: update pint submodule --- ecosystem-modules/pint | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ecosystem-modules/pint b/ecosystem-modules/pint index 930178a73..2e09a20c0 160000 --- a/ecosystem-modules/pint +++ b/ecosystem-modules/pint @@ -1 +1 @@ -Subproject commit 930178a732dd20080a3f66da7e5f2493cc64ff1c +Subproject commit 2e09a20c00152402a5372a57a4a220f2e73a9c51 From e830558e9231d0ef834bf1932e6c2c5759325993 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Tue, 31 Aug 2021 20:11:17 +0200 Subject: [PATCH 10/16] chore: exclude pint workspace --- Cargo.lock | 153 ++--------------------------------------------------- Cargo.toml | 10 ++-- 2 files changed, 7 insertions(+), 156 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dd8d8915e..d61213959 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4228,7 +4228,7 @@ dependencies = [ "orml-rewards", "orml-tokens", "orml-traits", - "orml-unknown-tokens 0.4.1-dev", + "orml-unknown-tokens", "orml-vesting", "orml-xcm", "orml-xcm-support", @@ -5144,7 +5144,7 @@ dependencies = [ "orml-rewards", "orml-tokens", "orml-traits", - "orml-unknown-tokens 0.4.1-dev", + "orml-unknown-tokens", "orml-vesting", "orml-xcm", "orml-xcm-support", @@ -6611,20 +6611,6 @@ dependencies = [ "xcm", ] -[[package]] -name = "orml-unknown-tokens" -version = "0.4.1-dev" -source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=master#5babe0b71cf60538ca23d41231f9558816c52ae9" -dependencies = [ - "frame-support", - "frame-system", - "orml-xcm-support", - "parity-scale-codec", - "serde", - "sp-std", - "xcm", -] - [[package]] name = "orml-utilities" version = "0.4.1-dev" @@ -6723,7 +6709,7 @@ dependencies = [ "xcm", "xcm-builder", "xcm-executor", - "xcm-simulator 0.9.9-1", + "xcm-simulator", ] [[package]] @@ -6748,38 +6734,18 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "orml-tokens", "orml-traits", - "pallet-balances", "pallet-chainlink-feed", "pallet-price-feed", - "pallet-saft-registry", "parity-scale-codec", "polkadot-parachain", "primitives", - "rand 0.8.4", "serde", "sp-core", - "sp-io", - "sp-runtime", - "sp-std", "xcm", "xcm-executor", ] -[[package]] -name = "pallet-assets" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.9#91061a7d925b5bc597804293da283477512ba4ff" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "parity-scale-codec", - "sp-runtime", - "sp-std", -] - [[package]] name = "pallet-aura" version = "4.0.0-dev" @@ -7015,7 +6981,6 @@ dependencies = [ "frame-support", "frame-system", "parity-scale-codec", - "sp-core", ] [[package]] @@ -7164,12 +7129,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "pallet-balances", "parity-scale-codec", - "serde", - "sp-core", - "sp-io", - "sp-runtime", ] [[package]] @@ -7311,15 +7271,10 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "pallet-balances", "pallet-chainlink-feed", - "pallet-timestamp", "parity-scale-codec", "primitives", "serde", - "sp-core", - "sp-io", - "sp-runtime", ] [[package]] @@ -7351,56 +7306,6 @@ dependencies = [ "sp-std", ] -[[package]] -name = "pallet-remote-asset-manager" -version = "0.0.1" -dependencies = [ - "cumulus-pallet-dmp-queue", - "cumulus-pallet-parachain-system", - "cumulus-pallet-xcm", - "cumulus-pallet-xcmp-queue", - "cumulus-primitives-core", - "frame-benchmarking", - "frame-election-provider-support", - "frame-support", - "frame-system", - "log", - "orml-currencies", - "orml-tokens", - "orml-traits", - "orml-unknown-tokens 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?branch=master)", - "orml-xcm-support", - "orml-xtokens", - "pallet-asset-index", - "pallet-assets", - "pallet-balances", - "pallet-collective", - "pallet-price-feed", - "pallet-proxy", - "pallet-saft-registry", - "pallet-session", - "pallet-staking", - "pallet-staking-reward-curve", - "pallet-timestamp", - "pallet-xcm", - "parachain-info", - "parity-scale-codec", - "polkadot-parachain", - "polkadot-runtime-parachains", - "primitives", - "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-staking", - "sp-std", - "xcm", - "xcm-builder", - "xcm-calls", - "xcm-executor", - "xcm-simulator 0.1.0", -] - [[package]] name = "pallet-saft-registry" version = "0.0.1" @@ -7408,18 +7313,9 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "orml-tokens", - "orml-traits", "pallet-asset-index", - "pallet-balances", - "pallet-price-feed", - "pallet-remote-asset-manager", "parity-scale-codec", "primitives", - "serde", - "sp-core", - "sp-io", - "sp-runtime", "xcm", ] @@ -10028,7 +9924,7 @@ dependencies = [ "orml-rewards", "orml-tokens", "orml-traits", - "orml-unknown-tokens 0.4.1-dev", + "orml-unknown-tokens", "orml-vesting", "orml-xcm", "orml-xcm-support", @@ -14313,28 +14209,6 @@ dependencies = [ "xcm-executor", ] -[[package]] -name = "xcm-calls" -version = "0.0.1" -dependencies = [ - "frame-election-provider-support", - "frame-support", - "frame-system", - "pallet-assets", - "pallet-balances", - "pallet-proxy", - "pallet-session", - "pallet-staking", - "pallet-staking-reward-curve", - "pallet-timestamp", - "parity-scale-codec", - "serde", - "sp-core", - "sp-runtime", - "sp-staking", - "xcm", -] - [[package]] name = "xcm-emulator" version = "0.1.0" @@ -14376,25 +14250,6 @@ dependencies = [ "xcm", ] -[[package]] -name = "xcm-simulator" -version = "0.1.0" -source = "git+https://github.com/shaunxw/xcm-simulator?branch=master#b6cf9973c8a81fb1a68036d1d8ef0c922f0e7551" -dependencies = [ - "cumulus-pallet-dmp-queue", - "cumulus-pallet-xcmp-queue", - "cumulus-primitives-core", - "frame-support", - "parity-scale-codec", - "paste", - "polkadot-parachain", - "polkadot-runtime-parachains", - "sp-io", - "sp-std", - "xcm", - "xcm-executor", -] - [[package]] name = "xcm-simulator" version = "0.9.9-1" diff --git a/Cargo.toml b/Cargo.toml index 05f2c4731..a36784d18 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,13 +46,9 @@ members = [ "ecosystem-modules/starport", "ecosystem-modules/compound-cash", "ecosystem-modules/stable-asset/lib/stable-asset", - - "ecosystem-modules/pint/pallets/asset-index", - "ecosystem-modules/pint/pallets/committee", - "ecosystem-modules/pint/pallets/local-treasury", - "ecosystem-modules/pint/pallets/price-feed", - "ecosystem-modules/pint/pallets/saft-registry", - "ecosystem-modules/pint/primitives/primitives", +] +exclude = [ + "ecosystem-modules/pint" ] resolver = "2" From c7145ca708e95496058c20d78178e50e602e0cf1 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Mon, 6 Sep 2021 17:13:21 +0200 Subject: [PATCH 11/16] chore: upgrade workspace --- ecosystem-modules/pint | 2 +- runtime/mandala/Cargo.toml | 3 ++- runtime/mandala/src/lib.rs | 17 +++++++++++++++-- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/ecosystem-modules/pint b/ecosystem-modules/pint index 2e09a20c0..56ade5c7c 160000 --- a/ecosystem-modules/pint +++ b/ecosystem-modules/pint @@ -1 +1 @@ -Subproject commit 2e09a20c00152402a5372a57a4a220f2e73a9c51 +Subproject commit 56ade5c7c014a414d5f577e084a8c43de9d3d981 diff --git a/runtime/mandala/Cargo.toml b/runtime/mandala/Cargo.toml index ce593b4f2..ba336bdc5 100644 --- a/runtime/mandala/Cargo.toml +++ b/runtime/mandala/Cargo.toml @@ -307,7 +307,8 @@ runtime-benchmarks = [ "pint-saft-registry/runtime-benchmarks", "pint-asset-index/runtime-benchmarks", "pint-local-treasury/runtime-benchmarks", - "pint-price-feed/runtime-benchmarks" + "pint-price-feed/runtime-benchmarks", + "pint-primitives/runtime-benchmarks" ] # When enabled, the runtime api will not be build. # diff --git a/runtime/mandala/src/lib.rs b/runtime/mandala/src/lib.rs index fe0fe02d8..7916ed65c 100644 --- a/runtime/mandala/src/lib.rs +++ b/runtime/mandala/src/lib.rs @@ -1890,6 +1890,17 @@ impl nutsfinance_stable_asset::Config for Runtime { } // PINT pallet implementations + +// This is required in order to make `CurrencyId` usable within PINT's runtime-benchmarks +#[cfg(feature = "runtime-benchmarks")] +impl pint_primitives::traits::MaybeAssetIdConvert for Runtime { + + fn try_convert(value: u8) -> Option { + use sp_std::convert::TryFrom; + TokenSymbol::try_from(value).ok().map(CurrencyId::Token) + } +} + parameter_types! { pub const MinCouncilVotes: usize = 4; pub const ProposalSubmissionPeriod: BlockNumber = 10 * MINUTES; @@ -1905,8 +1916,8 @@ parameter_types! { type EnsureApprovedByCommittee = frame_system::EnsureOneOf< AccountId, - frame_system::EnsureRoot, pint_committee::EnsureApprovedByCommittee, + frame_system::EnsureRoot, >; impl pint_saft_registry::Config for Runtime { @@ -1944,7 +1955,7 @@ impl pint_committee::Config for Runtime { impl pint_asset_index::Config for Runtime { // Using signed as the admin origin for testing now - type AdminOrigin = frame_system::EnsureSigned; + type AdminOrigin = EnsureApprovedByCommittee; type IndexToken = Balances; type Balance = Balance; type LockupPeriod = LockupPeriod; @@ -1957,6 +1968,8 @@ impl pint_asset_index::Config for Runtime { type SelfAssetId = PINTAssetId; type Currency = Currencies; type PriceFeed = AggregatedDataProvider; + // #[cfg(feature = "runtime-benchmarks")] + // type PriceFeedBenchmarks = PriceFeed; type SaftRegistry = SaftRegistry; type BaseWithdrawalFee = BaseWithdrawalFee; type TreasuryPalletId = TreasuryPalletId; From 4a6bfbd8cb0d8ad807be22d2bb425422262b4037 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Thu, 9 Sep 2021 12:22:03 +0200 Subject: [PATCH 12/16] chore: update pint --- ecosystem-modules/pint | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ecosystem-modules/pint b/ecosystem-modules/pint index 56ade5c7c..da08ef80b 160000 --- a/ecosystem-modules/pint +++ b/ecosystem-modules/pint @@ -1 +1 @@ -Subproject commit 56ade5c7c014a414d5f577e084a8c43de9d3d981 +Subproject commit da08ef80ba02169780a6f09a7a701475ea45c093 From 38145a437efc54890e673c8d8627e4cabe6d1c16 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Wed, 15 Sep 2021 13:35:10 +0200 Subject: [PATCH 13/16] feat: add PINT token --- primitives/src/currency.rs | 1 + runtime/karura/src/lib.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/primitives/src/currency.rs b/primitives/src/currency.rs index 68e7112f6..8b47050cf 100644 --- a/primitives/src/currency.rs +++ b/primitives/src/currency.rs @@ -200,6 +200,7 @@ create_currency_id! { // 150: Reserved for CASH // 168 - 255: Kusama parachain tokens BNC("Bifrost Native Token", 12) = 168, + PINT("PINT", 12) = 169, } } diff --git a/runtime/karura/src/lib.rs b/runtime/karura/src/lib.rs index aea66d6e6..547c1beb9 100644 --- a/runtime/karura/src/lib.rs +++ b/runtime/karura/src/lib.rs @@ -744,6 +744,7 @@ parameter_type_with_key! { TokenSymbol::LDOT | TokenSymbol::RENBTC | TokenSymbol::KAR | + TokenSymbol::PINT | TokenSymbol::CASH => Balance::max_value() // unsupported }, CurrencyId::DexShare(dex_share_0, _) => { From 8bcc1d52b301fc4eb90c80d995d2fa172645a107 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Wed, 15 Sep 2021 13:35:30 +0200 Subject: [PATCH 14/16] feat: finish PINT integration --- node/service/src/chain_spec/mandala.rs | 28 ++++++++++----- runtime/mandala/src/lib.rs | 48 ++++++++++++++++---------- 2 files changed, 50 insertions(+), 26 deletions(-) diff --git a/node/service/src/chain_spec/mandala.rs b/node/service/src/chain_spec/mandala.rs index 1f7abfd9a..d962c9dc6 100644 --- a/node/service/src/chain_spec/mandala.rs +++ b/node/service/src/chain_spec/mandala.rs @@ -237,9 +237,9 @@ fn testnet_genesis( CollatorSelectionConfig, DexConfig, EVMConfig, EnabledTradingPairs, FinancialCouncilMembershipConfig, GeneralCouncilMembershipConfig, HomaCouncilMembershipConfig, IndicesConfig, NativeTokenExistentialDeposit, OperatorMembershipAcalaConfig, OperatorMembershipBandConfig, OrmlNFTConfig, ParachainInfoConfig, Period, - RenVmBridgeConfig, SessionConfig, SessionKeys, SessionManagerConfig, StakingPoolConfig, StarportConfig, - SudoConfig, SystemConfig, TechnicalCommitteeMembershipConfig, TokensConfig, VestingConfig, ACA, AUSD, DOT, - LDOT, RENBTC, + PintCommitteeConfig, RenVmBridgeConfig, SessionConfig, SessionKeys, SessionManagerConfig, StakingPoolConfig, + StarportConfig, SudoConfig, SystemConfig, TechnicalCommitteeMembershipConfig, TokensConfig, VestingConfig, ACA, + AUSD, DOT, LDOT, RENBTC, }; let existential_deposit = NativeTokenExistentialDeposit::get(); @@ -366,7 +366,7 @@ fn testnet_genesis( }, evm: EVMConfig { accounts: evm_genesis_accounts, - treasury: root_key, + treasury: root_key.clone(), }, staking_pool: StakingPoolConfig { staking_pool_params: module_staking_pool::Params { @@ -430,6 +430,12 @@ fn testnet_genesis( aura: Default::default(), aura_ext: Default::default(), parachain_system: Default::default(), + + // pint configs + pint_committee: PintCommitteeConfig { + council_members: vec![root_key], + ..Default::default() + }, } } @@ -444,9 +450,9 @@ fn mandala_genesis( CdpEngineConfig, CdpTreasuryConfig, CollatorSelectionConfig, DexConfig, EVMConfig, EnabledTradingPairs, FinancialCouncilMembershipConfig, GeneralCouncilMembershipConfig, HomaCouncilMembershipConfig, IndicesConfig, NativeTokenExistentialDeposit, OperatorMembershipAcalaConfig, OperatorMembershipBandConfig, OrmlNFTConfig, - ParachainInfoConfig, Period, RenVmBridgeConfig, SessionConfig, SessionKeys, SessionManagerConfig, - StakingPoolConfig, StarportConfig, SudoConfig, SystemConfig, TechnicalCommitteeMembershipConfig, TokensConfig, - VestingConfig, ACA, AUSD, DOT, LDOT, RENBTC, + ParachainInfoConfig, Period, PintCommitteeConfig, RenVmBridgeConfig, SessionConfig, SessionKeys, + SessionManagerConfig, StakingPoolConfig, StarportConfig, SudoConfig, SystemConfig, + TechnicalCommitteeMembershipConfig, TokensConfig, VestingConfig, ACA, AUSD, DOT, LDOT, RENBTC, }; let existential_deposit = NativeTokenExistentialDeposit::get(); @@ -578,7 +584,7 @@ fn mandala_genesis( }, evm: EVMConfig { accounts: evm_genesis_accounts, - treasury: root_key, + treasury: root_key.clone(), }, staking_pool: StakingPoolConfig { staking_pool_params: module_staking_pool::Params { @@ -659,5 +665,11 @@ fn mandala_genesis( aura: Default::default(), aura_ext: Default::default(), parachain_system: Default::default(), + + // pint configs + pint_committee: PintCommitteeConfig { + council_members: vec![root_key], + ..Default::default() + }, } } diff --git a/runtime/mandala/src/lib.rs b/runtime/mandala/src/lib.rs index 23b93e0d0..2217601c8 100644 --- a/runtime/mandala/src/lib.rs +++ b/runtime/mandala/src/lib.rs @@ -1894,37 +1894,49 @@ impl nutsfinance_stable_asset::Config for Runtime { // This is required in order to make `CurrencyId` usable within PINT's runtime-benchmarks #[cfg(feature = "runtime-benchmarks")] -impl pint_primitives::traits::MaybeAssetIdConvert for Runtime { - +impl pint_primitives::MaybeAssetIdConvert for Runtime { fn try_convert(value: u8) -> Option { use sp_std::convert::TryFrom; + // only use `CurrencyId::Token` TokenSymbol::try_from(value).ok().map(CurrencyId::Token) } } +// This is currently required to satisfy PINT's chainlink dependency for benchmarks +#[cfg(feature = "runtime-benchmarks")] +struct PriceFeedBenchmarks; +#[cfg(feature = "runtime-benchmarks")] +impl pint_price_feed::traits::PriceFeedBenchmarks for PriceFeedBenchmarks { + fn create_feed(_: AccountId, _: CurrencyId) -> frame_support::dispatch::DispatchResultWithPostInfo { + Ok(().into()) + } +} + parameter_types! { - pub const MinCouncilVotes: usize = 4; + pub const MinCouncilVotes: usize = 1; pub const ProposalSubmissionPeriod: BlockNumber = 10 * MINUTES; pub const MinimumRedemption: u32 = 0; pub const WithdrawalPeriod: BlockNumber = 10 * MINUTES; pub const LockupPeriod: BlockNumber = 5 * MINUTES; - pub DOTContributionLimit: Balance = 100_000 * dollar(CurrencyId::Token(TokenSymbol::DOT)); pub const IndexTokenLockIdentifier: LockIdentifier = *b"pint/lck"; pub const BaseWithdrawalFee: pint_primitives::fee::FeeRate = pint_primitives::fee::FeeRate{ numerator: 3, denominator: 1_000,}; pub const AssetIndexStringLimit: u32 = 50; pub const PINTAssetId: CurrencyId = CurrencyId::Token(TokenSymbol::PINT); + pub const MaxActiveDeposits: u32 = 50; + pub const MaxDecimals: u8 = 18; } -type EnsureApprovedByCommittee = frame_system::EnsureOneOf< +type PintGovernanceOrigin = frame_system::EnsureOneOf< AccountId, pint_committee::EnsureApprovedByCommittee, frame_system::EnsureRoot, >; impl pint_saft_registry::Config for Runtime { - // Using signed as the admin origin for now - type AdminOrigin = frame_system::EnsureSigned; + type AdminOrigin = pint_committee::EnsureApprovedByCommittee; type AssetRecorder = AssetIndex; + #[cfg(feature = "runtime-benchmarks")] + type AssetRecorderBenchmarks = AssetIndex; type Balance = Balance; type AssetId = CurrencyId; type Event = Event; @@ -1932,8 +1944,7 @@ impl pint_saft_registry::Config for Runtime { } impl pint_local_treasury::Config for Runtime { - // Using root as the admin origin for now - type AdminOrigin = frame_system::EnsureRoot; + type AdminOrigin = pint_committee::EnsureApprovedByCommittee; type PalletId = TreasuryPalletId; type Currency = Balances; type Event = Event; @@ -1947,30 +1958,31 @@ impl pint_committee::Config for Runtime { type ProposalSubmissionPeriod = ProposalSubmissionPeriod; type VotingPeriod = VotingPeriod; type MinCouncilVotes = MinCouncilVotes; - type ProposalSubmissionOrigin = frame_system::EnsureSigned; + type ProposalSubmissionOrigin = pint_committee::EnsureMember; type ProposalExecutionOrigin = pint_committee::EnsureMember; - type ApprovedByCommitteeOrigin = EnsureApprovedByCommittee; + type ApprovedByCommitteeOrigin = PintGovernanceOrigin; type Event = Event; type WeightInfo = (); } impl pint_asset_index::Config for Runtime { - // Using signed as the admin origin for testing now - type AdminOrigin = EnsureApprovedByCommittee; + type AdminOrigin = pint_committee::EnsureApprovedByCommittee; type IndexToken = Balances; type Balance = Balance; + type MaxActiveDeposits = MaxActiveDeposits; + type MaxDecimals = MaxDecimals; + type RedemptionFee = (); type LockupPeriod = LockupPeriod; type IndexTokenLockIdentifier = IndexTokenLockIdentifier; type MinimumRedemption = MinimumRedemption; type WithdrawalPeriod = WithdrawalPeriod; - type DOTContributionLimit = DOTContributionLimit; type RemoteAssetManager = MockRemoteAssetManager; type AssetId = CurrencyId; type SelfAssetId = PINTAssetId; type Currency = Currencies; type PriceFeed = AggregatedDataProvider; - // #[cfg(feature = "runtime-benchmarks")] - // type PriceFeedBenchmarks = PriceFeed; + #[cfg(feature = "runtime-benchmarks")] + type PriceFeedBenchmarks = PriceFeedBenchmarks; type SaftRegistry = SaftRegistry; type BaseWithdrawalFee = BaseWithdrawalFee; type TreasuryPalletId = TreasuryPalletId; @@ -2169,8 +2181,8 @@ construct_runtime! { // PINT AssetIndex: pint_asset_index::{Pallet, Call, Storage, Event} = 210, - Committee: pint_committee::{Pallet, Call, Storage, Origin, Event, Config} = 211, - LocalTreasury: pint_local_treasury::{Pallet, Call, Storage, Event} = 212, + PintCommittee: pint_committee::{Pallet, Call, Storage, Origin, Event, Config} = 211, + PintLocalTreasury: pint_local_treasury::{Pallet, Call, Storage, Event} = 212, SaftRegistry: pint_saft_registry::{Pallet, Call, Storage, Event} = 213, // Dev From ae8527d34a4c31de9231ad4d9de3d06e1af20d5c Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Wed, 15 Sep 2021 13:35:57 +0200 Subject: [PATCH 15/16] chore: update PINT --- Cargo.lock | 7 ++++--- Cargo.toml | 4 ++-- ecosystem-modules/pint | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4634d3b45..ab8e447d8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6945,7 +6945,7 @@ dependencies = [ [[package]] name = "pallet-chainlink-feed" version = "0.1.0" -source = "git+https://github.com/smartcontractkit/chainlink-polkadot?branch=polkadot-v0.9.8#124646ec14d25b9c6b5b3100c5422ebb53c804a0" +source = "git+https://github.com/smartcontractkit/chainlink-polkadot?branch=polkadot-v0.9.9#79107694e226c94301d3479f3f96a88892f917f2" dependencies = [ "frame-benchmarking", "frame-support", @@ -6981,6 +6981,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "log", "parity-scale-codec", ] @@ -13410,8 +13411,8 @@ version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f559b464de2e2bdabcac6a210d12e9b5a5973c251e102c44c585c71d51bd78e" dependencies = [ - "cfg-if 1.0.0", - "rand 0.8.4", + "cfg-if 0.1.10", + "rand 0.3.23", "static_assertions", ] diff --git a/Cargo.toml b/Cargo.toml index a36784d18..8dc8c57fc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,7 @@ members = [ "orml/nft", "orml/oracle", "orml/oracle/rpc", - "orml/oracle/rpc/runtime-api", + "orml/oracle/rpc/runtime-api", "orml/rewards", "orml/tokens", "orml/traits", @@ -309,4 +309,4 @@ orml-currencies = { path = "./orml/currencies" } orml-tokens = { path = "./orml/tokens" } orml-xtokens = { path = "./orml/xtokens" } orml-xcm-support = { path = "./orml/xcm-support" } -orml-traits = { path = "./orml/traits" } \ No newline at end of file +orml-traits = { path = "./orml/traits" } diff --git a/ecosystem-modules/pint b/ecosystem-modules/pint index da08ef80b..c7b3162a2 160000 --- a/ecosystem-modules/pint +++ b/ecosystem-modules/pint @@ -1 +1 @@ -Subproject commit da08ef80ba02169780a6f09a7a701475ea45c093 +Subproject commit c7b3162a2633cb33d7cda56d90a72b033fd88096 From 35b73f9afdc4da1f81fa00c936e5862c1dcff635 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Wed, 15 Sep 2021 13:59:11 +0200 Subject: [PATCH 16/16] chore: update PINT --- ecosystem-modules/pint | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ecosystem-modules/pint b/ecosystem-modules/pint index c7b3162a2..40d4eec2b 160000 --- a/ecosystem-modules/pint +++ b/ecosystem-modules/pint @@ -1 +1 @@ -Subproject commit c7b3162a2633cb33d7cda56d90a72b033fd88096 +Subproject commit 40d4eec2b3a8f580631d82e1664a5c2411666964