From a3016924b537a4965c10b2a4f6559cb39d22dc0c Mon Sep 17 00:00:00 2001 From: Muhammad-Jibril Date: Sun, 20 Jun 2021 07:51:57 +0800 Subject: [PATCH 1/8] Add FiatCurrencyIds and make sure they are NON_TRANSFERRABLE_CURRENCIES for safety --- lib-serml/currencies/src/lib.rs | 90 +++++++++++++++++++++++++++++++++ lib-serml/prices/src/lib.rs | 12 +++++ lib-serml/prices/src/mock.rs | 20 ++++---- primitives/src/currency.rs | 90 +++++++++++++++++++++++++++++++-- 4 files changed, 198 insertions(+), 14 deletions(-) diff --git a/lib-serml/currencies/src/lib.rs b/lib-serml/currencies/src/lib.rs index 1c5be01b6..bbd86327d 100644 --- a/lib-serml/currencies/src/lib.rs +++ b/lib-serml/currencies/src/lib.rs @@ -91,6 +91,8 @@ pub mod module { AmountIntoBalanceFailed, /// Balance is too low. BalanceTooLow, + /// Invalid Currency Type. + InvalidCurrencyType, } #[pallet::event] @@ -127,6 +129,10 @@ pub mod module { ) -> DispatchResultWithPostInfo { let from = ensure_signed(origin)?; let to = T::Lookup::lookup(dest)?; + ensure!( + !T::FiatCurrencyIds::get().contains(¤cy_id), + Error::::InvalidCurrencyType, + ); >::transfer(currency_id, &from, &to, amount)?; Ok(().into()) } @@ -161,6 +167,10 @@ pub mod module { ) -> DispatchResultWithPostInfo { ensure_root(origin)?; let dest = T::Lookup::lookup(who)?; + ensure!( + !T::FiatCurrencyIds::get().contains(¤cy_id), + Error::::InvalidCurrencyType, + ); >::update_balance(currency_id, &dest, amount)?; Ok(().into()) } @@ -175,6 +185,10 @@ impl MultiCurrency for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::minimum_balance() } else { + ensure!( + !T::FiatCurrencyIds::get().contains(¤cy_id), + Error::::InvalidCurrencyType, + ); T::MultiCurrency::minimum_balance(currency_id) } } @@ -183,6 +197,10 @@ impl MultiCurrency for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::total_issuance() } else { + ensure!( + !T::FiatCurrencyIds::get().contains(¤cy_id), + Error::::InvalidCurrencyType, + ); T::MultiCurrency::total_issuance(currency_id) } } @@ -191,6 +209,10 @@ impl MultiCurrency for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::total_balance(who) } else { + ensure!( + !T::FiatCurrencyIds::get().contains(¤cy_id), + Error::::InvalidCurrencyType, + ); T::MultiCurrency::total_balance(currency_id, who) } } @@ -199,6 +221,10 @@ impl MultiCurrency for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::free_balance(who) } else { + ensure!( + !T::FiatCurrencyIds::get().contains(¤cy_id), + Error::::InvalidCurrencyType, + ); T::MultiCurrency::free_balance(currency_id, who) } } @@ -207,6 +233,10 @@ impl MultiCurrency for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::ensure_can_withdraw(who, amount) } else { + ensure!( + !T::FiatCurrencyIds::get().contains(¤cy_id), + Error::::InvalidCurrencyType, + ); T::MultiCurrency::ensure_can_withdraw(currency_id, who, amount) } } @@ -223,6 +253,10 @@ impl MultiCurrency for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::transfer(from, to, amount)?; } else { + ensure!( + !T::FiatCurrencyIds::get().contains(¤cy_id), + Error::::InvalidCurrencyType, + ); T::MultiCurrency::transfer(currency_id, from, to, amount)?; } Self::deposit_event(Event::Transferred(currency_id, from.clone(), to.clone(), amount)); @@ -236,6 +270,10 @@ impl MultiCurrency for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::deposit(who, amount)?; } else { + ensure!( + !T::FiatCurrencyIds::get().contains(¤cy_id), + Error::::InvalidCurrencyType, + ); T::MultiCurrency::deposit(currency_id, who, amount)?; } Self::deposit_event(Event::Deposited(currency_id, who.clone(), amount)); @@ -249,6 +287,10 @@ impl MultiCurrency for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::withdraw(who, amount)?; } else { + ensure!( + !T::FiatCurrencyIds::get().contains(¤cy_id), + Error::::InvalidCurrencyType, + ); T::MultiCurrency::withdraw(currency_id, who, amount)?; } Self::deposit_event(Event::Withdrawn(currency_id, who.clone(), amount)); @@ -259,6 +301,10 @@ impl MultiCurrency for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::can_slash(who, amount) } else { + ensure!( + !T::FiatCurrencyIds::get().contains(¤cy_id), + Error::::InvalidCurrencyType, + ); T::MultiCurrency::can_slash(currency_id, who, amount) } } @@ -267,6 +313,10 @@ impl MultiCurrency for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::slash(who, amount) } else { + ensure!( + !T::FiatCurrencyIds::get().contains(¤cy_id), + Error::::InvalidCurrencyType, + ); T::MultiCurrency::slash(currency_id, who, amount) } } @@ -279,6 +329,10 @@ impl MultiCurrencyExtended for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::update_balance(who, by_amount)?; } else { + ensure!( + !T::FiatCurrencyIds::get().contains(¤cy_id), + Error::::InvalidCurrencyType, + ); T::MultiCurrency::update_balance(currency_id, who, by_amount)?; } Self::deposit_event(Event::BalanceUpdated(currency_id, who.clone(), by_amount)); @@ -298,6 +352,10 @@ impl MultiLockableCurrency for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::set_lock(lock_id, who, amount) } else { + ensure!( + !T::FiatCurrencyIds::get().contains(¤cy_id), + Error::::InvalidCurrencyType, + ); T::MultiCurrency::set_lock(lock_id, currency_id, who, amount) } } @@ -311,6 +369,10 @@ impl MultiLockableCurrency for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::extend_lock(lock_id, who, amount) } else { + ensure!( + !T::FiatCurrencyIds::get().contains(¤cy_id), + Error::::InvalidCurrencyType, + ); T::MultiCurrency::extend_lock(lock_id, currency_id, who, amount) } } @@ -319,6 +381,10 @@ impl MultiLockableCurrency for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::remove_lock(lock_id, who) } else { + ensure!( + !T::FiatCurrencyIds::get().contains(¤cy_id), + Error::::InvalidCurrencyType, + ); T::MultiCurrency::remove_lock(lock_id, currency_id, who) } } @@ -329,6 +395,10 @@ impl MultiReservableCurrency for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::can_reserve(who, value) } else { + ensure!( + !T::FiatCurrencyIds::get().contains(¤cy_id), + Error::::InvalidCurrencyType, + ); T::MultiCurrency::can_reserve(currency_id, who, value) } } @@ -337,6 +407,10 @@ impl MultiReservableCurrency for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::slash_reserved(who, value) } else { + ensure!( + !T::FiatCurrencyIds::get().contains(¤cy_id), + Error::::InvalidCurrencyType, + ); T::MultiCurrency::slash_reserved(currency_id, who, value) } } @@ -345,6 +419,10 @@ impl MultiReservableCurrency for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::reserved_balance(who) } else { + ensure!( + !T::FiatCurrencyIds::get().contains(¤cy_id), + Error::::InvalidCurrencyType, + ); T::MultiCurrency::reserved_balance(currency_id, who) } } @@ -353,6 +431,10 @@ impl MultiReservableCurrency for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::reserve(who, value) } else { + ensure!( + !T::FiatCurrencyIds::get().contains(¤cy_id), + Error::::InvalidCurrencyType, + ); T::MultiCurrency::reserve(currency_id, who, value) } } @@ -361,6 +443,10 @@ impl MultiReservableCurrency for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::unreserve(who, value) } else { + ensure!( + !T::FiatCurrencyIds::get().contains(¤cy_id), + Error::::InvalidCurrencyType, + ); T::MultiCurrency::unreserve(currency_id, who, value) } } @@ -375,6 +461,10 @@ impl MultiReservableCurrency for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::repatriate_reserved(slashed, beneficiary, value, status) } else { + ensure!( + !T::FiatCurrencyIds::get().contains(¤cy_id), + Error::::InvalidCurrencyType, + ); T::MultiCurrency::repatriate_reserved(currency_id, slashed, beneficiary, value, status) } } diff --git a/lib-serml/prices/src/lib.rs b/lib-serml/prices/src/lib.rs index c9fb53646..fc2adf04b 100644 --- a/lib-serml/prices/src/lib.rs +++ b/lib-serml/prices/src/lib.rs @@ -210,6 +210,10 @@ impl PriceProvider for Pallet { Error::::InvalidStableCurrencyType, ); let fiat_id = Self::get_peg_currency_by_currency_id(¤cy_id); + ensure!( + T::FiatCurrencyIds::get().contains(&fiat_id), + Error::::InvalidFiatCurrencyType, + ); ensure!( T::PegCurrencyIds::get(¤cy_id) == &fiat_id, Error::::InvalidPegPair, @@ -230,6 +234,10 @@ impl PriceProvider for Pallet { Error::::InvalidStableCurrencyType, ); let fiat_id = Self::get_peg_currency_by_currency_id(¤cy_id); + ensure!( + T::FiatCurrencyIds::get().contains(&fiat_id), + Error::::InvalidFiatCurrencyType, + ); Self::get_fiat_price(¤cy_id) } @@ -277,6 +285,10 @@ impl PriceProvider for Pallet { Error::::InvalidStableCurrencyType, ); let fiat_id = Self::get_peg_currency_by_currency_id(¤cy_id); + ensure!( + T::FiatCurrencyIds::get().contains(&fiat_id), + Error::::InvalidFiatCurrencyType, + ); Self::get_relative_price(¤cy_id, &fiat_id) } diff --git a/lib-serml/prices/src/mock.rs b/lib-serml/prices/src/mock.rs index 9a7837af3..5bde469a0 100644 --- a/lib-serml/prices/src/mock.rs +++ b/lib-serml/prices/src/mock.rs @@ -56,16 +56,16 @@ pub const LP_CHFJ_USDJ: CurrencyId = CurrencyId::DexShare(TokenSymbol::CHFJ, Tok pub const LP_USDJ_DNAR: CurrencyId = CurrencyId::DexShare(TokenSymbol::USDJ, TokenSymbol::DNAR); // Currencies constants - FiatCurrencyIds -pub const USD: FiatCurrencyId = USD; // US Dollar (Fiat - only for price feed) -pub const GBP: FiatCurrencyId = GBP; // Pound Sterling (Fiat - only for price feed) -pub const EUR: FiatCurrencyId = EUR; // Euro (Fiat - only for price feed) -pub const KWD: FiatCurrencyId = KWD; // Kuwaiti Dinar (Fiat - only for price feed) -pub const JOD: FiatCurrencyId = JOD; // Jordanian Dinar (Fiat - only for price feed) -pub const BHD: FiatCurrencyId = BHD; // Bahraini Dirham (Fiat - only for price feed) -pub const KYD: FiatCurrencyId = KYD; // Cayman Islands Dollar (Fiat - only for price feed) -pub const OMR: FiatCurrencyId = OMR; // Omani Riyal (Fiat - only for price feed) -pub const CHF: FiatCurrencyId = CHF; // Swiss Franc (Fiat - only for price feed) -pub const GIP: FiatCurrencyId = GIP; // Gibraltar Pound (Fiat - only for price feed) +pub const USD: FiatCurrencyId = USD; // 1. US Dollar (Fiat - only for price feed) +pub const GBP: FiatCurrencyId = GBP; // 2. Pound Sterling (Fiat - only for price feed) +pub const EUR: FiatCurrencyId = EUR; // 3. Euro (Fiat - only for price feed) +pub const KWD: FiatCurrencyId = KWD; // 4. Kuwaiti Dinar (Fiat - only for price feed) +pub const JOD: FiatCurrencyId = JOD; // 5. Jordanian Dinar (Fiat - only for price feed) +pub const BHD: FiatCurrencyId = BHD; // 6. Bahraini Dirham (Fiat - only for price feed) +pub const KYD: FiatCurrencyId = KYD; // 7. Cayman Islands Dollar (Fiat - only for price feed) +pub const OMR: FiatCurrencyId = OMR; // 8. Omani Riyal (Fiat - only for price feed) +pub const CHF: FiatCurrencyId = CHF; // 9. Swiss Franc (Fiat - only for price feed) +pub const GIP: FiatCurrencyId = GIP; // 10. Gibraltar Pound (Fiat - only for price feed) mod setheum_prices { pub use super::super::*; diff --git a/primitives/src/currency.rs b/primitives/src/currency.rs index add215691..fc5934972 100644 --- a/primitives/src/currency.rs +++ b/primitives/src/currency.rs @@ -137,7 +137,7 @@ create_currency_id! { SEKJ("Setheum Swedish Krona", 12) = 17, MYRJ("Setheum Malaysian Ringgit", 12) = 18, IDRJ("Setheum Indonesian Rupiah", 12) = 19, - NGNJ("Setheum Naira", 12) = 20, + NGNJ("Setheum Nigerian Naira", 12) = 20, PKRJ("Setheum Pakistani Rupee", 12) = 21, AEDJ("Setheum Emirati Dirham", 12) = 22, NOKJ("Setheum Norwegian Krone", 12) = 23, @@ -166,8 +166,18 @@ create_currency_id! { TZSJ("Setheum TZ Shilling", 12) = 46, CFAJ("Setheum CFA Franc", 12) = 47, AZNJ("Setheum Azerbaijani Manat", 12) = 48, - PLNJ("Setheum Polish Zloty", 12) = 49, + OMRJ("Setheum Omani Riyal", 12) = 49, + TNDJ("Setheum Tunisian Dinar", 12) = 50, + MADJ("Setheum Moroccan Dirham", 12) = 51, + HRKJ("Setheum Croatian Kuna", 12) = 52, + BGNJ("Setheum Bulgarian Lev", 12) = 53, + DKKJ("Setheum Danish Krone", 12) = 54, + ARSJ("Setheum Argentine Peso", 12) = 55, + RONJ("Setheum Romanian Leu", 12) = 56, + BAMJ("Setheum Bosnian Mark", 12) = 57, + PLNJ("Setheum Polish Zloty", 12) = 58, + /// Neom Network >---------------------->> NEOM("Neom", 10) = 128, HALAL("HalalSwap", 10) = 129, @@ -190,7 +200,7 @@ create_currency_id! { JSEK("Neom Swedish Krona", 12) = 145, JMYR("Neom Malaysian Ringgit", 12) = 146, JIDR("Neom Indonesian Rupiah", 12) = 147, - JNGN("Neom Naira", 12) = 148, + JNGN("Neom Nigerian Naira", 12) = 148, JPKR("Neom Pakistani Rupee", 12) = 149, JAED("Neom Emirati Dirham", 12) = 150, JNOK("Neom Norwegian Krone", 12) = 151, @@ -220,10 +230,82 @@ create_currency_id! { JCFA("Neom CFA Franc", 12) = 175, JAZN("Neom Azerbaijani Manat", 12) = 176, JPLN("Neom Polish Zloty", 12) = 177, + OMRJ("Neom Omani Riyal", 12) = 178, + JTND("Neom Tunisian Dinar", 12) = 179, + JMAD("Neom Moroccan Dirham", 12) = 180, + JHRK("Neom Croatian Kuna", 12) = 181, + JBGN("Neom Bulgarian Lev", 12) = 182, + JDKK("Neom Danish Krone", 12) = 183, + JARS("Neom Argentine Peso", 12) = 184, + JRON("Neom Romanian Leu", 12) = 185, + JBAM("Neom Bosnian Mark", 12) = 186, + JPLN("Neom Polish Zloty", 12) = 187, + + + /// Fiat Currencies as Pegs >---------------------->> + /// Fiat - only for price feed + /// + USD("US Dollar", 12) = 2048, + EUR("Euro", 12) = 132, + JPY("Japanese Yen", 12) = 2049, + GBP("Pound Sterling", 12) = 2050, + CAD("Canadian Dollar", 12) = 2051, + HKD("HK Dollar", 12) = 2052, + TWD("Taiwan Dollar", 12) = 2053, + BRL("Brazilian Real", 12) = 2054, + CHF("Swiss Franc", 12) = 2055, + RUB("Russian Rubble", 12) = 2056, + THB("Thai Baht", 12) = 2057, + MXN("Mexican Peso", 12) = 2058, + SAR("Saudi Riyal", 12) = 2059, + SGD("Singapore Dollar", 12) = 2060, + SEK("Swedish Krona", 12) = 2061, + MYR("Malaysian Ringgit", 12) = 2062, + IDR("Indonesian Rupiah", 12) = 2063, + NGN("Nigerian Naira", 12) = 2064, + PKR("Pakistani Rupee", 12) = 2065, + AED("Emirati Dirham", 12) = 2066, + NOK("Norwegian Krone", 12) = 2067, + ZAR("S.African Rand", 12) = 2068, + CZK("Czech Koruna", 12) = 2069, + NZD("NZ Dollar ", 12) = 2070, + COP("Colombian Peso", 12) = 2071, + KWD("Kuwaiti Dinar", 12) = 2072, + CLP("Chilean Peso", 12) = 2073, + PHP("Philippine Peso", 12) = 2074, + HUF("Hungarian Forint", 12) = 2075, + JOD("Jordanian Dinar", 12) = 2076, + TRY("Turkish Lira", 12) = 2077, + AUD("Aussie Dollar", 12) = 2078, + KES("Kenyan Shilling", 12) = 2079, + BHD("Bahraini Dinar", 12) = 2080, + BWP("Botswanan Pula", 12) = 2081, + INR("Indian Rupee", 12) = 2082, + KRW("S.Korean Won", 12) = 2083, + SCR("Seychellois Rupee", 12) = 2084, + ZMW("Zambian Kwacha", 12) = 2085, + GHS("Ghanaian Cedi", 12) = 2086, + AOA("Angolan Kwanza", 12) = 2087, + DZD("Algerian Dinar", 12) = 2088, + ETB("Ethiopian Birr", 12) = 2089, + TZS("TZ Shilling", 12) = 2090, + CFA("CFA Franc", 12) = 2091, + AZN("Azerbaijani Manat", 12) = 2092, + PLN("Polish Zloty", 12) = 2093, + OMR("Omani Riyal", 12) = 2094, + TND("Tunisian Dinar", 12) = 2095, + MAD("Moroccan Dirham", 12) = 2096, + HRK("Croatian Kuna", 12) = 2097, + BGN("Bulgarian Lev", 12) = 2098, + DKK("Danish Krone", 12) = 2099, + ARS("Argentine Peso", 12) = 2100, + RON("Romanian Leu", 12) = 2101, + BAM("Bosnian Mark", 12) = 2102, + PLN("Polish Zloty", 12) = 2103, } } -pub trait TokenInfo { +pNeom okenInfo { fn currency_id(&self) -> Option; fn name(&self) -> Option<&str>; fn symbol(&self) -> Option<&str>; From aac0a555e0ebc316be3b1ebdae200230b0e36d95 Mon Sep 17 00:00:00 2001 From: Muhammad-Jibril Date: Sun, 20 Jun 2021 07:53:15 +0800 Subject: [PATCH 2/8] fix lib-openrml link --- lib-serml/incentives/Cargo.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib-serml/incentives/Cargo.toml b/lib-serml/incentives/Cargo.toml index 5afb729e5..697772a65 100644 --- a/lib-serml/incentives/Cargo.toml +++ b/lib-serml/incentives/Cargo.toml @@ -16,8 +16,8 @@ frame-system = { default-features = false, version = '3.0.0', git = 'https://git sp-std = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', tag = 'monthly-2021-05' } # orml dependencies -orml-traits = { path = "../../lib-orml/traits", default-features = false } -orml-rewards = { path = "../../lib-orml/rewards", default-features = false } +orml-traits = { path = "../../lib-openrml/traits", default-features = false } +orml-rewards = { path = "../../lib-openrml/rewards", default-features = false } # local dependencies support = { package = "setheum-support", path = "../support", default-features = false } @@ -27,8 +27,8 @@ primitives = { package = "setheum-primitives", path = "../../primitives", defaul sp-core = { version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', tag = 'monthly-2021-05'} sp-io = { version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', tag = 'monthly-2021-05'} pallet-balances = { version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', tag = 'monthly-2021-05'} -orml-tokens = { path = "../../lib-orml/tokens" } -orml-rewards = { path = "../../lib-orml/rewards" } +orml-tokens = { path = "../../lib-openrml/tokens" } +orml-rewards = { path = "../../lib-openrml/rewards" } [features] default = ["std"] From d0a9423d77a72b8f587b10abcaf4380c3bad6c11 Mon Sep 17 00:00:00 2001 From: Muhammad-Jibril Date: Sun, 20 Jun 2021 07:54:08 +0800 Subject: [PATCH 3/8] update currency --- Cargo.lock | 182 ++++++++++++++++++-------------- lib-serml/currencies/src/lib.rs | 1 + 2 files changed, 104 insertions(+), 79 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 11debb73f..c85685462 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3884,8 +3884,8 @@ dependencies = [ "orml-oracle", "orml-oracle-rpc-runtime-api", "orml-rewards", - "orml-tokens", - "orml-traits", + "orml-tokens 0.4.1-dev", + "orml-traits 0.4.1-dev", "orml-unknown-tokens", "orml-vesting", "pallet-authorship", @@ -3916,7 +3916,6 @@ dependencies = [ "serde", "serp-auction", "serp-treasury", - "setheum-airdrop", "setheum-currencies", "setheum-dex", "setheum-incentives", @@ -3977,8 +3976,8 @@ dependencies = [ "orml-oracle", "orml-oracle-rpc-runtime-api", "orml-rewards", - "orml-tokens", - "orml-traits", + "orml-tokens 0.4.1-dev", + "orml-traits 0.4.1-dev", "orml-unknown-tokens", "orml-vesting", "pallet-authorship", @@ -4010,7 +4009,6 @@ dependencies = [ "serde_json", "serp-auction", "serp-treasury", - "setheum-airdrop", "setheum-currencies", "setheum-dex", "setheum-incentives", @@ -4207,7 +4205,7 @@ version = "0.4.1-dev" dependencies = [ "frame-support 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "frame-system 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", - "orml-traits", + "orml-traits 0.4.1-dev", "parity-scale-codec", "serde", "sp-core 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", @@ -4256,9 +4254,9 @@ version = "0.4.1-dev" dependencies = [ "frame-support 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "frame-system 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", - "orml-tokens", - "orml-traits", - "orml-utilities", + "orml-tokens 0.4.1-dev", + "orml-traits 0.4.1-dev", + "orml-utilities 0.4.1-dev", "pallet-balances 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "parity-scale-codec", "serde", @@ -4274,6 +4272,7 @@ version = "0.4.1-dev" dependencies = [ "frame-support 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "frame-system 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", + "max-encoded-len", "parity-scale-codec", "serde", "sp-core 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", @@ -4288,8 +4287,8 @@ version = "0.4.1-dev" dependencies = [ "frame-support 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "frame-system 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", - "orml-traits", - "orml-utilities", + "orml-traits 0.4.1-dev", + "orml-utilities 0.4.1-dev", "parity-scale-codec", "serde", "sp-application-crypto 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", @@ -4328,7 +4327,8 @@ version = "0.4.1-dev" dependencies = [ "frame-support 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "frame-system 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", - "orml-traits", + "max-encoded-len", + "orml-traits 0.4.1-dev", "parity-scale-codec", "serde", "sp-core 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", @@ -4337,13 +4337,29 @@ dependencies = [ "sp-std 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", ] +[[package]] +name = "orml-tokens" +version = "0.4.1-dev" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=master#2ff4dbbc9c031f2ffdeba690e84ac09bf6553a13" +dependencies = [ + "frame-support 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", + "frame-system 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", + "max-encoded-len", + "orml-traits 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?branch=master)", + "parity-scale-codec", + "serde", + "sp-runtime 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", + "sp-std 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", +] + [[package]] name = "orml-tokens" version = "0.4.1-dev" dependencies = [ "frame-support 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "frame-system 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", - "orml-traits", + "max-encoded-len", + "orml-traits 0.4.1-dev", "pallet-elections-phragmen", "pallet-treasury", "parity-scale-codec", @@ -4354,6 +4370,22 @@ dependencies = [ "sp-std 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", ] +[[package]] +name = "orml-traits" +version = "0.4.1-dev" +source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=master#2ff4dbbc9c031f2ffdeba690e84ac09bf6553a13" +dependencies = [ + "frame-support 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", + "impl-trait-for-tuples 0.2.1", + "num-traits", + "orml-utilities 0.4.1-dev (git+https://github.com/open-web3-stack/open-runtime-module-library?branch=master)", + "parity-scale-codec", + "serde", + "sp-io 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", + "sp-std 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", +] + [[package]] name = "orml-traits" version = "0.4.1-dev" @@ -4361,7 +4393,7 @@ dependencies = [ "frame-support 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "impl-trait-for-tuples 0.2.1", "num-traits", - "orml-utilities", + "orml-utilities 0.4.1-dev", "parity-scale-codec", "serde", "sp-io 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", @@ -4385,6 +4417,19 @@ 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#2ff4dbbc9c031f2ffdeba690e84ac09bf6553a13" +dependencies = [ + "frame-support 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", + "parity-scale-codec", + "serde", + "sp-io 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", + "sp-std 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", +] + [[package]] name = "orml-utilities" version = "0.4.1-dev" @@ -4405,6 +4450,7 @@ version = "0.4.1-dev" dependencies = [ "frame-support 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "frame-system 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", + "max-encoded-len", "pallet-balances 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "parity-scale-codec", "serde", @@ -4419,7 +4465,7 @@ name = "orml-xcm-support" version = "0.4.1-dev" dependencies = [ "frame-support 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", - "orml-traits", + "orml-traits 0.4.1-dev", "parity-scale-codec", "sp-runtime 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "sp-std 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", @@ -4550,8 +4596,8 @@ dependencies = [ [[package]] name = "pallet-grandpa" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?tag=monthly-2021-05#70ef0afc86cdef0cba09336acffb08bff08540aa" +version = "3.1.0" +source = "git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6#1d04678e20555e623c974ee1127bc8a45abcf3d6" dependencies = [ "frame-benchmarking 3.1.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "frame-support 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", @@ -4563,6 +4609,7 @@ dependencies = [ "sp-application-crypto 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "sp-core 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "sp-finality-grandpa", + "sp-io 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "sp-runtime 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "sp-session", "sp-staking 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", @@ -5891,8 +5938,8 @@ dependencies = [ "hex-literal 0.3.1", "orml-nft", "orml-oracle", - "orml-tokens", - "orml-traits", + "orml-tokens 0.4.1-dev", + "orml-traits 0.4.1-dev", "pallet-balances 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "pallet-proxy 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "pallet-scheduler", @@ -7152,9 +7199,9 @@ dependencies = [ "frame-support 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "frame-system 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "orml-auction", - "orml-tokens", - "orml-traits", - "orml-utilities", + "orml-tokens 0.4.1-dev", + "orml-traits 0.4.1-dev", + "orml-utilities 0.4.1-dev", "pallet-balances 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec", "serde", @@ -7177,8 +7224,8 @@ dependencies = [ "frame-system 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "orml-auction", "orml-currencies", - "orml-tokens", - "orml-traits", + "orml-tokens 0.4.1-dev", + "orml-traits 0.4.1-dev", "pallet-balances 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec", "serde", @@ -7202,20 +7249,6 @@ dependencies = [ "setheum-service", ] -[[package]] -name = "setheum-airdrop" -version = "0.7.1" -dependencies = [ - "frame-support 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", - "frame-system 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", - "parity-scale-codec", - "serde", - "setheum-primitives", - "sp-core 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", - "sp-io 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", - "sp-runtime 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", -] - [[package]] name = "setheum-cli" version = "0.7.1" @@ -7236,15 +7269,14 @@ version = "0.7.1" dependencies = [ "frame-support 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "frame-system 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", - "orml-tokens", - "orml-traits", - "orml-utilities", + "orml-tokens 0.4.1-dev", + "orml-traits 0.4.1-dev", + "orml-utilities 0.4.1-dev", "pallet-balances 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "pallet-timestamp 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "parity-scale-codec", "serde", "setheum-primitives", - "setheum-support", "sp-core 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "sp-io 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "sp-runtime 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", @@ -7332,8 +7364,9 @@ dependencies = [ "frame-benchmarking 3.1.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "frame-support 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "frame-system 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", - "orml-tokens", - "orml-traits", + "max-encoded-len", + "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)", "pallet-balances 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "parity-scale-codec", "serde", @@ -7360,13 +7393,13 @@ dependencies = [ [[package]] name = "setheum-incentives" -version = "0.7.1" +version = "0.5.0" dependencies = [ "frame-support 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "frame-system 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "orml-rewards", - "orml-tokens", - "orml-traits", + "orml-tokens 0.4.1-dev", + "orml-traits 0.4.1-dev", "pallet-balances 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "parity-scale-codec", "serde", @@ -7403,8 +7436,8 @@ dependencies = [ "frame-support 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "frame-system 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "orml-nft", - "orml-tokens", - "orml-traits", + "orml-tokens 0.4.1-dev", + "orml-traits 0.4.1-dev", "pallet-balances 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "pallet-proxy 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "pallet-timestamp 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", @@ -7426,8 +7459,8 @@ version = "0.7.1" dependencies = [ "frame-support 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "frame-system 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", - "orml-tokens", - "orml-traits", + "orml-tokens 0.4.1-dev", + "orml-traits 0.4.1-dev", "parity-scale-codec", "serde", "setheum-primitives", @@ -7447,10 +7480,9 @@ dependencies = [ "parity-scale-codec", "serde", "serde_json", - "sp-core 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", - "sp-io 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", - "sp-runtime 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", - "sp-std 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", + "sp-core 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-std 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -7500,8 +7532,8 @@ dependencies = [ "orml-oracle", "orml-oracle-rpc-runtime-api", "orml-rewards", - "orml-tokens", - "orml-traits", + "orml-tokens 0.4.1-dev", + "orml-traits 0.4.1-dev", "orml-unknown-tokens", "orml-vesting", "pallet-authorship", @@ -7532,7 +7564,6 @@ dependencies = [ "serde", "serp-auction", "serp-treasury", - "setheum-airdrop", "setheum-currencies", "setheum-dex", "setheum-incentives", @@ -7619,8 +7650,8 @@ dependencies = [ "frame-support 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "frame-system 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "orml-currencies", - "orml-tokens", - "orml-traits", + "orml-tokens 0.4.1-dev", + "orml-traits 0.4.1-dev", "pallet-balances 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec", "serde", @@ -7640,9 +7671,9 @@ dependencies = [ "frame-support 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "frame-system 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "orml-currencies", - "orml-tokens", - "orml-traits", - "orml-utilities", + "orml-tokens 0.4.1-dev", + "orml-traits 0.4.1-dev", + "orml-utilities 0.4.1-dev", "pallet-balances 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec", "serde", @@ -7665,8 +7696,8 @@ dependencies = [ "frame-support 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "frame-system 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "orml-currencies", - "orml-tokens", - "orml-traits", + "orml-tokens 0.4.1-dev", + "orml-traits 0.4.1-dev", "pallet-balances 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec", "serde", @@ -7687,10 +7718,8 @@ version = "0.7.1" dependencies = [ "frame-support 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "impl-trait-for-tuples 0.1.3", - "orml-traits", "parity-scale-codec", "setheum-primitives", - "sp-core 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "sp-runtime 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "sp-std 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", ] @@ -7701,8 +7730,8 @@ version = "0.7.1" dependencies = [ "frame-support 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "frame-system 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", - "orml-tokens", - "orml-traits", + "orml-tokens 0.4.1-dev", + "orml-traits 0.4.1-dev", "pallet-balances 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "pallet-proxy 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "pallet-transaction-payment", @@ -10481,8 +10510,8 @@ dependencies = [ [[package]] name = "xcm" -version = "0.9.3" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2" +version = "0.9.4" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.4#2f28561a09aab0613b5f8a68fbabf723d5fc197e" dependencies = [ "derivative", "impl-trait-for-tuples 0.2.1", @@ -10491,8 +10520,8 @@ dependencies = [ [[package]] name = "xcm-executor" -version = "0.9.3" -source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.3#aa386760948574af4078c59decf558d16efe15e2" +version = "0.9.4" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.4#2f28561a09aab0613b5f8a68fbabf723d5fc197e" dependencies = [ "frame-support 3.0.0 (git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6)", "impl-trait-for-tuples 0.2.1", @@ -10590,11 +10619,6 @@ name = "pallet-election-provider-multi-phase" version = "3.0.0" source = "git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6#1d04678e20555e623c974ee1127bc8a45abcf3d6" -[[patch.unused]] -name = "pallet-grandpa" -version = "3.1.0" -source = "git+https://github.com/paritytech//substrate?rev=1d04678e20555e623c974ee1127bc8a45abcf3d6#1d04678e20555e623c974ee1127bc8a45abcf3d6" - [[patch.unused]] name = "pallet-identity" version = "3.0.0" diff --git a/lib-serml/currencies/src/lib.rs b/lib-serml/currencies/src/lib.rs index bbd86327d..15d75edc6 100644 --- a/lib-serml/currencies/src/lib.rs +++ b/lib-serml/currencies/src/lib.rs @@ -126,6 +126,7 @@ pub mod module { dest: ::Source, currency_id: CurrencyIdOf, #[pallet::compact] amount: BalanceOf, + // TODO: Add `claim_cashdrop: bool`, and if yes then call clain_cashdrop(origin, currency_id, amount) to claim cashdrop. ) -> DispatchResultWithPostInfo { let from = ensure_signed(origin)?; let to = T::Lookup::lookup(dest)?; From 7292b21ca77c4232ea11b2937e9f7e4f99840be7 Mon Sep 17 00:00:00 2001 From: Muhammad-Jibril Date: Sun, 20 Jun 2021 12:48:51 +0800 Subject: [PATCH 4/8] Update currency.rs --- primitives/src/currency.rs | 177 ++++++++++++++----------------------- 1 file changed, 68 insertions(+), 109 deletions(-) diff --git a/primitives/src/currency.rs b/primitives/src/currency.rs index fc5934972..247cc52aa 100644 --- a/primitives/src/currency.rs +++ b/primitives/src/currency.rs @@ -115,6 +115,7 @@ create_currency_id! { #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] #[repr(u8)] pub enum TokenSymbol { + // TODO: Update! /// Setheum Network >---------------------->> DNAR("Setheum Dinar", 10) = 0, SDEX("SettinDex", 10) = 1, @@ -125,7 +126,7 @@ create_currency_id! { JPYJ("Setheum Japanese Yen", 12) = 5, GBPJ("Setheum Pound Sterling", 12) = 6, CADJ("Setheum Canadian Dollar", 12) = 7, - HKDJ("Setheum HK Dollar", 12) = 8, + HKDJ("Setheum HongKong Dollar", 12) = 8, TWDJ("Setheum Taiwan Dollar", 12) = 9, BRLJ("Setheum Brazilian Real", 12) = 10, CHFJ("Setheum Swiss Franc", 12) = 11, @@ -142,39 +143,18 @@ create_currency_id! { AEDJ("Setheum Emirati Dirham", 12) = 22, NOKJ("Setheum Norwegian Krone", 12) = 23, ZARJ("Setheum S.African Rand", 12) = 24, - CZKJ("Setheum Czech Koruna", 12) = 25, - NZDJ("Setheum NZ Dollar ", 12) = 26, + NZDJ("Setheum NewZealand Dollar ", 12) = 26, COPJ("Setheum Colombian Peso", 12) = 27, - KWDJ("Setheum Kuwaiti Dinar", 12) = 28, CLPJ("Setheum Chilean Peso", 12) = 29, PHPJ("Setheum Philippine Peso", 12) = 30, HUFJ("Setheum Hungarian Forint", 12) = 31, - JODJ("Setheum Jordanian Dinar", 12) = 32, TRYJ("Setheum Turkish Lira", 12) = 33, - AUDJ("Setheum Aussie Dollar", 12) = 34, + AUDJ("Setheum Australian Dollar", 12) = 34, KESJ("Setheum Kenyan Shilling", 12) = 35, - BHDJ("Setheum Bahraini Dinar", 12) = 36, - BWPJ("Setheum Botswanan Pula", 12) = 37, - INRJ("Setheum Indian Rupee", 12) = 38, KRWJ("Setheum S.Korean Won", 12) = 39, - SCRJ("Setheum Seychellois Rupee", 12) = 40, - ZMWJ("Setheum Zambian Kwacha", 12) = 41, - GHSJ("Setheum Ghanaian Cedi", 12) = 42, - AOAJ("Setheum Angolan Kwanza", 12) = 43, - DZDJ("Setheum Algerian Dinar", 12) = 44, - ETBJ("Setheum Ethiopian Birr", 12) = 45, - TZSJ("Setheum TZ Shilling", 12) = 46, - CFAJ("Setheum CFA Franc", 12) = 47, - AZNJ("Setheum Azerbaijani Manat", 12) = 48, - OMRJ("Setheum Omani Riyal", 12) = 49, - TNDJ("Setheum Tunisian Dinar", 12) = 50, - MADJ("Setheum Moroccan Dirham", 12) = 51, - HRKJ("Setheum Croatian Kuna", 12) = 52, - BGNJ("Setheum Bulgarian Lev", 12) = 53, - DKKJ("Setheum Danish Krone", 12) = 54, + TZSJ("Setheum Tanzanian Shilling", 12) = 46, ARSJ("Setheum Argentine Peso", 12) = 55, RONJ("Setheum Romanian Leu", 12) = 56, - BAMJ("Setheum Bosnian Mark", 12) = 57, PLNJ("Setheum Polish Zloty", 12) = 58, @@ -188,7 +168,7 @@ create_currency_id! { JJPY("Neom Japanese Yen", 12) = 133, JGBP("Neom Pound Sterling", 12) = 134, JCAD("Neom Canadian Dollar", 12) = 135, - JHKD("Neom HK Dollar", 12) = 136, + JHKD("Neom HongKong Dollar", 12) = 136, JTWD("Neom Taiwan Dollar", 12) = 137, JBRL("Neom Brazilian Real", 12) = 138, JCHF("Neom Swiss Franc", 12) = 139, @@ -205,107 +185,86 @@ create_currency_id! { JAED("Neom Emirati Dirham", 12) = 150, JNOK("Neom Norwegian Krone", 12) = 151, JZAR("Neom S.African Rand", 12) = 152, - JCZK("Neom Czech Koruna", 12) = 153, - JNZD("Neom NZ Dollar ", 12) = 154, + JNZD("Neom NewZealand Dollar ", 12) = 154, JCOP("Neom Colombian Peso", 12) = 155, - JKWD("Neom Kuwaiti Dinar", 12) = 156, JCLP("Neom Chilean Peso", 12) = 157, JPHP("Neom Philippine Peso", 12) = 158, JHUF("Neom Hungarian Forint", 12) = 159, - JJOD("Neom Jordanian Dinar", 12) = 160, JTRY("Neom Turkish Lira", 12) = 161, - JAUD("Neom Aussie Dollar", 12) = 162, + JAUD("Neom Australian Dollar", 12) = 162, JKES("Neom Kenyan Shilling", 12) = 163, - JBHD("Neom Bahraini Dinar", 12) = 164, - JBWP("Neom Botswanan Pula", 12) = 165, - JINR("Neom Indian Rupee", 12) = 166, JKRW("Neom S.Korean Won", 12) = 167, - JSCR("Neom Seychellois Rupee", 12) = 168, - JZMW("Neom Zambian Kwacha", 12) = 169, - JGHS("Neom Ghanaian Cedi", 12) = 170, - JAOA("Neom Angolan Kwanza", 12) = 171, - JDZD("Neom Algerian Dinar", 12) = 172, - JETB("Neom Ethiopian Birr", 12) = 173, JTZS("Neom TZ Shilling", 12) = 174, - JCFA("Neom CFA Franc", 12) = 175, - JAZN("Neom Azerbaijani Manat", 12) = 176, JPLN("Neom Polish Zloty", 12) = 177, - OMRJ("Neom Omani Riyal", 12) = 178, - JTND("Neom Tunisian Dinar", 12) = 179, - JMAD("Neom Moroccan Dirham", 12) = 180, - JHRK("Neom Croatian Kuna", 12) = 181, - JBGN("Neom Bulgarian Lev", 12) = 182, - JDKK("Neom Danish Krone", 12) = 183, - JARS("Neom Argentine Peso", 12) = 184, - JRON("Neom Romanian Leu", 12) = 185, - JBAM("Neom Bosnian Mark", 12) = 186, - JPLN("Neom Polish Zloty", 12) = 187, + JARS("Neom Argentine Peso", 12) = 183, + JRON("Neom Romanian Leu", 12) = 184, + JPLN("Neom Polish Zloty", 12) = 185, /// Fiat Currencies as Pegs >---------------------->> /// Fiat - only for price feed /// - USD("US Dollar", 12) = 2048, - EUR("Euro", 12) = 132, - JPY("Japanese Yen", 12) = 2049, - GBP("Pound Sterling", 12) = 2050, - CAD("Canadian Dollar", 12) = 2051, - HKD("HK Dollar", 12) = 2052, - TWD("Taiwan Dollar", 12) = 2053, - BRL("Brazilian Real", 12) = 2054, - CHF("Swiss Franc", 12) = 2055, - RUB("Russian Rubble", 12) = 2056, - THB("Thai Baht", 12) = 2057, - MXN("Mexican Peso", 12) = 2058, - SAR("Saudi Riyal", 12) = 2059, - SGD("Singapore Dollar", 12) = 2060, - SEK("Swedish Krona", 12) = 2061, - MYR("Malaysian Ringgit", 12) = 2062, - IDR("Indonesian Rupiah", 12) = 2063, - NGN("Nigerian Naira", 12) = 2064, - PKR("Pakistani Rupee", 12) = 2065, - AED("Emirati Dirham", 12) = 2066, - NOK("Norwegian Krone", 12) = 2067, - ZAR("S.African Rand", 12) = 2068, - CZK("Czech Koruna", 12) = 2069, - NZD("NZ Dollar ", 12) = 2070, - COP("Colombian Peso", 12) = 2071, - KWD("Kuwaiti Dinar", 12) = 2072, - CLP("Chilean Peso", 12) = 2073, - PHP("Philippine Peso", 12) = 2074, - HUF("Hungarian Forint", 12) = 2075, - JOD("Jordanian Dinar", 12) = 2076, - TRY("Turkish Lira", 12) = 2077, - AUD("Aussie Dollar", 12) = 2078, - KES("Kenyan Shilling", 12) = 2079, - BHD("Bahraini Dinar", 12) = 2080, + USD("US Dollar", 12) = 246, + EUR("Euro", 12) = 247, + JPY("Japanese Yen", 12) = 248, + GBP("Pound Sterling", 12) = 249, + CAD("Canadian Dollar", 12) = 250, + HKD("HongKong Dollar", 12) = 251, + TWD("Taiwan Dollar", 12) = 252, + BRL("Brazilian Real", 12) = 253, + CHF("Swiss Franc", 12) = 254, + RUB("Russian Rubble", 12) = 255, + THB("Thai Baht", 12) = 256, + MXN("Mexican Peso", 12) = 257, + SAR("Saudi Riyal", 12) = 258, + SGD("Singapore Dollar", 12) = 259, + SEK("Swedish Krona", 12) = 260, + MYR("Malaysian Ringgit", 12) = 261, + IDR("Indonesian Rupiah", 12) = 262, + NGN("Nigerian Naira", 12) = 263, + PKR("Pakistani Rupee", 12) = 264, + AED("Emirati Dirham", 12) = 265, + NOK("Norwegian Krone", 12) = 266, + ZAR("S.African Rand", 12) = 267, + CZK("Czech Koruna", 12) = 268, + NZD("NewZealand Dollar ", 12) = 269, + COP("Colombian Peso", 12) = 270, + KWD("Kuwaiti Dinar", 12) = 271, + CLP("Chilean Peso", 12) = 272, + PHP("Philippine Peso", 12) = 273, + HUF("Hungarian Forint", 12) = 274, + JOD("Jordanian Dinar", 12) = 275, + TRY("Turkish Lira", 12) = 276, + AUD("Australian Dollar", 12) = 278, + KES("Kenyan Shilling", 12) = 279, + BHD("Bahraini Dinar", 12) = 280, BWP("Botswanan Pula", 12) = 2081, - INR("Indian Rupee", 12) = 2082, - KRW("S.Korean Won", 12) = 2083, - SCR("Seychellois Rupee", 12) = 2084, - ZMW("Zambian Kwacha", 12) = 2085, - GHS("Ghanaian Cedi", 12) = 2086, - AOA("Angolan Kwanza", 12) = 2087, - DZD("Algerian Dinar", 12) = 2088, - ETB("Ethiopian Birr", 12) = 2089, - TZS("TZ Shilling", 12) = 2090, - CFA("CFA Franc", 12) = 2091, - AZN("Azerbaijani Manat", 12) = 2092, - PLN("Polish Zloty", 12) = 2093, - OMR("Omani Riyal", 12) = 2094, - TND("Tunisian Dinar", 12) = 2095, - MAD("Moroccan Dirham", 12) = 2096, - HRK("Croatian Kuna", 12) = 2097, - BGN("Bulgarian Lev", 12) = 2098, - DKK("Danish Krone", 12) = 2099, - ARS("Argentine Peso", 12) = 2100, - RON("Romanian Leu", 12) = 2101, - BAM("Bosnian Mark", 12) = 2102, - PLN("Polish Zloty", 12) = 2103, + INR("Indian Rupee", 12) = 282, + KRW("S.Korean Won", 12) = 283, + SCR("Seychellois Rupee", 12) = 284, + ZMW("Zambian Kwacha", 12) = 285, + GHS("Ghanaian Cedi", 12) = 286, + AOA("Angolan Kwanza", 12) = 287, + DZD("Algerian Dinar", 12) = 288, + ETB("Ethiopian Birr", 12) = 289, + TZS("TZ Shilling", 12) = 290, + CFA("CFA Franc", 12) = 291, + AZN("Azerbaijani Manat", 12) = 292, + PLN("Polish Zloty", 12) = 293, + OMR("Omani Riyal", 12) = 294, + TND("Tunisian Dinar", 12) = 295, + MAD("Moroccan Dirham", 12) = 296, + HRK("Croatian Kuna", 12) = 297, + BGN("Bulgarian Lev", 12) = 298, + DKK("Danish Krone", 12) = 299, + ARS("Argentine Peso", 12) = 300, + RON("Romanian Leu", 12) = 301, + BAM("Bosnian Mark", 12) = 302, + PLN("Polish Zloty", 12) = 303, } } -pNeom okenInfo { +pub trait TokenInfo { fn currency_id(&self) -> Option; fn name(&self) -> Option<&str>; fn symbol(&self) -> Option<&str>; From 6187819cc4edadd3c9f654a1f46754abe847a731 Mon Sep 17 00:00:00 2001 From: Muhammad-Jibril Date: Mon, 21 Jun 2021 02:01:52 +0800 Subject: [PATCH 5/8] Update and rearrange currencies --- primitives/src/currency.rs | 281 +++++++++++++++++++------------------ 1 file changed, 147 insertions(+), 134 deletions(-) diff --git a/primitives/src/currency.rs b/primitives/src/currency.rs index 247cc52aa..968e1b507 100644 --- a/primitives/src/currency.rs +++ b/primitives/src/currency.rs @@ -115,152 +115,165 @@ create_currency_id! { #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] #[repr(u8)] pub enum TokenSymbol { - // TODO: Update! /// Setheum Network >---------------------->> + /// + /// Starts from 0 (85 places available) + /// DNAR("Setheum Dinar", 10) = 0, SDEX("SettinDex", 10) = 1, SETT("Setter", 12) = 2, - // SettCurrencies - USDJ("Setheum US Dollar", 12) = 3, - EURJ("Setheum Euro", 12) = 4, - JPYJ("Setheum Japanese Yen", 12) = 5, - GBPJ("Setheum Pound Sterling", 12) = 6, + // SettCurrencies (Alphabetical Order) + AEDJ("Setheum UAE Emirati Dirham", 12) = 3, + ARSJ("Setheum Argentine Peso", 12) = 4, + AUDJ("Setheum Australian Dollar", 12) = 5, + BRLJ("Setheum Brazilian Real", 12) = 6, CADJ("Setheum Canadian Dollar", 12) = 7, - HKDJ("Setheum HongKong Dollar", 12) = 8, - TWDJ("Setheum Taiwan Dollar", 12) = 9, - BRLJ("Setheum Brazilian Real", 12) = 10, - CHFJ("Setheum Swiss Franc", 12) = 11, - RUBJ("Setheum Russian Rubble", 12) = 12, - THBJ("Setheum Thai Baht", 12) = 13, - MXNJ("Setheum Mexican Peso", 12) = 14, - SARJ("Setheum Saudi Riyal", 12) = 15, - SGDJ("Setheum Singapore Dollar", 12) = 16, - SEKJ("Setheum Swedish Krona", 12) = 17, - MYRJ("Setheum Malaysian Ringgit", 12) = 18, - IDRJ("Setheum Indonesian Rupiah", 12) = 19, - NGNJ("Setheum Nigerian Naira", 12) = 20, - PKRJ("Setheum Pakistani Rupee", 12) = 21, - AEDJ("Setheum Emirati Dirham", 12) = 22, - NOKJ("Setheum Norwegian Krone", 12) = 23, - ZARJ("Setheum S.African Rand", 12) = 24, - NZDJ("Setheum NewZealand Dollar ", 12) = 26, - COPJ("Setheum Colombian Peso", 12) = 27, - CLPJ("Setheum Chilean Peso", 12) = 29, - PHPJ("Setheum Philippine Peso", 12) = 30, - HUFJ("Setheum Hungarian Forint", 12) = 31, - TRYJ("Setheum Turkish Lira", 12) = 33, - AUDJ("Setheum Australian Dollar", 12) = 34, - KESJ("Setheum Kenyan Shilling", 12) = 35, - KRWJ("Setheum S.Korean Won", 12) = 39, - TZSJ("Setheum Tanzanian Shilling", 12) = 46, - ARSJ("Setheum Argentine Peso", 12) = 55, - RONJ("Setheum Romanian Leu", 12) = 56, - PLNJ("Setheum Polish Zloty", 12) = 58, + CHFJ("Setheum Swiss Franc", 12) = 8, + CLPJ("Setheum Chilean Peso", 12) = 9, + CNYJ("Setheum Japanese Yen", 12) = 10, + COPJ("Setheum Colombian Peso", 12) = 11, + EURJ("Setheum Euro", 12) =12, + GBPJ("Setheum Pound Sterling", 12) = 13, + HKDJ("Setheum HongKong Dollar", 12) = 14, + HUFJ("Setheum Hungarian Forint", 12) = 15, + IDRJ("Setheum Indonesian Rupiah", 12) = 16, + IRRJ("Setheum Iranian Riyal", 12) = 17, + JPYJ("Setheum Japanese Yen", 12) = 18, + KESJ("Setheum Kenyan Shilling", 12) = 19, + KRWJ("Setheum South Korean Won", 12) = 20, + KZTJ("Setheum Kzakhstani Tenge", 12) = 21, + MXNJ("Setheum Mexican Peso", 12) = 22, + MYRJ("Setheum Malaysian Ringgit", 12) = 23, + NGNJ("Setheum Nigerian Naira", 12) = 24, + NOKJ("Setheum Norwegian Krone", 12) = 25, + NZDJ("Setheum New Zealand Dollar ", 12) = 26, + PENJ("Setheum Peruvian Sol", 12) = 27, + PHPJ("Setheum Philippine Peso", 12) = 28, + PKRJ("Setheum Pakistani Rupee", 12) = 29, + PLNJ("Setheum Polish Zloty", 12) = 30, + QARJ("Setheum Qatari Riyal", 12) = 31, + RONJ("Setheum Romanian Leu", 12) = 32, + RUBJ("Setheum Russian Rubble", 12) = 33, + SARJ("Setheum Saudi Riyal", 12) = 34, + SEKJ("Setheum Swedish Krona", 12) = 35, + SGDJ("Setheum Singapore Dollar", 12) = 36, + THBJ("Setheum Thai Baht", 12) = 37, + TRYJ("Setheum Turkish Lira", 12) = 38, + TWDJ("Setheum Taiwan Dollar", 12) = 39, + TZSJ("Setheum Tanzanian Shilling", 12) = 40, + UAHJ("Setheum Ukranian Hryvnia", 12) = 41, + USDJ("Setheum US Dollar", 12) = 42, + ZARJ("Setheum South African Rand", 12) = 43, + /// + /// Ends at 85 (42 places left yet reserved) /// Neom Network >---------------------->> - NEOM("Neom", 10) = 128, - HALAL("HalalSwap", 10) = 129, - NSETT("Neom Setter", 12) = 130, - // SettCurrencies - JUSD("Neom US Dollar", 12) = 131, - JEUR("Neom Euro", 12) = 132, - JJPY("Neom Japanese Yen", 12) = 133, - JGBP("Neom Pound Sterling", 12) = 134, - JCAD("Neom Canadian Dollar", 12) = 135, - JHKD("Neom HongKong Dollar", 12) = 136, - JTWD("Neom Taiwan Dollar", 12) = 137, - JBRL("Neom Brazilian Real", 12) = 138, - JCHF("Neom Swiss Franc", 12) = 139, - JRUB("Neom Russian Rubble", 12) = 140, - JTHB("Neom Thai Baht", 12) = 141, - JMXN("Neom Mexican Peso", 12) = 142, - JSAR("Neom Saudi Riyal", 12) = 143, - JSGD("Neom Singapore Dollar", 12) = 144, - JSEK("Neom Swedish Krona", 12) = 145, - JMYR("Neom Malaysian Ringgit", 12) = 146, - JIDR("Neom Indonesian Rupiah", 12) = 147, - JNGN("Neom Nigerian Naira", 12) = 148, - JPKR("Neom Pakistani Rupee", 12) = 149, - JAED("Neom Emirati Dirham", 12) = 150, - JNOK("Neom Norwegian Krone", 12) = 151, - JZAR("Neom S.African Rand", 12) = 152, - JNZD("Neom NewZealand Dollar ", 12) = 154, - JCOP("Neom Colombian Peso", 12) = 155, - JCLP("Neom Chilean Peso", 12) = 157, - JPHP("Neom Philippine Peso", 12) = 158, - JHUF("Neom Hungarian Forint", 12) = 159, - JTRY("Neom Turkish Lira", 12) = 161, - JAUD("Neom Australian Dollar", 12) = 162, - JKES("Neom Kenyan Shilling", 12) = 163, - JKRW("Neom S.Korean Won", 12) = 167, - JTZS("Neom TZ Shilling", 12) = 174, - JPLN("Neom Polish Zloty", 12) = 177, - JARS("Neom Argentine Peso", 12) = 183, - JRON("Neom Romanian Leu", 12) = 184, - JPLN("Neom Polish Zloty", 12) = 185, + /// + /// Starts from 86 (85 places available) + NEOM("Neom", 10) = 86, + HALAL("HalalSwap", 10) = 87, + NSETT("Neom Setter", 12) = 88, + // SettCurrencies (Alphabetical Order) + JAED("Neom UAE Emirati Dirham", 12) = 3, + JARS("Neom Argentine Peso", 12) = 4, + JAUD("Neom Australian Dollar", 12) = 5, + JBRL("Neom Brazilian Real", 12) = 6, + JCAD("Neom Canadian Dollar", 12) = 7, + JCHF("Neom Swiss Franc", 12) = 8, + JCLP("Neom Chilean Peso", 12) = 9, + JCNY("Neom Japanese Yen", 12) = 10, + JCOP("Neom Colombian Peso", 12) = 11, + JEUR("Neom Euro", 12) =12, + JGBP("Neom Pound Sterling", 12) = 13, + JHKD("Neom HongKong Dollar", 12) = 14, + JHUF("Neom Hungarian Forint", 12) = 15, + JIDR("Neom Indonesian Rupiah", 12) = 16, + JIRR("Neom Iranian Riyal", 12) = 17, + JJPY("Neom Japanese Yen", 12) = 18, + JKES("Neom Kenyan Shilling", 12) = 19, + JKRW("Neom South Korean Won", 12) = 20, + JKZT("Neom Kzakhstani Tenge", 12) = 21, + JMXN("Neom Mexican Peso", 12) = 22, + JMYR("Neom Malaysian Ringgit", 12) = 23, + JNGN("Neom Nigerian Naira", 12) = 24, + JNOK("Neom Norwegian Krone", 12) = 25, + JNZD("Neom New Zealand Dollar ", 12) = 26, + JPEN("Neom Peruvian Sol", 12) = 27, + JPHP("Neom Philippine Peso", 12) = 28, + JPKR("Neom Pakistani Rupee", 12) = 29, + JPLN("Neom Polish Zloty", 12) = 30, + JQAR("Neom Qatari Riyal", 12) = 31, + JRON("Neom Romanian Leu", 12) = 32, + JRUB("Neom Russian Rubble", 12) = 33, + JSAR("Neom Saudi Riyal", 12) = 34, + JSEK("Neom Swedish Krona", 12) = 35, + JSGD("Neom Singapore Dollar", 12) = 36, + JTHB("Neom Thai Baht", 12) = 37, + JTRY("Neom Turkish Lira", 12) = 38, + JTWD("Neom Taiwan Dollar", 12) = 39, + JTZS("Neom Tanzanian Shilling", 12) = 40, + JUAH("Neom Ukranian Hryvnia", 12) = 41, + JUSD("Neom US Dollar", 12) = 42, + JZAR("Neom South African Rand", 12) = 43, + /// + /// Ends at 170 (42 places left yet reserved) /// Fiat Currencies as Pegs >---------------------->> - /// Fiat - only for price feed + /// Fiat Currencies - only for price feed (Alphabetical Order) /// - USD("US Dollar", 12) = 246, - EUR("Euro", 12) = 247, - JPY("Japanese Yen", 12) = 248, - GBP("Pound Sterling", 12) = 249, - CAD("Canadian Dollar", 12) = 250, - HKD("HongKong Dollar", 12) = 251, - TWD("Taiwan Dollar", 12) = 252, - BRL("Brazilian Real", 12) = 253, - CHF("Swiss Franc", 12) = 254, - RUB("Russian Rubble", 12) = 255, - THB("Thai Baht", 12) = 256, - MXN("Mexican Peso", 12) = 257, - SAR("Saudi Riyal", 12) = 258, - SGD("Singapore Dollar", 12) = 259, - SEK("Swedish Krona", 12) = 260, - MYR("Malaysian Ringgit", 12) = 261, - IDR("Indonesian Rupiah", 12) = 262, - NGN("Nigerian Naira", 12) = 263, - PKR("Pakistani Rupee", 12) = 264, - AED("Emirati Dirham", 12) = 265, - NOK("Norwegian Krone", 12) = 266, - ZAR("S.African Rand", 12) = 267, - CZK("Czech Koruna", 12) = 268, - NZD("NewZealand Dollar ", 12) = 269, - COP("Colombian Peso", 12) = 270, - KWD("Kuwaiti Dinar", 12) = 271, - CLP("Chilean Peso", 12) = 272, - PHP("Philippine Peso", 12) = 273, - HUF("Hungarian Forint", 12) = 274, - JOD("Jordanian Dinar", 12) = 275, - TRY("Turkish Lira", 12) = 276, - AUD("Australian Dollar", 12) = 278, - KES("Kenyan Shilling", 12) = 279, - BHD("Bahraini Dinar", 12) = 280, - BWP("Botswanan Pula", 12) = 2081, - INR("Indian Rupee", 12) = 282, - KRW("S.Korean Won", 12) = 283, - SCR("Seychellois Rupee", 12) = 284, - ZMW("Zambian Kwacha", 12) = 285, - GHS("Ghanaian Cedi", 12) = 286, - AOA("Angolan Kwanza", 12) = 287, - DZD("Algerian Dinar", 12) = 288, - ETB("Ethiopian Birr", 12) = 289, - TZS("TZ Shilling", 12) = 290, - CFA("CFA Franc", 12) = 291, - AZN("Azerbaijani Manat", 12) = 292, - PLN("Polish Zloty", 12) = 293, - OMR("Omani Riyal", 12) = 294, - TND("Tunisian Dinar", 12) = 295, - MAD("Moroccan Dirham", 12) = 296, - HRK("Croatian Kuna", 12) = 297, - BGN("Bulgarian Lev", 12) = 298, - DKK("Danish Krone", 12) = 299, - ARS("Argentine Peso", 12) = 300, - RON("Romanian Leu", 12) = 301, - BAM("Bosnian Mark", 12) = 302, - PLN("Polish Zloty", 12) = 303, + /// Starts from 171 (85 places available) + /// + AED("Fiat UAE Emirati Dirham", 12) = 171, + ARS("Fiat Argentine Peso", 12) = 172, + AUD("Fiat Australian Dollar", 12) = 173, + BRL("Fiat Brazilian Real", 12) = 174, + CAD("Fiat Canadian Dollar", 12) = 175, + CHF("Fiat Swiss Franc", 12) = 176, + CLP("Fiat Chilean Peso", 12) = 177, + CNY("Fiat Japanese Yen", 12) = 178, + COP("Fiat Colombian Peso", 12) = 179, + EUR("Fiat Euro", 12) =180, + GBP("Fiat Pound Sterling", 12) = 181, + HKD("Fiat HongKong Dollar", 12) = 182, + HUF("Fiat Hungarian Forint", 12) = 183, + IDR("Fiat Indonesian Rupiah", 12) = 184, + IRR("Fiat Iranian Riyal", 12) = 185, + JPY("Fiat Japanese Yen", 12) = 186, + KES("Fiat Kenyan Shilling", 12) = 187, + KRW("Fiat South Korean Won", 12) = 188, + KZT("Fiat Kzakhstani Tenge", 12) = 189, + MXN("Fiat Mexican Peso", 12) = 190, + MYR("Fiat Malaysian Ringgit", 12) = 191, + NGN("Fiat Nigerian Naira", 12) = 192, + NOK("Fiat Norwegian Krone", 12) = 193, + NZD("Fiat New Zealand Dollar ", 12) = 194, + PEN("Fiat Peruvian Sol", 12) = 195, + PHP("Fiat Philippine Peso", 12) = 196, + PKR("Fiat Pakistani Rupee", 12) = 197, + PLN("Fiat Polish Zloty", 12) = 198, + QAR("Fiat Qatari Riyal", 12) = 199, + RON("Fiat Romanian Leu", 12) = 200, + RUB("Fiat Russian Rubble", 12) = 201, + SAR("Fiat Saudi Riyal", 12) = 202, + SEK("Fiat Swedish Krona", 12) = 203, + SGD("Fiat Singapore Dollar", 12) = 204, + THB("Fiat Thai Baht", 12) = 205, + TRY("Fiat Turkish Lira", 12) = 206, + TWD("Fiat Taiwan Dollar", 12) = 207, + TZS("Fiat Tanzanian Shilling", 12) = 208, + UAH("Fiat Ukranian Hryvnia", 12) = 209, + USD("Fiat US Dollar", 12) = 210, + ZAR("Fiat South African Rand", 12) = 211, + KWD("Fiat Kuwaiti Dinar", 12) = 212, // part of the Setter pegs, not having single settcurrencies they peg like the rest of the fiats here. + JOD("Fiat Jordanian Dinar", 12) = 213, // part of the Setter pegs, not having single settcurrencies they peg like the rest of the fiats here. + BHD("Fiat Bahraini Dirham", 12) = 214, // part of the Setter pegs, not having single settcurrencies they peg like the rest of the fiats here. + KYD("Fiat Cayman Islands Dollar", 12) = 215, // part of the Setter pegs, not having single settcurrencies they peg like the rest of the fiats here. + OMR("Fiat Omani Riyal", 12) = 216, // part of the Setter pegs, not having single settcurrencies they peg like the rest of the fiats here. + GIP("Fiat Gibraltar Pound", 12) = 217, // part of the Setter pegs, not having single settcurrencies they peg like the rest of the fiats here. + /// + /// Ends at 255 (38 places left yet reserved) } } From be41cb620edcce671be8e51b1bf5a3af32f0f482 Mon Sep 17 00:00:00 2001 From: Muhammad-Jibril Date: Mon, 21 Jun 2021 02:32:58 +0800 Subject: [PATCH 6/8] update price pegs --- lib-serml/prices/src/lib.rs | 82 +++++++++++++++++++++--------------- lib-serml/prices/src/mock.rs | 72 +++++++++++++++---------------- lib-serml/support/src/lib.rs | 3 +- 3 files changed, 85 insertions(+), 72 deletions(-) diff --git a/lib-serml/prices/src/lib.rs b/lib-serml/prices/src/lib.rs index fc2adf04b..717b96255 100644 --- a/lib-serml/prices/src/lib.rs +++ b/lib-serml/prices/src/lib.rs @@ -204,27 +204,41 @@ impl PriceProvider for Pallet { } /// get the price of a stablecoin's fiat peg - fn get_fiat_price(currency_id: CurrencyId) -> Option{ + fn get_peg_price(currency_id: CurrencyId) -> Option{ ensure!( T::StableCurrencyIds::get().contains(¤cy_id), Error::::InvalidStableCurrencyType, ); - let fiat_id = Self::get_peg_currency_by_currency_id(¤cy_id); + let fiat_currency_id = Self::get_peg_currency_by_currency_id(¤cy_id); ensure!( - T::FiatCurrencyIds::get().contains(&fiat_id), + T::FiatCurrencyIds::get().contains(&fiat_currency_id), Error::::InvalidFiatCurrencyType, ); ensure!( - T::PegCurrencyIds::get(¤cy_id) == &fiat_id, + T::PegCurrencyIds::get(¤cy_id) == &fiat_currency_id, Error::::InvalidPegPair, ); // if locked price exists, return it, otherwise return latest price from oracle. - Self::locked_price(fiat_id).or_else(|| T::Source::get(&fiat_id)); + Self::locked_price(fiat_currency_id).or_else(|| T::Source::get(&fiat_currency_id)); + } + + /// get the price of a fiat currency + fn get_fiat_price(fiat_currency_id: CurrencyId) -> Option{ + ensure!( + !T::StableCurrencyIds::get().contains(&fiat_currency_id), + Error::::InvalidFiatCurrencyType, + ); + ensure!( + T::FiatCurrencyIds::get().contains(&fiat_currency_id), + Error::::InvalidFiatCurrencyType, + ); + // if locked price exists, return it, otherwise return latest price from oracle. + Self::locked_price(fiat_currency_id).or_else(|| T::Source::get(&fiat_currency_id)); } fn get_setheum_usd_fixed_price() -> Option{ let currency_id = T::GetSettUSDCurrencyId::get(); - Self::get_fiat_price(¤cy_id) + Self::get_peg_price(¤cy_id) } /// get the fixed price of a specific settcurrency/stablecoin currency type @@ -233,12 +247,12 @@ impl PriceProvider for Pallet { T::StableCurrencyIds::get().contains(¤cy_id), Error::::InvalidStableCurrencyType, ); - let fiat_id = Self::get_peg_currency_by_currency_id(¤cy_id); + let fiat_currency_id = Self::get_peg_currency_by_currency_id(¤cy_id); ensure!( - T::FiatCurrencyIds::get().contains(&fiat_id), + T::FiatCurrencyIds::get().contains(&fiat_currency_id), Error::::InvalidFiatCurrencyType, ); - Self::get_fiat_price(¤cy_id) + Self::get_peg_price(¤cy_id) } /// get the market price (not fixed price, for SERP-TES) of a @@ -284,12 +298,12 @@ impl PriceProvider for Pallet { T::StableCurrencyIds::get().contains(¤cy_id), Error::::InvalidStableCurrencyType, ); - let fiat_id = Self::get_peg_currency_by_currency_id(¤cy_id); + let fiat_currency_id = Self::get_peg_currency_by_currency_id(¤cy_id); ensure!( - T::FiatCurrencyIds::get().contains(&fiat_id), + T::FiatCurrencyIds::get().contains(&fiat_currency_id), Error::::InvalidFiatCurrencyType, ); - Self::get_relative_price(¤cy_id, &fiat_id) + Self::get_relative_price(¤cy_id, &fiat_currency_id) } /// aggregate the setter price. @@ -302,37 +316,37 @@ impl PriceProvider for Pallet { /// get the price of a Setter (SETT basket coin - basket of currencies) fn get_setter_basket_peg_price() -> Option { - /// pegged to US Dollar (USD) - let peg_one_currency_id: CurrencyId = T::GetSettUSDCurrencyId::get(); /// pegged to Pound Sterling (GBP) - let peg_two_currency_id: CurrencyId = T::GetSettGBPCurrencyId::get(); + let peg_one_currency_id: CurrencyId = T::GetSetterPegOneCurrencyId::get(); /// pegged to Euro (EUR) - let peg_three_currency_id: CurrencyId = T::GetSettEURCurrencyId::get(); + let peg_two_currency_id: CurrencyId = T::GetSetterPegTwoCurrencyId::get(); /// pegged to Kuwaiti Dinar (KWD) - let peg_four_currency_id: CurrencyId = T::GetSettKWDCurrencyId::get(); + let peg_three_currency_id: CurrencyId = T::GetSetterPegThreeCurrencyId::get(); /// pegged to Jordanian Dinar (JOD) - let peg_five_currency_id: CurrencyId = T::GetSettJODCurrencyId::get(); + let peg_four_currency_id: CurrencyId = T::GetSetterPegFourCurrencyId::get(); /// pegged to Bahraini Dirham (BHD) - let peg_six_currency_id: CurrencyId = T::GetSettBHDCurrencyId::get(); + let peg_five_currency_id: CurrencyId = T::GetSetterPegFiveCurrencyId::get(); /// pegged to Cayman Islands Dollar (KYD) - let peg_seven_currency_id: CurrencyId = T::GetSettKYDCurrencyId::get(); + let peg_six_currency_id: CurrencyId = T::GetSetterPegSixCurrencyId::get(); /// pegged to Omani Riyal (OMR) - let peg_eight_currency_id: CurrencyId = T::GetSettOMRCurrencyId::get(); + let peg_seven_currency_id: CurrencyId = T::GetSetterPegSevenCurrencyId::get(); /// pegged to Swiss Franc (CHF) - let peg_nine_currency_id: CurrencyId = T::GetSettCHFCurrencyId::get(); + let peg_eight_currency_id: CurrencyId = T::GetSetterPegEightCurrencyId::get(); /// pegged to Gibraltar Pound (GIP) - let peg_ten_currency_id: CurrencyId = T::GetSettGIPCurrencyId::get(); - - let peg_one_price = Self::get_stablecoin_fixed_price(&peg_one_currency_id); - let peg_two_price = Self::get_stablecoin_fixed_price(&peg_two_currency_id); - let peg_three_price = Self::get_stablecoin_fixed_price(&peg_three_currency_id); - let peg_four_price = Self::get_stablecoin_fixed_price(&peg_four_currency_id); - let peg_five_price = Self::get_stablecoin_fixed_price(&peg_five_currency_id); - let peg_six_price = Self::get_stablecoin_fixed_price(&peg_six_currency_id); - let peg_seven_price = Self::get_stablecoin_fixed_price(&peg_seven_currency_id); - let peg_eight_price = Self::get_stablecoin_fixed_price(&peg_eight_currency_id); - let peg_nine_price = Self::get_stablecoin_fixed_price(&peg_nine_currency_id); - let peg_ten_price = Self::get_stablecoin_fixed_price(&peg_ten_currency_id); + let peg_nine_currency_id: CurrencyId = T::GetSetterPegNineCurrencyId::get(); + /// pegged to US Dollar (USD) + let peg_ten_currency_id: CurrencyId = T::GetSetterPegTenCurrencyId::get(); + + let peg_one_price = Self::get_fiat_price(&peg_one_currency_id); + let peg_two_price = Self::get_fiat_price(&peg_two_currency_id); + let peg_three_price = Self::get_fiat_price(&peg_three_currency_id); + let peg_four_price = Self::get_fiat_price(&peg_four_currency_id); + let peg_five_price = Self::get_fiat_price(&peg_five_currency_id); + let peg_six_price = Self::get_fiat_price(&peg_six_currency_id); + let peg_seven_price = Self::get_fiat_price(&peg_seven_currency_id); + let peg_eight_price = Self::get_fiat_price(&peg_eight_currency_id); + let peg_nine_price = Self::get_fiat_price(&peg_nine_currency_id); + let peg_ten_price = Self::get_fiat_price(&peg_ten_currency_id); let total_basket_worth: Price = peg_one_price + peg_two_price diff --git a/lib-serml/prices/src/mock.rs b/lib-serml/prices/src/mock.rs index 5bde469a0..71f18b3ad 100644 --- a/lib-serml/prices/src/mock.rs +++ b/lib-serml/prices/src/mock.rs @@ -37,35 +37,29 @@ pub type AccountId = u128; pub type BlockNumber = u64; // Currencies constants - CurrencyId/TokenSymbol -pub const DNAR: CurrencyId = CurrencyId::Token(TokenSymbol::DNAR); -pub const SDEX: CurrencyId = CurrencyId::Token(TokenSymbol::SDEX); // SettinDex +pub const DNAR: CurrencyId = CurrencyId::Token(TokenSymbol::DNAR); // The Setheum Dinar +pub const SDEX: CurrencyId = CurrencyId::Token(TokenSymbol::SDEX); // SettinDex pub const SETT: CurrencyId = CurrencyId::Token(TokenSymbol::SETT); // Setter - The Defacto stablecoin & settmint reserve asset pub const USDJ: CurrencyId = CurrencyId::Token(TokenSymbol::USDJ); // Setheum USD (US Dollar stablecoin) pub const GBPJ: CurrencyId = CurrencyId::Token(TokenSymbol::GBPJ); // Setheum GBP (Pound Sterling stablecoin) pub const EURJ: CurrencyId = CurrencyId::Token(TokenSymbol::EURJ); // Setheum EUR (Euro stablecoin) -pub const KWDJ: CurrencyId = CurrencyId::Token(TokenSymbol::KWDJ); // Setheum KWD (Kuwaiti Dinar stablecoin) -pub const JODJ: CurrencyId = CurrencyId::Token(TokenSymbol::JODJ); // Setheum JOD (Jordanian Dinar stablecoin) -pub const BHDJ: CurrencyId = CurrencyId::Token(TokenSymbol::BHDJ); // Setheum BHD (Bahraini Dirham stablecoin) -pub const KYDJ: CurrencyId = CurrencyId::Token(TokenSymbol::KYDJ); // Setheum KYD (Cayman Islands Dollar stablecoin) -pub const OMRJ: CurrencyId = CurrencyId::Token(TokenSymbol::OMRJ); // Setheum OMR (Omani Riyal stablecoin) pub const CHFJ: CurrencyId = CurrencyId::Token(TokenSymbol::CHFJ); // Setheum CHF (Swiss Franc stablecoin) -pub const GIPJ: CurrencyId = CurrencyId::Token(TokenSymbol::GIPJ); // Setheum GIP (Gibraltar Pound stablecoin) // LP tokens constants - CurrencyId/TokenSymbol : Dex Shares pub const LP_CHFJ_USDJ: CurrencyId = CurrencyId::DexShare(TokenSymbol::CHFJ, TokenSymbol::USDJ); pub const LP_USDJ_DNAR: CurrencyId = CurrencyId::DexShare(TokenSymbol::USDJ, TokenSymbol::DNAR); -// Currencies constants - FiatCurrencyIds -pub const USD: FiatCurrencyId = USD; // 1. US Dollar (Fiat - only for price feed) -pub const GBP: FiatCurrencyId = GBP; // 2. Pound Sterling (Fiat - only for price feed) -pub const EUR: FiatCurrencyId = EUR; // 3. Euro (Fiat - only for price feed) -pub const KWD: FiatCurrencyId = KWD; // 4. Kuwaiti Dinar (Fiat - only for price feed) -pub const JOD: FiatCurrencyId = JOD; // 5. Jordanian Dinar (Fiat - only for price feed) -pub const BHD: FiatCurrencyId = BHD; // 6. Bahraini Dirham (Fiat - only for price feed) -pub const KYD: FiatCurrencyId = KYD; // 7. Cayman Islands Dollar (Fiat - only for price feed) -pub const OMR: FiatCurrencyId = OMR; // 8. Omani Riyal (Fiat - only for price feed) -pub const CHF: FiatCurrencyId = CHF; // 9. Swiss Franc (Fiat - only for price feed) -pub const GIP: FiatCurrencyId = GIP; // 10. Gibraltar Pound (Fiat - only for price feed) +// Currencies constants - FiatCurrencyIds (CurrencyId/TokenSymbol) +pub const USD: FiatCurrencyId = USD; // 1. US Dollar (Fiat - only for Oracle price feed) +pub const GBP: FiatCurrencyId = GBP; // 2. Pound Sterling (Fiat - only for Oracle price feed) +pub const EUR: FiatCurrencyId = EUR; // 3. Euro (Fiat - only for Oracle price feed) +pub const KWD: FiatCurrencyId = KWD; // 4. Kuwaiti Dinar (Fiat - only for Oracle price feed) +pub const JOD: FiatCurrencyId = JOD; // 5. Jordanian Dinar (Fiat - only for Oracle price feed) +pub const BHD: FiatCurrencyId = BHD; // 6. Bahraini Dirham (Fiat - only for Oracle price feed) +pub const KYD: FiatCurrencyId = KYD; // 7. Cayman Islands Dollar (Fiat - only for Oracle price feed) +pub const OMR: FiatCurrencyId = OMR; // 8. Omani Riyal (Fiat - only for Oracle price feed) +pub const CHF: FiatCurrencyId = CHF; // 9. Swiss Franc (Fiat - only for Oracle price feed) +pub const GIP: FiatCurrencyId = GIP; // 10. Gibraltar Pound (Fiat - only for Oracle price feed) mod setheum_prices { pub use super::super::*; @@ -213,15 +207,18 @@ ord_parameter_types! { parameter_types! { pub const GetSetterCurrencyId: CurrencyId = SETT; // Setter currency ticker is SETT pub const GetSettUSDCurrencyId: CurrencyId = USDJ; // SettUSD currency ticker is USDJ - pub const GetSettGBPCurrencyId: CurrencyId = GBPJ; // SettGBP currency ticker is GBPJ - pub const GetSettEURCurrencyId: CurrencyId = EURJ; // SettEUR currency ticker is EURJ - pub const GetSettKWDCurrencyId: CurrencyId = KWDJ; // SettKWD currency ticker is KWDJ - pub const GetSettJODCurrencyId: CurrencyId = JODJ; // SettJOD currency ticker is JODJ - pub const GetSettBHDCurrencyId: CurrencyId = BHDJ; // SettBHD currency ticker is BHDJ - pub const GetSettKYDCurrencyId: CurrencyId = KYDJ; // SettKYD currency ticker is KYDJ - pub const GetSettOMRCurrencyId: CurrencyId = OMRJ; // SettOMR currency ticker is OMRJ - pub const GetSettCHFCurrencyId: CurrencyId = CHFJ; // SettCHF currency ticker is CHFJ - pub const GetSettGIPCurrencyId: CurrencyId = GIPJ; // SettGIP currency ticker is GIPJ + + pub const GetSetterPegOneCurrencyId: CurrencyId = GBP; // Fiat pegs of the Setter (SETT). + pub const GetSetterPegTwoCurrencyId: CurrencyId = EUR; // Fiat pegs of the Setter (SETT). + pub const GetSetterPegThreeCurrencyId: CurrencyId = KWD; // Fiat pegs of the Setter (SETT). + pub const GetSetterPegFourCurrencyId: CurrencyId = JOD; // Fiat pegs of the Setter (SETT). + pub const GetSetterPegFiveCurrencyId: CurrencyId = BHD; // Fiat pegs of the Setter (SETT). + pub const GetSetterPegSixCurrencyId: CurrencyId = KYD; // Fiat pegs of the Setter (SETT). + pub const GetSetterPegSevenCurrencyId: CurrencyId = OMR; // Fiat pegs of the Setter (SETT). + pub const GetSetterPegEightCurrencyId: CurrencyId = CHF; // Fiat pegs of the Setter (SETT). + pub const GetSetterPegNineCurrencyId: CurrencyId = GIP; // Fiat pegs of the Setter (SETT). + pub const GetSetterPegTenCurrencyId: CurrencyId = USD; // Fiat pegs of the Setter (SETT). + pub SettUSDFixedPrice: Price = Price::one(); // All prices are in USD. USDJ is pegged 1:1 to USD pub StableCurrencyIds: Vec = vec![ SETT, // Setter - The Defacto stablecoin & settmint reserve asset @@ -255,15 +252,16 @@ impl Config for Runtime { type Source = MockDataProvider; type GetSetterCurrencyId = GetSetterCurrencyId; type GetSettUSDCurrencyId = GetSettUSDCurrencyId; - type GetSettGBPCurrencyId = GetSettGBPCurrencyId; - type GetSettEURCurrencyId = GetSettEURCurrencyId; - type GetSettKWDCurrencyId = GetSettKWDCurrencyId; - type GetSettJODCurrencyId = GetSettJODCurrencyId; - type GetSettBHDCurrencyId = GetSettBHDCurrencyId; - type GetSettKYDCurrencyId = GetSettKYDCurrencyId; - type GetSettOMRCurrencyId = GetSettOMRCurrencyId; - type GetSettCHFCurrencyId = GetSettCHFCurrencyId; - type GetSettGIPCurrencyId = GetSettGIPCurrencyId; + type GetSetterPegOneCurrencyId = GetSetterPegOneCurrencyId; + type GetSetterPegTwoCurrencyId = GetSetterPegTwoCurrencyId; + type GetSetterPegThreeCurrencyId = GetSetterPegThreeCurrencyId; + type GetSetterPegFourCurrencyId = GetSetterPegFourCurrencyId; + type GetSetterPegFiveCurrencyId = GetSetterPegFiveCurrencyId; + type GetSetterPegSixCurrencyId = GetSetterPegSixCurrencyId; + type GetSetterPegSevenCurrencyId = GetSetterPegSevenCurrencyId; + type GetSetterPegEightCurrencyId = GetSetterPegEightCurrencyId; + type GetSetterPegNineCurrencyId = GetSetterPegNineCurrencyId; + type GetSetterPegTenCurrencyId = GetSetterPegTenCurrencyId; type SettUSDFixedPrice = SettUSDFixedPrice; type StableCurrencyIds = StableCurrencyIds; type FiatCurrencyIds = FiatCurrencyIds; diff --git a/lib-serml/support/src/lib.rs b/lib-serml/support/src/lib.rs index 279604bd9..b72719b80 100644 --- a/lib-serml/support/src/lib.rs +++ b/lib-serml/support/src/lib.rs @@ -261,7 +261,8 @@ pub trait SerpTreasuryExtended: SerpTreasury { } pub trait PriceProvider { - fn get_fiat_price(fiat_id: FiatCurrencyId, currency_id: CurrencyId) -> Option; + fn get_fiat_price(fiat_currency_id: CurrencyId) -> Option; + fn get_peg_price(currency_id: CurrencyId) -> Option; fn get_setheum_usd_fixed_price() -> Option; fn get_stablecoin_fixed_price(currency_id: CurrencyId) -> Option; fn get_stablecoin_market_price(currency_id: CurrencyId) -> Option; From 935251e25bd03ae63b23024b03cfa88852ee5c26 Mon Sep 17 00:00:00 2001 From: Muhammad-Jibril Date: Mon, 21 Jun 2021 04:44:42 +0800 Subject: [PATCH 7/8] update currencies --- lib-serml/prices/src/mock.rs | 226 ++++++++++++++++++++++------ lib-serml/serp-treasury/src/mock.rs | 55 +++++-- 2 files changed, 225 insertions(+), 56 deletions(-) diff --git a/lib-serml/prices/src/mock.rs b/lib-serml/prices/src/mock.rs index 71f18b3ad..8face57da 100644 --- a/lib-serml/prices/src/mock.rs +++ b/lib-serml/prices/src/mock.rs @@ -37,29 +37,105 @@ pub type AccountId = u128; pub type BlockNumber = u64; // Currencies constants - CurrencyId/TokenSymbol -pub const DNAR: CurrencyId = CurrencyId::Token(TokenSymbol::DNAR); // The Setheum Dinar -pub const SDEX: CurrencyId = CurrencyId::Token(TokenSymbol::SDEX); // SettinDex -pub const SETT: CurrencyId = CurrencyId::Token(TokenSymbol::SETT); // Setter - The Defacto stablecoin & settmint reserve asset -pub const USDJ: CurrencyId = CurrencyId::Token(TokenSymbol::USDJ); // Setheum USD (US Dollar stablecoin) -pub const GBPJ: CurrencyId = CurrencyId::Token(TokenSymbol::GBPJ); // Setheum GBP (Pound Sterling stablecoin) -pub const EURJ: CurrencyId = CurrencyId::Token(TokenSymbol::EURJ); // Setheum EUR (Euro stablecoin) -pub const CHFJ: CurrencyId = CurrencyId::Token(TokenSymbol::CHFJ); // Setheum CHF (Swiss Franc stablecoin) +pub const DNAR: CurrencyId = CurrencyId::Token(TokenSymbol::DNAR); +pub const SDEX: CurrencyId = CurrencyId::Token(TokenSymbol::SDEX); +pub const SETT: CurrencyId = CurrencyId::Token(TokenSymbol::SETT); +pub const AEDJ: CurrencyId = CurrencyId::Token(TokenSymbol::AEDJ); +pub const ARSJ: CurrencyId = CurrencyId::Token(TokenSymbol::ARSJ); +pub const AUDJ: CurrencyId = CurrencyId::Token(TokenSymbol::AUDJ); +pub const BRLJ: CurrencyId = CurrencyId::Token(TokenSymbol::BRLJ); +pub const CADJ: CurrencyId = CurrencyId::Token(TokenSymbol::CADJ); +pub const CHFJ: CurrencyId = CurrencyId::Token(TokenSymbol::CHFJ); +pub const CLPJ: CurrencyId = CurrencyId::Token(TokenSymbol::CLPJ); +pub const CNYJ: CurrencyId = CurrencyId::Token(TokenSymbol::CNYJ); +pub const COPJ: CurrencyId = CurrencyId::Token(TokenSymbol::COPJ); +pub const EURJ: CurrencyId = CurrencyId::Token(TokenSymbol::EURJ); +pub const GBPJ: CurrencyId = CurrencyId::Token(TokenSymbol::GBPJ); +pub const HKDJ: CurrencyId = CurrencyId::Token(TokenSymbol::HKDJ); +pub const HUFJ: CurrencyId = CurrencyId::Token(TokenSymbol::HUFJ); +pub const IDRJ: CurrencyId = CurrencyId::Token(TokenSymbol::IDRJ); +pub const IRRJ: CurrencyId = CurrencyId::Token(TokenSymbol::IRRJ); +pub const JPYJ: CurrencyId = CurrencyId::Token(TokenSymbol::JPYJ); +pub const KESJ: CurrencyId = CurrencyId::Token(TokenSymbol::KESJ); +pub const KRWJ: CurrencyId = CurrencyId::Token(TokenSymbol::KRWJ); +pub const KZTJ: CurrencyId = CurrencyId::Token(TokenSymbol::KZTJ); +pub const MXNJ: CurrencyId = CurrencyId::Token(TokenSymbol::MXNJ); +pub const MYRJ: CurrencyId = CurrencyId::Token(TokenSymbol::MYRJ); +pub const NGNJ: CurrencyId = CurrencyId::Token(TokenSymbol::NGNJ); +pub const NOKJ: CurrencyId = CurrencyId::Token(TokenSymbol::NOKJ); +pub const NZDJ: CurrencyId = CurrencyId::Token(TokenSymbol::NZDJ); +pub const PENJ: CurrencyId = CurrencyId::Token(TokenSymbol::PENJ); +pub const PHPJ: CurrencyId = CurrencyId::Token(TokenSymbol::PHPJ); +pub const PKRJ: CurrencyId = CurrencyId::Token(TokenSymbol::PKRJ); +pub const PLNJ: CurrencyId = CurrencyId::Token(TokenSymbol::PLNJ); +pub const QARJ: CurrencyId = CurrencyId::Token(TokenSymbol::QARJ); +pub const RONJ: CurrencyId = CurrencyId::Token(TokenSymbol::RONJ); +pub const RUBJ: CurrencyId = CurrencyId::Token(TokenSymbol::RUBJ); +pub const SARJ: CurrencyId = CurrencyId::Token(TokenSymbol::SARJ); +pub const SEKJ: CurrencyId = CurrencyId::Token(TokenSymbol::SEKJ); +pub const SGDJ: CurrencyId = CurrencyId::Token(TokenSymbol::SGDJ); +pub const THBJ: CurrencyId = CurrencyId::Token(TokenSymbol::THBJ); +pub const TRYJ: CurrencyId = CurrencyId::Token(TokenSymbol::TRYJ); +pub const TWDJ: CurrencyId = CurrencyId::Token(TokenSymbol::TWDJ); +pub const TZSJ: CurrencyId = CurrencyId::Token(TokenSymbol::TZSJ); +pub const UAHJ: CurrencyId = CurrencyId::Token(TokenSymbol::UAHJ); +pub const USDJ: CurrencyId = CurrencyId::Token(TokenSymbol::USDJ); +pub const ZARJ: CurrencyId = CurrencyId::Token(TokenSymbol::ZARJ); // LP tokens constants - CurrencyId/TokenSymbol : Dex Shares pub const LP_CHFJ_USDJ: CurrencyId = CurrencyId::DexShare(TokenSymbol::CHFJ, TokenSymbol::USDJ); pub const LP_USDJ_DNAR: CurrencyId = CurrencyId::DexShare(TokenSymbol::USDJ, TokenSymbol::DNAR); // Currencies constants - FiatCurrencyIds (CurrencyId/TokenSymbol) -pub const USD: FiatCurrencyId = USD; // 1. US Dollar (Fiat - only for Oracle price feed) -pub const GBP: FiatCurrencyId = GBP; // 2. Pound Sterling (Fiat - only for Oracle price feed) -pub const EUR: FiatCurrencyId = EUR; // 3. Euro (Fiat - only for Oracle price feed) -pub const KWD: FiatCurrencyId = KWD; // 4. Kuwaiti Dinar (Fiat - only for Oracle price feed) -pub const JOD: FiatCurrencyId = JOD; // 5. Jordanian Dinar (Fiat - only for Oracle price feed) -pub const BHD: FiatCurrencyId = BHD; // 6. Bahraini Dirham (Fiat - only for Oracle price feed) -pub const KYD: FiatCurrencyId = KYD; // 7. Cayman Islands Dollar (Fiat - only for Oracle price feed) -pub const OMR: FiatCurrencyId = OMR; // 8. Omani Riyal (Fiat - only for Oracle price feed) -pub const CHF: FiatCurrencyId = CHF; // 9. Swiss Franc (Fiat - only for Oracle price feed) -pub const GIP: FiatCurrencyId = GIP; // 10. Gibraltar Pound (Fiat - only for Oracle price feed) +pub const AED: CurrencyId = CurrencyId::Token(TokenSymbol::AED); +pub const ARS: CurrencyId = CurrencyId::Token(TokenSymbol::ARS); +pub const AUD: CurrencyId = CurrencyId::Token(TokenSymbol::AUD); +pub const BRL: CurrencyId = CurrencyId::Token(TokenSymbol::BRL); +pub const CAD: CurrencyId = CurrencyId::Token(TokenSymbol::CAD); +pub const CHF: CurrencyId = CurrencyId::Token(TokenSymbol::CHF); +pub const CLP: CurrencyId = CurrencyId::Token(TokenSymbol::CLP); +pub const CNY: CurrencyId = CurrencyId::Token(TokenSymbol::CNY); +pub const COP: CurrencyId = CurrencyId::Token(TokenSymbol::COP); +pub const EUR: CurrencyId = CurrencyId::Token(TokenSymbol::EUR); +pub const GBP: CurrencyId = CurrencyId::Token(TokenSymbol::GBP); +pub const HKD: CurrencyId = CurrencyId::Token(TokenSymbol::HKD); +pub const HUF: CurrencyId = CurrencyId::Token(TokenSymbol::HUF); +pub const IDR: CurrencyId = CurrencyId::Token(TokenSymbol::IDR); +pub const IRR: CurrencyId = CurrencyId::Token(TokenSymbol::IRR); +pub const JPY: CurrencyId = CurrencyId::Token(TokenSymbol::JPY); +pub const KES: CurrencyId = CurrencyId::Token(TokenSymbol::KES); +pub const KRW: CurrencyId = CurrencyId::Token(TokenSymbol::KRW); +pub const KZT: CurrencyId = CurrencyId::Token(TokenSymbol::KZT); +pub const MXN: CurrencyId = CurrencyId::Token(TokenSymbol::MXN); +pub const MYR: CurrencyId = CurrencyId::Token(TokenSymbol::MYR); +pub const NGN: CurrencyId = CurrencyId::Token(TokenSymbol::NGN); +pub const NOK: CurrencyId = CurrencyId::Token(TokenSymbol::NOK); +pub const NZD: CurrencyId = CurrencyId::Token(TokenSymbol::NZD); +pub const PEN: CurrencyId = CurrencyId::Token(TokenSymbol::PEN); +pub const PHP: CurrencyId = CurrencyId::Token(TokenSymbol::PHP); +pub const PKR: CurrencyId = CurrencyId::Token(TokenSymbol::PKR); +pub const PLN: CurrencyId = CurrencyId::Token(TokenSymbol::PLN); +pub const QAR: CurrencyId = CurrencyId::Token(TokenSymbol::QAR); +pub const RON: CurrencyId = CurrencyId::Token(TokenSymbol::RON); +pub const RUB: CurrencyId = CurrencyId::Token(TokenSymbol::RUB); +pub const SAR: CurrencyId = CurrencyId::Token(TokenSymbol::SAR); +pub const SEK: CurrencyId = CurrencyId::Token(TokenSymbol::SEK); +pub const SGD: CurrencyId = CurrencyId::Token(TokenSymbol::SGD); +pub const THB: CurrencyId = CurrencyId::Token(TokenSymbol::THB); +pub const TRY: CurrencyId = CurrencyId::Token(TokenSymbol::TRY); +pub const TWD: CurrencyId = CurrencyId::Token(TokenSymbol::TWD); +pub const TZS: CurrencyId = CurrencyId::Token(TokenSymbol::TZS); +pub const UAH: CurrencyId = CurrencyId::Token(TokenSymbol::UAH); +pub const USD: CurrencyId = CurrencyId::Token(TokenSymbol::USD); +pub const ZAR: CurrencyId = CurrencyId::Token(TokenSymbol::ZAR); +pub const CHF: CurrencyId = CurrencyId::Token(TokenSymbol::CHF); +pub const CHF: CurrencyId = CurrencyId::Token(TokenSymbol::CHF); +pub const KWD: CurrencyId = CurrencyId::Token(TokenSymbol::KWD); +pub const JOD: CurrencyId = CurrencyId::Token(TokenSymbol::JOD); +pub const BHD: CurrencyId = CurrencyId::Token(TokenSymbol::BHD); +pub const KYD: CurrencyId = CurrencyId::Token(TokenSymbol::KYD); +pub const OMR: CurrencyId = CurrencyId::Token(TokenSymbol::OMR); +pub const GIP: CurrencyId = CurrencyId::Token(TokenSymbol::GIP); mod setheum_prices { pub use super::super::*; @@ -177,13 +253,7 @@ parameter_type_with_key! { &USDJ => &USD, &GBPJ => &GBP, &EURJ => &EUR, - &KWDJ => &KWD, - &JODJ => &JOD, - &BHDJ => &BHD, - &KYDJ => &KYD, - &OMRJ => &OMR, &CHFJ => &CHF, - &GIPJ => &GIP, _ => 0, } }; @@ -221,29 +291,97 @@ parameter_types! { pub SettUSDFixedPrice: Price = Price::one(); // All prices are in USD. USDJ is pegged 1:1 to USD pub StableCurrencyIds: Vec = vec![ - SETT, // Setter - The Defacto stablecoin & settmint reserve asset - USDJ, // Setheum USD (US Dollar stablecoin) - GBPJ, // Setheum GBP (Pound Sterling stablecoin) - EURJ, // Setheum EUR (Euro stablecoin) - KWDJ, // Setheum KWD (Kuwaiti Dinar stablecoin) - JODJ, // Setheum JOD (Jordanian Dinar stablecoin) - BHDJ, // Setheum BHD (Bahraini Dirham stablecoin) - KYDJ, // Setheum KYD (Cayman Islands Dollar stablecoin) - OMRJ, // Setheum OMR (Omani Riyal stablecoin) - CHFJ, // Setheum CHF (Swiss Franc stablecoin) - GIPJ, // Setheum GIP (Gibraltar Pound stablecoin) + SETT, + AEDJ, + ARSJ, + AUDJ, + BRLJ, + CADJ, + CHFJ, + CLPJ, + CNYJ, + COPJ, + EURJ, + GBPJ, + HKDJ, + HUFJ, + IDRJ, + IRRJ, + JPYJ, + KESJ, + KRWJ, + KZTJ, + MXNJ, + MYRJ, + NGNJ, + NOKJ, + NZDJ, + PENJ, + PHPJ, + PKRJ, + PLNJ, + QARJ, + RONJ, + RUBJ, + SARJ, + SEKJ, + SGDJ, + THBJ, + TRYJ, + TWDJ, + TZSJ, + UAHJ, + USDJ, + ZARJ, ]; pub FiatCurrencyIds: Vec = vec![ - USD, // US Dollar (Fiat - only for price feed) - GBP, // Pound Sterling (Fiat - only for price feed) - EUR, // Euro (Fiat - only for price feed) - KWD, // Kuwaiti Dinar (Fiat - only for price feed) - JOD, // Jordanian Dinar (Fiat - only for price feed) - BHD, // Bahraini Dirham (Fiat - only for price feed) - KYD, // Cayman Islands Dollar (Fiat - only for price feed) - OMR, // Omani Riyal (Fiat - only for price feed) - CHF, // Swiss Franc (Fiat - only for price feed) - GIP, // Gibraltar Pound (Fiat - only for price feed) + AED, + ARS, + AUD, + BRL, + CAD, + CHF, + CLP, + CNY, + COP, + EUR, + GBP, + HKD, + HUF, + IDR, + IRR, + JPY, + KES, + KRW, + KZT, + MXN, + MYR, + NGN, + NOK, + NZD, + PEN, + PHP, + PKR, + PLN, + QAR, + RON, + RUB, + SAR, + SEK, + SGD, + THB, + TRY, + TWD, + TZS, + UAH, + USD, + ZAR, + KWD, + JOD, + BHD, + KYD, + OMR, + GIP, ]; } diff --git a/lib-serml/serp-treasury/src/mock.rs b/lib-serml/serp-treasury/src/mock.rs index 2f7ce3bbf..9d98492d6 100644 --- a/lib-serml/serp-treasury/src/mock.rs +++ b/lib-serml/serp-treasury/src/mock.rs @@ -39,18 +39,49 @@ pub const BOB: AccountId = 1; // Currencies constants - CurrencyId/TokenSymbol pub const DNAR: CurrencyId = CurrencyId::Token(TokenSymbol::DNAR); -pub const SDEX: CurrencyId = CurrencyId::Token(TokenSymbol::SDEX); // SettinDex -pub const SETT: CurrencyId = CurrencyId::Token(TokenSymbol::SETT); // Setter - The Defacto stablecoin & settmint reserve asset -pub const USDJ: CurrencyId = CurrencyId::Token(TokenSymbol::USDJ); // Setheum USD (US Dollar stablecoin) -pub const GBPJ: CurrencyId = CurrencyId::Token(TokenSymbol::GBPJ); // Setheum GBP (Pound Sterling stablecoin) -pub const EURJ: CurrencyId = CurrencyId::Token(TokenSymbol::EURJ); // Setheum EUR (Euro stablecoin) -pub const KWDJ: CurrencyId = CurrencyId::Token(TokenSymbol::KWDJ); // Setheum KWD (Kuwaiti Dinar stablecoin) -pub const JODJ: CurrencyId = CurrencyId::Token(TokenSymbol::JODJ); // Setheum JOD (Jordanian Dinar stablecoin) -pub const BHDJ: CurrencyId = CurrencyId::Token(TokenSymbol::BHDJ); // Setheum BHD (Bahraini Dirham stablecoin) -pub const KYDJ: CurrencyId = CurrencyId::Token(TokenSymbol::KYDJ); // Setheum KYD (Cayman Islands Dollar stablecoin) -pub const OMRJ: CurrencyId = CurrencyId::Token(TokenSymbol::OMRJ); // Setheum OMR (Omani Riyal stablecoin) -pub const CHFJ: CurrencyId = CurrencyId::Token(TokenSymbol::CHFJ); // Setheum CHF (Swiss Franc stablecoin) -pub const GIPJ: CurrencyId = CurrencyId::Token(TokenSymbol::GIPJ); // Setheum GIP (Gibraltar Pound stablecoin) +pub const SDEX: CurrencyId = CurrencyId::Token(TokenSymbol::SDEX); +pub const SETT: CurrencyId = CurrencyId::Token(TokenSymbol::SETT); +pub const AEDJ: CurrencyId = CurrencyId::Token(TokenSymbol::AEDJ); +pub const ARSJ: CurrencyId = CurrencyId::Token(TokenSymbol::ARSJ); +pub const AUDJ: CurrencyId = CurrencyId::Token(TokenSymbol::AUDJ); +pub const BRLJ: CurrencyId = CurrencyId::Token(TokenSymbol::BRLJ); +pub const CADJ: CurrencyId = CurrencyId::Token(TokenSymbol::CADJ); +pub const CHFJ: CurrencyId = CurrencyId::Token(TokenSymbol::CHFJ); +pub const CLPJ: CurrencyId = CurrencyId::Token(TokenSymbol::CLPJ); +pub const CNYJ: CurrencyId = CurrencyId::Token(TokenSymbol::CNYJ); +pub const COPJ: CurrencyId = CurrencyId::Token(TokenSymbol::COPJ); +pub const EURJ: CurrencyId = CurrencyId::Token(TokenSymbol::EURJ); +pub const GBPJ: CurrencyId = CurrencyId::Token(TokenSymbol::GBPJ); +pub const HKDJ: CurrencyId = CurrencyId::Token(TokenSymbol::HKDJ); +pub const HUFJ: CurrencyId = CurrencyId::Token(TokenSymbol::HUFJ); +pub const IDRJ: CurrencyId = CurrencyId::Token(TokenSymbol::IDRJ); +pub const IRRJ: CurrencyId = CurrencyId::Token(TokenSymbol::IRRJ); +pub const JPYJ: CurrencyId = CurrencyId::Token(TokenSymbol::JPYJ); +pub const KESJ: CurrencyId = CurrencyId::Token(TokenSymbol::KESJ); +pub const KRWJ: CurrencyId = CurrencyId::Token(TokenSymbol::KRWJ); +pub const KZTJ: CurrencyId = CurrencyId::Token(TokenSymbol::KZTJ); +pub const MXNJ: CurrencyId = CurrencyId::Token(TokenSymbol::MXNJ); +pub const MYRJ: CurrencyId = CurrencyId::Token(TokenSymbol::MYRJ); +pub const NGNJ: CurrencyId = CurrencyId::Token(TokenSymbol::NGNJ); +pub const NOKJ: CurrencyId = CurrencyId::Token(TokenSymbol::NOKJ); +pub const NZDJ: CurrencyId = CurrencyId::Token(TokenSymbol::NZDJ); +pub const PENJ: CurrencyId = CurrencyId::Token(TokenSymbol::PENJ); +pub const PHPJ: CurrencyId = CurrencyId::Token(TokenSymbol::PHPJ); +pub const PKRJ: CurrencyId = CurrencyId::Token(TokenSymbol::PKRJ); +pub const PLNJ: CurrencyId = CurrencyId::Token(TokenSymbol::PLNJ); +pub const QARJ: CurrencyId = CurrencyId::Token(TokenSymbol::QARJ); +pub const RONJ: CurrencyId = CurrencyId::Token(TokenSymbol::RONJ); +pub const RUBJ: CurrencyId = CurrencyId::Token(TokenSymbol::RUBJ); +pub const SARJ: CurrencyId = CurrencyId::Token(TokenSymbol::SARJ); +pub const SEKJ: CurrencyId = CurrencyId::Token(TokenSymbol::SEKJ); +pub const SGDJ: CurrencyId = CurrencyId::Token(TokenSymbol::SGDJ); +pub const THBJ: CurrencyId = CurrencyId::Token(TokenSymbol::THBJ); +pub const TRYJ: CurrencyId = CurrencyId::Token(TokenSymbol::TRYJ); +pub const TWDJ: CurrencyId = CurrencyId::Token(TokenSymbol::TWDJ); +pub const TZSJ: CurrencyId = CurrencyId::Token(TokenSymbol::TZSJ); +pub const UAHJ: CurrencyId = CurrencyId::Token(TokenSymbol::UAHJ); +pub const USDJ: CurrencyId = CurrencyId::Token(TokenSymbol::USDJ); +pub const ZARJ: CurrencyId = CurrencyId::Token(TokenSymbol::ZARJ); mod serp_treasury { pub use super::super::*; From a0ec139164a9a1042dbbe499787a41d019d804b6 Mon Sep 17 00:00:00 2001 From: Muhammad-Jibril Date: Mon, 21 Jun 2021 05:17:10 +0800 Subject: [PATCH 8/8] Update StandardCurrencyIds --- lib-serml/serp-treasury/src/lib.rs | 1 + lib-serml/serp-treasury/src/mock.rs | 53 +++++++++++++++++++++------ lib-serml/setters/src/mock.rs | 51 +++++++++++++++++++++----- lib-serml/settmint-engine/src/mock.rs | 51 +++++++++++++++++++++----- lib-serml/settway/src/mock.rs | 51 +++++++++++++++++++++----- 5 files changed, 166 insertions(+), 41 deletions(-) diff --git a/lib-serml/serp-treasury/src/lib.rs b/lib-serml/serp-treasury/src/lib.rs index b71e545d2..34800292a 100644 --- a/lib-serml/serp-treasury/src/lib.rs +++ b/lib-serml/serp-treasury/src/lib.rs @@ -489,6 +489,7 @@ impl SerpTreasury for Pallet { Ok(()) } + /// TODO: Move `get_peg_price_difference` here and fn check_all_stablecoin_stability() -> DispatchResult { /// pegged to US Dollar (USD) let peg_one_currency_id: CurrencyId = T::GetSettUSDCurrencyId::get(); diff --git a/lib-serml/serp-treasury/src/mock.rs b/lib-serml/serp-treasury/src/mock.rs index 9d98492d6..3a4cf0f25 100644 --- a/lib-serml/serp-treasury/src/mock.rs +++ b/lib-serml/serp-treasury/src/mock.rs @@ -222,17 +222,48 @@ ord_parameter_types! { parameter_types! { pub StableCurrencyIds: Vec = vec![ - SETT, // Setter - The Defacto stablecoin & settmint reserve asset - USDJ, // Setheum USD (US Dollar stablecoin) - GBPJ, // Setheum GBP (Pound Sterling stablecoin) - EURJ, // Setheum EUR (Euro stablecoin) - KWDJ, // Setheum KWD (Kuwaiti Dinar stablecoin) - JODJ, // Setheum JOD (Jordanian Dinar stablecoin) - BHDJ, // Setheum BHD (Bahraini Dirham stablecoin) - KYDJ, // Setheum KYD (Cayman Islands Dollar stablecoin) - OMRJ, // Setheum OMR (Omani Riyal stablecoin) - CHFJ, // Setheum CHF (Swiss Franc stablecoin) - GIPJ, // Setheum GIP (Gibraltar Pound stablecoin) + SETT, + AEDJ, + ARSJ, + AUDJ, + BRLJ, + CADJ, + CHFJ, + CLPJ, + CNYJ, + COPJ, + EURJ, + GBPJ, + HKDJ, + HUFJ, + IDRJ, + IRRJ, + JPYJ, + KESJ, + KRWJ, + KZTJ, + MXNJ, + MYRJ, + NGNJ, + NOKJ, + NZDJ, + PENJ, + PHPJ, + PKRJ, + PLNJ, + QARJ, + RONJ, + RUBJ, + SARJ, + SEKJ, + SGDJ, + THBJ, + TRYJ, + TWDJ, + TZSJ, + UAHJ, + USDJ, + ZARJ, ]; pub const GetSetterCurrencyId: CurrencyId = SETT; // Setter currency ticker is SETT pub const GetSettUSDCurrencyId: CurrencyId = USDJ; // SettUSD currency ticker is USDJ diff --git a/lib-serml/setters/src/mock.rs b/lib-serml/setters/src/mock.rs index 114edaf86..f0ecd9f54 100644 --- a/lib-serml/setters/src/mock.rs +++ b/lib-serml/setters/src/mock.rs @@ -268,16 +268,47 @@ impl StandardValidator for MockStandard parameter_types! { pub StandardCurrencyIds: Vec = vec![ - USDJ, // Setheum USD (US Dollar stablecoin) - GBPJ, // Setheum GBP (Pound Sterling stablecoin) - EURJ, // Setheum EUR (Euro stablecoin) - KWDJ, // Setheum KWD (Kuwaiti Dinar stablecoin) - JODJ, // Setheum JOD (Jordanian Dinar stablecoin) - BHDJ, // Setheum BHD (Bahraini Dirham stablecoin) - KYDJ, // Setheum KYD (Cayman Islands Dollar stablecoin) - OMRJ, // Setheum OMR (Omani Riyal stablecoin) - CHFJ, // Setheum CHF (Swiss Franc stablecoin) - GIPJ, // Setheum GIP (Gibraltar Pound stablecoin) + AEDJ, + ARSJ, + AUDJ, + BRLJ, + CADJ, + CHFJ, + CLPJ, + CNYJ, + COPJ, + EURJ, + GBPJ, + HKDJ, + HUFJ, + IDRJ, + IRRJ, + JPYJ, + KESJ, + KRWJ, + KZTJ, + MXNJ, + MYRJ, + NGNJ, + NOKJ, + NZDJ, + PENJ, + PHPJ, + PKRJ, + PLNJ, + QARJ, + RONJ, + RUBJ, + SARJ, + SEKJ, + SGDJ, + THBJ, + TRYJ, + TWDJ, + TZSJ, + UAHJ, + USDJ, + ZARJ, ]; pub const GetReserveCurrencyId: CurrencyId = SETT; pub const SettersPalletId: PalletId = PalletId(*b"set/setter"); diff --git a/lib-serml/settmint-engine/src/mock.rs b/lib-serml/settmint-engine/src/mock.rs index 3ff49beb4..f4ebec386 100644 --- a/lib-serml/settmint-engine/src/mock.rs +++ b/lib-serml/settmint-engine/src/mock.rs @@ -308,16 +308,47 @@ ord_parameter_types! { parameter_types! { pub StandardCurrencyIds: Vec = vec![ - USDJ, // Setheum USD (US Dollar stablecoin) - GBPJ, // Setheum GBP (Pound Sterling stablecoin) - EURJ, // Setheum EUR (Euro stablecoin) - KWDJ, // Setheum KWD (Kuwaiti Dinar stablecoin) - JODJ, // Setheum JOD (Jordanian Dinar stablecoin) - BHDJ, // Setheum BHD (Bahraini Dirham stablecoin) - KYDJ, // Setheum KYD (Cayman Islands Dollar stablecoin) - OMRJ, // Setheum OMR (Omani Riyal stablecoin) - CHFJ, // Setheum CHF (Swiss Franc stablecoin) - GIPJ, // Setheum GIP (Gibraltar Pound stablecoin) + AEDJ, + ARSJ, + AUDJ, + BRLJ, + CADJ, + CHFJ, + CLPJ, + CNYJ, + COPJ, + EURJ, + GBPJ, + HKDJ, + HUFJ, + IDRJ, + IRRJ, + JPYJ, + KESJ, + KRWJ, + KZTJ, + MXNJ, + MYRJ, + NGNJ, + NOKJ, + NZDJ, + PENJ, + PHPJ, + PKRJ, + PLNJ, + QARJ, + RONJ, + RUBJ, + SARJ, + SEKJ, + SGDJ, + THBJ, + TRYJ, + TWDJ, + TZSJ, + UAHJ, + USDJ, + ZARJ, ]; pub const GetReserveCurrencyId: CurrencyId = SETT; pub DefaultStandardExchangeRate: ExchangeRate = ExchangeRate::one(); diff --git a/lib-serml/settway/src/mock.rs b/lib-serml/settway/src/mock.rs index 714d297fb..f41a7d9f6 100644 --- a/lib-serml/settway/src/mock.rs +++ b/lib-serml/settway/src/mock.rs @@ -265,16 +265,47 @@ impl serp_treasury::Config for Runtime { parameter_types! { pub StandardCurrencyIds: Vec = vec![ - USDJ, // Setheum USD (US Dollar stablecoin) - GBPJ, // Setheum GBP (Pound Sterling stablecoin) - EURJ, // Setheum EUR (Euro stablecoin) - KWDJ, // Setheum KWD (Kuwaiti Dinar stablecoin) - JODJ, // Setheum JOD (Jordanian Dinar stablecoin) - BHDJ, // Setheum BHD (Bahraini Dirham stablecoin) - KYDJ, // Setheum KYD (Cayman Islands Dollar stablecoin) - OMRJ, // Setheum OMR (Omani Riyal stablecoin) - CHFJ, // Setheum CHF (Swiss Franc stablecoin) - GIPJ, // Setheum GIP (Gibraltar Pound stablecoin) + AEDJ, + ARSJ, + AUDJ, + BRLJ, + CADJ, + CHFJ, + CLPJ, + CNYJ, + COPJ, + EURJ, + GBPJ, + HKDJ, + HUFJ, + IDRJ, + IRRJ, + JPYJ, + KESJ, + KRWJ, + KZTJ, + MXNJ, + MYRJ, + NGNJ, + NOKJ, + NZDJ, + PENJ, + PHPJ, + PKRJ, + PLNJ, + QARJ, + RONJ, + RUBJ, + SARJ, + SEKJ, + SGDJ, + THBJ, + TRYJ, + TWDJ, + TZSJ, + UAHJ, + USDJ, + ZARJ, ]; pub const GetReserveCurrencyId: CurrencyId = SETT; pub DefaultStandardExchangeRate: ExchangeRate = ExchangeRate::one();