diff --git a/README.md b/README.md index ed1f01d1c..d421a9197 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ DRAM("Setheum Dirham", 12) = 1, // Staking Reward and Governance Token - System #### The Setter - SERP Basket Stablecoin ``` - SETT("Setter", 12) = 2, + SETR("Setter", 12) = 2, ``` #### The SettCurrencies - SERP Stablecoins @@ -53,9 +53,9 @@ DRAM("Setheum Dirham", 12) = 1, // Staking Reward and Governance Token - System SARJ("Setheum Saudi Riyal", 12) = 12, ``` -1. The Setter - The Setter is a basket currency pegged to the Top 10 Strongest and most valuable currencies. It serves as the medium of Exchange and the Defacto stablecoin of the Setheum Ecosystem. All other Setheum system stablecoins orbit around the Setter (SETT) and the SettMint for minting Setheum Currencies (system stablecoins) accepts only the Setter as the Minting Reserve Asset. Only with the Setter (SETT) can a user participate in the DNAR Auctions to stabilize the price of the Setter, while the Setter is Auctioned to stabilize the price of all the other SettCurrencies (system stablecoins). It's the star that brightens many planets - 10 to be exact +1. The Setter - The Setter is a basket currency pegged to the Top 10 Strongest and most valuable currencies. It serves as the medium of Exchange and the Defacto stablecoin of the Setheum Ecosystem. All other Setheum system stablecoins orbit around the Setter (SETR) and the SettMint for minting Setheum Currencies (system stablecoins) accepts only the Setter as the Minting Reserve Asset. Only with the Setter (SETR) can a user participate in the DNAR Auctions to stabilize the price of the Setter, while the Setter is Auctioned to stabilize the price of all the other SettCurrencies (system stablecoins). It's the star that brightens many planets - 10 to be exact -2. [The SERP](./lib-serp) - The SERP (Setheum Elastic Reserve Protocol) is algorithmically responsible for stabilizing the prices of the Setheum Stable Currencies. No human interferrance is needed for this, it's all algorithmically handled by the SERP. The SERP is the backbone of Setheum, it is based on my TES (Token Elasticity of Supply) algorithm based on PES (Price Elasticity of Supply) such that the demand curve or price of a currency determines the supply serping point, meaning the supply curve of a SettCurrency will be adjusted according to the demand curve of that specific SettCurrency. The result will be burning or minting an amount equivalent to the serping point produced by the SERP-TES, the burning amount will be bought back by the SERP automatically through the built-in-DEX and the bought amount will be burnt to meet the satisfaction of the demand curve to prop the price back up to its peg, the opposite is done to lower the price of an under-supplied currency that is on demand and above its peg on the demand curve, for this the mint amount is divided into receipients including the SettPayTreasury where CashDrops are deposited for users to claim, the System Treasury under Governance, the Charity Fund stewarded by the Setheum Foundation, and the WelfareTreasury, more on the Welfare Treasury below. +2. [The SERP](./lib-serp) - The SERP (Setheum Elastic Reserve Protocol) is algorithmically responsible for stabilizing the prices of the Setheum Stable Currencies. No human interferrance is needed for this, it's all algorithmically handled by the SERP. The SERP is the backbone of Setheum, it is based on my TES (Token Elasticity of Supply) algorithm based on PES (Price Elasticity of Supply) such that the demand curve or price of a currency determines the supply serping point, meaning the supply curve of a SetCurrency will be adjusted according to the demand curve of that specific SetCurrency. The result will be burning or minting an amount equivalent to the serping point produced by the SERP-TES, the burning amount will be bought back by the SERP automatically through the built-in-DEX and the bought amount will be burnt to meet the satisfaction of the demand curve to prop the price back up to its peg, the opposite is done to lower the price of an under-supplied currency that is on demand and above its peg on the demand curve, for this the mint amount is divided into receipients including the SettPayTreasury where CashDrops are deposited for users to claim, the System Treasury under Governance, the Charity Fund stewarded by the Setheum Foundation, and the WelfareTreasury, more on the Welfare Treasury below. In The SERP and Setheum lingua, I coined these terms: * serp: to increase or decrease the supply of a Setheum stable Currency at its serping point in the curve, on either the x or y axis, the negative or the positive. @@ -63,7 +63,7 @@ In The SERP and Setheum lingua, I coined these terms: * serpdown: to decrease the supply of a Setheum stablecurrency at its serping point. 3. [The SettMint](./lib-serml/settmint) - The Settmint is partly inspired by the Maker Protocol (MakerDAO), except that SettMint is on a very different principle of Setheum that ought not to be violated. -SettMint is not a CDP but quite similar, as users can hold, authorize & transfer positions, users can reserve the Setter (SETT) to mint any SettCurrency of their choice without the need for over-collateralization, debt, interest rates, liquidation, or even stability fees. The stability of the Currencies is handles by the SERP, and the the Setter used as the reserve currency is also a SettCurrency (Setheum System Stablecoin) therefore eliminating position volatility and the risk of liquidation as all risk parameters have been eliminated with the Setter and Setheum's strong principle on the matters of the SettMint and Setheum's Monetary Policy. +SettMint is not a CDP but quite similar, as users can hold, authorize & transfer positions, users can reserve the Setter (SETR) to mint any SetCurrency of their choice without the need for over-collateralization, debt, interest rates, liquidation, or even stability fees. The stability of the Currencies is handles by the SERP, and the the Setter used as the reserve currency is also a SetCurrency (Setheum System Stablecoin) therefore eliminating position volatility and the risk of liquidation as all risk parameters have been eliminated with the Setter and Setheum's strong principle on the matters of the SettMint and Setheum's Monetary Policy. This is one of the reasons I see Setheum as one of the most Sophisticated Advanced Economic Systems yet so simple, easy to use and understand, and even easier to get started. 4. The SettPay - The SettPay is responsible for the CashDrops that are dispatched by the SERP to the claimants (transactors that claim cashdrops). It is under the governance of the "Financial Council". They decide how much percent claimants get based on how much they spent, these params are custom and governable for every Setheum System currency including the DNAR. For example, DNAR spenders get 2.58% cashdrop per claimed transaction if their spent amount is >= 10000 dollars, else if their spent amount is < 10000 dollars && >= 100 then they get 4% cashdrop, else if their spent amount is < 100 then they get 5% cashdrop. The Welfare Council can update these parameters by governance proposals and voting without the need for forking or even a runtime upgrade. diff --git a/lib-serml/evm/evm-manager/src/tests.rs b/lib-serml/evm/evm-manager/src/tests.rs index 13b6746ff..44cea89a3 100644 --- a/lib-serml/evm/evm-manager/src/tests.rs +++ b/lib-serml/evm/evm-manager/src/tests.rs @@ -114,7 +114,7 @@ fn name_works() { ); assert_eq!( - EvmCurrencyIdMapping::::name(CurrencyId::DexShare(DexShare::Token(TokenSymbol::DNAR), DexShare::Token(TokenSymbol::SETT))), + EvmCurrencyIdMapping::::name(CurrencyId::DexShare(DexShare::Token(TokenSymbol::DNAR), DexShare::Token(TokenSymbol::SETR))), Some(b"LP Setheum Dinar - Setter".to_vec()) ); diff --git a/lib-serml/serp/serp-prices/src/lib.rs b/lib-serml/serp/serp-prices/src/lib.rs index d2d63e576..cfc73b28d 100644 --- a/lib-serml/serp/serp-prices/src/lib.rs +++ b/lib-serml/serp/serp-prices/src/lib.rs @@ -22,7 +22,7 @@ //! //! The data from Oracle cannot be used in production, prices module will //! do some process and feed prices for setheum, this includes constructing -//! the Setter (SETT) currency basket price. +//! the Setter (SETR) currency basket price. //! Process include: //! - specify a fixed price for stable currencies //! - specify the Setter basket currency price @@ -68,7 +68,7 @@ pub mod module { type Source: DataProvider + DataFeeder; #[pallet::constant] - /// The Setter currency id, it should be SETT in Setheum. + /// The Setter currency id, it should be SETR in Setheum. type SetterCurrencyId: Get; #[pallet::constant] @@ -252,9 +252,9 @@ impl PriceProvider for Pallet { } } - /// get the exchange rate of a specific SettCurrency to USD + /// get the exchange rate of a specific SetCurrency to USD /// Note: this returns the price for 1 basic unit - /// For the SERP TO USE WHEN STABILISING SettCurrency prices. + /// For the SERP TO USE WHEN STABILISING SetCurrency prices. fn get_market_price(currency_id: CurrencyId) -> Option{ let maybe_feed_price = if let CurrencyId::DexShare(symbol_0, symbol_1) = currency_id { let token_0 = match symbol_0 { @@ -287,10 +287,10 @@ impl PriceProvider for Pallet { } } - /// get the exchange rate of a specific SettCurrency peg to USD + /// get the exchange rate of a specific SetCurrency peg to USD /// Note: this returns the price for 1 basic unit - /// For the SERP TO USE WHEN STABILISING SettCurrency peg prices. - /// The settcurrency_id matching to its peg, + /// For the SERP TO USE WHEN STABILISING SetCurrency peg prices. + /// The setcurrency_id matching to its peg, fn get_peg_price(currency_id: CurrencyId) -> Option { let maybe_feed_price = if currency_id == T::SetterCurrencyId::get() { Self::get_setter_price() @@ -337,9 +337,9 @@ impl PriceProvider for Pallet { } } - /// get the exchange rate of a specific SettCurrency peg to USD + /// get the exchange rate of a specific SetCurrency peg to USD /// Note: this returns the price for 1 basic unit - /// For the SERP TO USE WHEN STABILISING SettCurrency peg prices. + /// For the SERP TO USE WHEN STABILISING SetCurrency peg prices. fn get_setter_price() -> Option { if let (Some(price_a), Some(price_b), @@ -470,7 +470,7 @@ fn lp_token_fair_price( .map(Price::from_inner) } -/// Get the price of a Setter (SETT basket coin - basket of currencies) - +/// Get the price of a Setter (SETR basket coin - basket of currencies) - /// aggregate the setter price. /// the final price = total_price_of_basket(all currencies prices combined) - /// divided by the amount of currencies in the basket. diff --git a/lib-serml/serp/serp-prices/src/mock.rs b/lib-serml/serp/serp-prices/src/mock.rs index cb3696309..dc4e1b4f0 100644 --- a/lib-serml/serp/serp-prices/src/mock.rs +++ b/lib-serml/serp/serp-prices/src/mock.rs @@ -43,7 +43,7 @@ mod serp_prices { // Currencies constants - CurrencyId/TokenSymbol pub const DNAR: CurrencyId = CurrencyId::Token(TokenSymbol::DNAR); pub const DRAM: CurrencyId = CurrencyId::Token(TokenSymbol::DRAM); -pub const SETT: CurrencyId = CurrencyId::Token(TokenSymbol::SETT); +pub const SETR: CurrencyId = CurrencyId::Token(TokenSymbol::SETR); pub const AUDJ: CurrencyId = CurrencyId::Token(TokenSymbol::AUDJ); pub const CADJ: CurrencyId = CurrencyId::Token(TokenSymbol::CADJ); pub const EURJ: CurrencyId = CurrencyId::Token(TokenSymbol::EURJ); @@ -223,7 +223,7 @@ ord_parameter_types! { } parameter_types! { - pub const SetterCurrencyId: CurrencyId = SETT; // Setter currency ticker is SETT. + pub const SetterCurrencyId: CurrencyId = SETR; // Setter currency ticker is SETR. pub const GetSettUSDCurrencyId: CurrencyId = USDJ; // SettUSD currency ticker is USDJ. pub const GetFiatAUDCurrencyId: CurrencyId = AUD; // The AUD Fiat currency denomination. pub const GetFiatCADCurrencyId: CurrencyId = CAD; // The CAD Fiat currency denomination. @@ -237,20 +237,20 @@ parameter_types! { pub const GetFiatUSDCurrencyId: CurrencyId = USD; // The USD Fiat currency denomination. pub FiatUsdFixedPrice: Price = Price::one(); // Fixed 1 USD Fiat denomination for pricing. - 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 const GetSetterPegOneCurrencyId: CurrencyId = GBP; // Fiat pegs of the Setter (SETR). + pub const GetSetterPegTwoCurrencyId: CurrencyId = EUR; // Fiat pegs of the Setter (SETR). + pub const GetSetterPegThreeCurrencyId: CurrencyId = KWD; // Fiat pegs of the Setter (SETR). + pub const GetSetterPegFourCurrencyId: CurrencyId = JOD; // Fiat pegs of the Setter (SETR). + pub const GetSetterPegFiveCurrencyId: CurrencyId = BHD; // Fiat pegs of the Setter (SETR). + pub const GetSetterPegSixCurrencyId: CurrencyId = KYD; // Fiat pegs of the Setter (SETR). + pub const GetSetterPegSevenCurrencyId: CurrencyId = OMR; // Fiat pegs of the Setter (SETR). + pub const GetSetterPegEightCurrencyId: CurrencyId = CHF; // Fiat pegs of the Setter (SETR). + pub const GetSetterPegNineCurrencyId: CurrencyId = GIP; // Fiat pegs of the Setter (SETR). + pub const GetSetterPegTenCurrencyId: CurrencyId = USD; // Fiat pegs of the Setter (SETR). pub StableCurrencyIds: Vec = vec![ - SETT, AUDJ, CADJ, BTC, EURJ, GBPJ, + SETR, AUDJ, CADJ, BTC, EURJ, GBPJ, JPYJ, SARJ, SEKJ, SGDJ, USDJ, ]; pub FiatCurrencyIds: Vec = vec![ diff --git a/lib-serml/serp/serp-staking/README.md b/lib-serml/serp/serp-staking/README.md index a9a0ea431..ee0a6b3f8 100644 --- a/lib-serml/serp/serp-staking/README.md +++ b/lib-serml/serp/serp-staking/README.md @@ -1,7 +1,7 @@ # Staking Module Serp Staking supports multicurrency rewards, such that in Setheum, staking the -Dinar (DNAR) will reward the Dirham (DRAM) and the Setter (SETT). +Dinar (DNAR) will reward the Dirham (DRAM) and the Setter (SETR). The Staking module is used to manage funds at stake by network maintainers. diff --git a/lib-serml/serp/serp-staking/src/lib.rs b/lib-serml/serp/serp-staking/src/lib.rs index 0634f557c..37545f921 100644 --- a/lib-serml/serp/serp-staking/src/lib.rs +++ b/lib-serml/serp/serp-staking/src/lib.rs @@ -842,8 +842,8 @@ pub mod pallet { /// The Currency for managing assets related to the SERP (Setheum Elastic Reserve Protocol). type MultiCurrency: MultiCurrencyExtended; - /// The Incentive reward type (SETT) - /// SETT in Setheum. + /// The Incentive reward type (SETR) + /// SETR in Setheum. #[pallet::constant] type SetterCurrencyId: Get; diff --git a/lib-serml/serp/serp-staking/src/mock.rs b/lib-serml/serp/serp-staking/src/mock.rs index 2912df3c1..7e78aaf88 100644 --- a/lib-serml/serp/serp-staking/src/mock.rs +++ b/lib-serml/serp/serp-staking/src/mock.rs @@ -43,7 +43,7 @@ pub const BLOCK_TIME: u64 = 1000; // Currencies constants - CurrencyId/TokenSymbol pub const DNAR: CurrencyId = CurrencyId::Token(TokenSymbol::DNAR); pub const DRAM: CurrencyId = CurrencyId::Token(TokenSymbol::DRAM); -pub const SETT: CurrencyId = CurrencyId::Token(TokenSymbol::SETT); +pub const SETR: CurrencyId = CurrencyId::Token(TokenSymbol::SETR); /// The AccountId alias in this test module. pub(crate) type AccountId = u64; @@ -195,7 +195,7 @@ pub type AdaptedBasicCurrency = orml_currencies::BasicCurrencyAdapter::insert(0, stake); assert_ok!(Staking::payout_stakers(Origin::signed(1337), 11, 0)); assert_eq!(Tokens::total_balance(DRAM, &11), halved_stake * 2); - assert_eq!(Tokens::total_balance(SETT, &11), halved_stake * 2); + assert_eq!(Tokens::total_balance(SETR, &11), halved_stake * 2); // Set staker let _ = Balances::make_free_balance_be(&11, stake); @@ -2949,8 +2949,8 @@ fn claim_reward_at_the_last_era_and_no_double_claim_and_invalid_claim() { let init_balance_5 = Tokens::total_balance(DRAM, &5); let init_balance_50 = Tokens::total_balance(DRAM, &50); - let init_balance_5 = Tokens::total_balance(SETT, &5); - let init_balance_50 = Tokens::total_balance(SETT, &50); + let init_balance_5 = Tokens::total_balance(SETR, &5); + let init_balance_50 = Tokens::total_balance(SETR, &50); let part_for_10 = Perbill::from_rational::(1000, 1125); let part_for_100 = Perbill::from_rational::(125, 1125); @@ -2963,8 +2963,8 @@ fn claim_reward_at_the_last_era_and_no_double_claim_and_invalid_claim() { MockPriceSource::set_relative_price(Some(Price::one())); assert_eq!( - SerpPrices::get_relative_price(DRAM, SETT), - Some(Price::saturating_from_rational(1, 1)) // 1DRAM = 1SETT + SerpPrices::get_relative_price(DRAM, SETR), + Some(Price::saturating_from_rational(1, 1)) // 1DRAM = 1SETR ); // Check state @@ -3037,11 +3037,11 @@ fn claim_reward_at_the_last_era_and_no_double_claim_and_invalid_claim() { init_balance_50 + part_for_50 * (halved_total_payout_1 + halved_total_payout_2), ); assert_eq!( - Tokens::total_balance(SETT, &5), + Tokens::total_balance(SETR, &5), init_balance_5 + part_for_5 * (halved_total_payout_1 + halved_total_payout_2), ); assert_eq!( - Tokens::total_balance(SETT, &50), + Tokens::total_balance(SETR, &50), init_balance_50 + part_for_50 * (halved_total_payout_1 + halved_total_payout_2), ); }); @@ -3214,8 +3214,8 @@ fn test_payout_stakers() { MockPriceSource::set_relative_price(Some(Price::one())); assert_eq!( - PriceSource::get_relative_price(DRAM, SETT), - Some(Price::saturating_from_rational(1, 2)) // 1DRAM = 2SETT + PriceSource::get_relative_price(DRAM, SETR), + Some(Price::saturating_from_rational(1, 2)) // 1DRAM = 2SETR ); // Create a validator: @@ -3238,15 +3238,15 @@ fn test_payout_stakers() { // Top 64 nominators of validator 11 automatically paid out, including the validator // Validator payout goes to controller. assert!(Tokens::free_balance(DRAM, &10) > balance); - assert!(Tokens::free_balance(SETT, &10) > balance); + assert!(Tokens::free_balance(SETR, &10) > balance); for i in 36..100 { assert!(Tokens::free_balance(DRAM, &(100 + i)) > balance + i as Balance); - assert!(Tokens::free_balance(SETT, &(100 + i)) > balance + i as Balance); + assert!(Tokens::free_balance(SETR, &(100 + i)) > balance + i as Balance); } // The bottom 36 do not for i in 0..36 { assert_eq!(Tokens::free_balance(DRAM, &(100 + i)), balance + i as Balance); - assert_eq!(Tokens::free_balance(SETT, &(100 + i)), balance + i as Balance); + assert_eq!(Tokens::free_balance(SETR, &(100 + i)), balance + i as Balance); } // We track rewards in `claimed_rewards` vec diff --git a/lib-serml/serp/serp-treasury/src/lib.rs b/lib-serml/serp/serp-treasury/src/lib.rs index 698b1b842..b747d171c 100644 --- a/lib-serml/serp/serp-treasury/src/lib.rs +++ b/lib-serml/serp/serp-treasury/src/lib.rs @@ -70,7 +70,7 @@ pub mod module { type GetNativeCurrencyId: Get; #[pallet::constant] - /// Setter (SETT) currency Stablecoin currency id + /// Setter (SETR) currency Stablecoin currency id type SetterCurrencyId: Get; #[pallet::constant] @@ -104,7 +104,7 @@ pub mod module { /// CharityFund account. type CharityFundAccountId: Get; - /// Dex manager is used to swap reserve asset (Setter) for propper (SettCurrency). + /// Dex manager is used to swap reserve asset (Setter) for propper (SetCurrency). type Dex: DEXManager; /// The max slippage allowed when swap fee with DEX @@ -120,7 +120,7 @@ pub mod module { type NonStableDropCurrencyIds: Get>; /// The cashdrop currency ids that receive SettCurrencies. - type SettCurrencyDropCurrencyIds: Get>; + type SetCurrencyDropCurrencyIds: Get>; /// The minimum transfer amounts by currency_id, to secure cashdrop from dusty claims. type MinimumClaimableTransferAmounts: GetByKey; @@ -253,7 +253,7 @@ impl SerpTreasury for Pallet { None, )?; } else { - >::swap_exact_settcurrency_to_dinar( + >::swap_exact_setcurrency_to_dinar( currency_id, serping_amount, None, @@ -293,7 +293,7 @@ impl SerpTreasury for Pallet { Ok(()) } - /// Reward SETT cashdrop to vault + /// Reward SETR cashdrop to vault fn setter_cashdrop_to_vault() -> DispatchResult { let free_balance = T::Currency::free_balance(T::SetterCurrencyId::get(), &T::SettPayTreasuryAccountId::get()); @@ -377,7 +377,7 @@ impl SerpTreasury for Pallet { /// issue serpup surplus(stable currencies) to their destinations according to the serpup_ratio. fn on_serpup(currency_id: CurrencyId, amount: Balance) -> DispatchResult { - // ensure that the currency is a SettCurrency + // ensure that the currency is a SetCurrency ensure!( T::StableCurrencyIds::get().contains(¤cy_id), Error:::: InvalidCurrencyType, @@ -395,7 +395,7 @@ impl SerpTreasury for Pallet { Ok(()) } - // get the minimum supply of a settcurrency - by key + // get the minimum supply of a setcurrency - by key fn get_minimum_supply(currency_id: CurrencyId) -> Balance { T::GetStableCurrencyMinimumSupply::get(¤cy_id) } @@ -405,7 +405,7 @@ impl SerpTreasury for Pallet { // TODO: Update to add the burning of the stablecoins! // fn on_serpdown(currency_id: CurrencyId, amount: Balance) -> DispatchResult { - // ensure that the currency is a SettCurrency + // ensure that the currency is a SetCurrency ensure!( T::StableCurrencyIds::get().contains(¤cy_id), Error:::: InvalidCurrencyType, @@ -424,7 +424,7 @@ impl SerpTreasury for Pallet { None, )?; } else { - >::swap_setter_to_exact_settcurrency( + >::swap_setter_to_exact_setcurrency( currency_id, amount, None, @@ -449,12 +449,12 @@ impl SerpTreasury for Pallet { Ok(()) } - /// Burn Reserve asset (Setter (SETT)) + /// Burn Reserve asset (Setter (SETR)) fn burn_setter(who: &T::AccountId, setter: Self::Balance) -> DispatchResult { T::Currency::withdraw(T::SetterCurrencyId::get(), who, setter) } - /// deposit reserve asset (Setter (SETT)) to serp treasury by `who` + /// deposit reserve asset (Setter (SETR)) to serp treasury by `who` fn deposit_setter(from: &T::AccountId, amount: Self::Balance) -> DispatchResult { T::Currency::transfer(T::SetterCurrencyId::get(), from, &Self::account_id(), amount) } @@ -497,7 +497,7 @@ impl SerpTreasury for Pallet { T::Currency::transfer(T::SetterCurrencyId::get(), &Self::account_id(), who, relative_cashdrop)?; Self::deposit_event(Event::CashDropClaim(T::SetterCurrencyId::get(), who.clone(), relative_cashdrop.clone())); - } else if T::SettCurrencyDropCurrencyIds::get().contains(¤cy_id) { + } else if T::SetCurrencyDropCurrencyIds::get().contains(¤cy_id) { let balance_cashdrop_amount = transfer_amount / 50; // 4% let serp_balance = T::Currency::free_balance(currency_id, &Self::account_id()); @@ -555,12 +555,12 @@ impl SerpTreasuryExtended for Pallet { ) } - /// Swap exact amount of Setter to SettCurrency, - /// return actual target SettCurrency amount + /// Swap exact amount of Setter to SetCurrency, + /// return actual target SetCurrency amount /// /// - /// When SettCurrency needs SerpDown - fn swap_setter_to_exact_settcurrency( + /// When SetCurrency needs SerpDown + fn swap_setter_to_exact_setcurrency( currency_id: CurrencyId, target_amount: Balance, maybe_path: Option<&[CurrencyId]>, @@ -648,7 +648,7 @@ impl SerpTreasuryExtended for Pallet { /// /// /// When Setter gets SerpUp - fn swap_exact_settcurrency_to_dinar( + fn swap_exact_setcurrency_to_dinar( currency_id: CurrencyId, supply_amount: Balance, maybe_path: Option<&[CurrencyId]>, diff --git a/lib-serml/serp/serp-treasury/src/mock.rs b/lib-serml/serp/serp-treasury/src/mock.rs index 65e49c06f..ad90f9987 100644 --- a/lib-serml/serp/serp-treasury/src/mock.rs +++ b/lib-serml/serp/serp-treasury/src/mock.rs @@ -39,13 +39,13 @@ pub type BlockNumber = u64; pub const ALICE: AccountId = 0; pub const BOB: AccountId = 1; pub const CHARITY_FUND: AccountId = 2; -pub const SETTPAY: AccountId = 9; +pub const SETRPAY: AccountId = 9; pub const VAULT: AccountId = 10; // Currencies constants - CurrencyId/TokenSymbol pub const DNAR: CurrencyId = CurrencyId::Token(TokenSymbol::DNAR); pub const DRAM: CurrencyId = CurrencyId::Token(TokenSymbol::DRAM); -pub const SETT: CurrencyId = CurrencyId::Token(TokenSymbol::SETT); +pub const SETR: CurrencyId = CurrencyId::Token(TokenSymbol::SETR); pub const AUDJ: CurrencyId = CurrencyId::Token(TokenSymbol::AUDJ); pub const CADJ: CurrencyId = CurrencyId::Token(TokenSymbol::CADJ); pub const CHFJ: CurrencyId = CurrencyId::Token(TokenSymbol::CHFJ); @@ -144,17 +144,17 @@ parameter_types! { pub const DexPalletId: PalletId = PalletId(*b"set/sdex"); pub const TradingPathLimit: u32 = 3; pub EnabledTradingPairs: Vec = vec![ - TradingPair::from_currency_ids(DNAR, SETT).unwrap(), - TradingPair::from_currency_ids(AUDJ, SETT).unwrap(), - TradingPair::from_currency_ids(CADJ, SETT).unwrap(), - TradingPair::from_currency_ids(CHFJ, SETT).unwrap(), - TradingPair::from_currency_ids(EURJ, SETT).unwrap(), - TradingPair::from_currency_ids(GBPJ, SETT).unwrap(), - TradingPair::from_currency_ids(JPYJ, SETT).unwrap(), - TradingPair::from_currency_ids(SARJ, SETT).unwrap(), - TradingPair::from_currency_ids(SEKJ, SETT).unwrap(), - TradingPair::from_currency_ids(SGDJ, SETT).unwrap(), - TradingPair::from_currency_ids(USDJ, SETT).unwrap(), + TradingPair::from_currency_ids(DNAR, SETR).unwrap(), + TradingPair::from_currency_ids(AUDJ, SETR).unwrap(), + TradingPair::from_currency_ids(CADJ, SETR).unwrap(), + TradingPair::from_currency_ids(CHFJ, SETR).unwrap(), + TradingPair::from_currency_ids(EURJ, SETR).unwrap(), + TradingPair::from_currency_ids(GBPJ, SETR).unwrap(), + TradingPair::from_currency_ids(JPYJ, SETR).unwrap(), + TradingPair::from_currency_ids(SARJ, SETR).unwrap(), + TradingPair::from_currency_ids(SEKJ, SETR).unwrap(), + TradingPair::from_currency_ids(SGDJ, SETR).unwrap(), + TradingPair::from_currency_ids(USDJ, SETR).unwrap(), TradingPair::from_currency_ids(AUDJ, DNAR).unwrap(), TradingPair::from_currency_ids(CADJ, DNAR).unwrap(), TradingPair::from_currency_ids(CHFJ, DNAR).unwrap(), @@ -222,7 +222,7 @@ ord_parameter_types! { parameter_types! { pub StableCurrencyIds: Vec = vec![ - SETT, + SETR, AUDJ, CADJ, CHFJ, @@ -234,13 +234,13 @@ parameter_types! { SGDJ, USDJ, ]; - pub const SetterCurrencyId: CurrencyId = SETT; // Setter currency ticker is SETT/ + pub const SetterCurrencyId: CurrencyId = SETR; // Setter currency ticker is SETR/ pub const GetSettUSDCurrencyId: CurrencyId = USDJ; // Setter currency ticker is USDJ/ pub const DirhamCurrencyId: CurrencyId = DRAM; // SettinDEX currency ticker is DRAM/ pub const SerpTreasuryPalletId: PalletId = PalletId(*b"set/serp"); pub const CharityFundAccountId: AccountId = CHARITY_FUND; - pub const SettPayTreasuryAccountId: AccountId = SETTPAY; + pub const SettPayTreasuryAccountId: AccountId = SETRPAY; pub const CashDropVaultAccountId: AccountId = VAULT; pub SerpTesSchedule: BlockNumber = 60; // Triggers SERP-TES for serping after Every 60 blocks @@ -250,7 +250,7 @@ parameter_types! { pub RewardableCurrencyIds: Vec = vec![ DNAR, DRAM, - SETT, + SETR, AUDJ, CADJ, CHFJ, @@ -263,7 +263,7 @@ parameter_types! { USDJ, ]; pub NonStableDropCurrencyIds: Vec = vec![DNAR, DRAM]; - pub SettCurrencyDropCurrencyIds: Vec = vec![ + pub SetCurrencyDropCurrencyIds: Vec = vec![ AUDJ, CADJ, CHFJ, @@ -280,7 +280,7 @@ parameter_types! { parameter_type_with_key! { pub MinimumClaimableTransferAmounts: |currency_id: CurrencyId| -> Balance { match currency_id { - &SETT => 2, + &SETR => 2, &AUDJ => 2, &CHFJ => 2, &EURJ => 2, @@ -295,7 +295,7 @@ parameter_type_with_key! { parameter_type_with_key! { pub GetStableCurrencyMinimumSupply: |currency_id: CurrencyId| -> Balance { match currency_id { - &SETT => 10_000, + &SETR => 10_000, &AUDJ => 10_000, &CHFJ => 10_000, &EURJ => 10_000, @@ -326,7 +326,7 @@ impl Config for Runtime { type PriceSource = MockPriceSource; type RewardableCurrencyIds = RewardableCurrencyIds; type NonStableDropCurrencyIds = StableCurrencyIds; - type SettCurrencyDropCurrencyIds = SettCurrencyDropCurrencyIds; + type SetCurrencyDropCurrencyIds = SetCurrencyDropCurrencyIds; type MinimumClaimableTransferAmounts = MinimumClaimableTransferAmounts; type PalletId = SerpTreasuryPalletId; type WeightInfo = (); @@ -359,21 +359,21 @@ impl Default for ExtBuilder { Self { balances: vec![ (ALICE, USDJ, 1000), - (ALICE, SETT, 1000), + (ALICE, SETR, 1000), (ALICE, DNAR, 1000), (ALICE, DRAM, 1000), (BOB, USDJ, 1000), - (BOB, SETT, 1000), + (BOB, SETR, 1000), (BOB, DNAR, 1000), (BOB, DRAM, 1000), (CHARITY_FUND, USDJ, 1000), - (CHARITY_FUND, SETT, 1000), + (CHARITY_FUND, SETR, 1000), (CHARITY_FUND, DNAR, 1000), (CHARITY_FUND, DRAM, 1000), - (SETTPAY, USDJ, 1000), - (SETTPAY, SETT, 1000), + (SETRPAY, USDJ, 1000), + (SETRPAY, SETR, 1000), (VAULT, USDJ, 1000), - (VAULT, SETT, 1000), + (VAULT, SETR, 1000), ], } } diff --git a/lib-serml/serp/serp-treasury/src/tests.rs b/lib-serml/serp/serp-treasury/src/tests.rs index be5515e69..687013a5c 100644 --- a/lib-serml/serp/serp-treasury/src/tests.rs +++ b/lib-serml/serp/serp-treasury/src/tests.rs @@ -49,81 +49,81 @@ fn burn_standard_works() { #[test] fn issue_setter_works() { ExtBuilder::default().build().execute_with(|| { - assert_eq!(Currencies::free_balance(SETT, &ALICE), 1000); + assert_eq!(Currencies::free_balance(SETR, &ALICE), 1000); assert_ok!(SerpTreasuryModule::issue_setter(&ALICE, 1000)); - assert_eq!(Currencies::free_balance(SETT, &ALICE), 2000); + assert_eq!(Currencies::free_balance(SETR, &ALICE), 2000); assert_ok!(SerpTreasuryModule::issue_setter(&ALICE, 1000)); - assert_eq!(Currencies::free_balance(SETT, &ALICE), 3000); + assert_eq!(Currencies::free_balance(SETR, &ALICE), 3000); }); } #[test] fn burn_setter_works() { ExtBuilder::default().build().execute_with(|| { - assert_eq!(Currencies::free_balance(SETT, &ALICE), 1000); + assert_eq!(Currencies::free_balance(SETR, &ALICE), 1000); assert_ok!(SerpTreasuryModule::burn_setter(&ALICE, 300)); - assert_eq!(Currencies::free_balance(SETT, &ALICE), 700); + assert_eq!(Currencies::free_balance(SETR, &ALICE), 700); }); } #[test] fn deposit_setter_works() { ExtBuilder::default().build().execute_with(|| { - assert_eq!(Currencies::free_balance(SETT, &SerpTreasuryModule::account_id()), 0); - assert_eq!(Currencies::free_balance(SETT, &ALICE), 1000); + assert_eq!(Currencies::free_balance(SETR, &SerpTreasuryModule::account_id()), 0); + assert_eq!(Currencies::free_balance(SETR, &ALICE), 1000); assert_eq!(SerpTreasuryModule::deposit_setter(&ALICE, 10000).is_ok(), false); assert_ok!(SerpTreasuryModule::deposit_setter(&ALICE, 500)); - assert_eq!(Currencies::free_balance(SETT, &SerpTreasuryModule::account_id()), 500); - assert_eq!(Currencies::free_balance(SETT, &ALICE), 500); + assert_eq!(Currencies::free_balance(SETR, &SerpTreasuryModule::account_id()), 500); + assert_eq!(Currencies::free_balance(SETR, &ALICE), 500); }); } #[test] fn swap_dinar_to_exact_setter_works() { ExtBuilder::default().build().execute_with(|| { - assert_ok!(Currencies::deposit(SETT, &ALICE, 10000)); + assert_ok!(Currencies::deposit(SETR, &ALICE, 10000)); assert_ok!(Currencies::deposit(DNAR, &ALICE, 10000)); assert_ok!(SetheumDEX::add_liquidity( Origin::signed(ALICE), - SETT, + SETR, DNAR, 900, 1000, 0, )); assert_ok!(Currencies::deposit(DNAR, &SerpTreasuryModule::account_id(), 10000)); - assert_ok!(Currencies::deposit(SETT, &SerpTreasuryModule::account_id(), 10000)); + assert_ok!(Currencies::deposit(SETR, &SerpTreasuryModule::account_id(), 10000)); assert_ok!(SerpTreasuryModule::swap_dinar_to_exact_setter( 10, None )); - assert_eq!(Currencies::free_balance(SETT, &SerpTreasuryModule::account_id()), 10000); + assert_eq!(Currencies::free_balance(SETR, &SerpTreasuryModule::account_id()), 10000); }); } #[test] fn swap_exact_setter_to_dinar_work() { ExtBuilder::default().build().execute_with(|| { - assert_ok!(Currencies::deposit(SETT, &ALICE, 10000)); + assert_ok!(Currencies::deposit(SETR, &ALICE, 10000)); assert_ok!(Currencies::deposit(DNAR, &ALICE, 10000)); assert_ok!(SetheumDEX::add_liquidity( Origin::signed(ALICE), DNAR, - SETT, + SETR, 900, 1000, 0, )); - assert_ok!(Currencies::deposit(SETT, &SerpTreasuryModule::account_id(), 10000)); + assert_ok!(Currencies::deposit(SETR, &SerpTreasuryModule::account_id(), 10000)); assert_ok!(SerpTreasuryModule::swap_exact_setter_to_dinar( 100, None )); - assert_eq!(Currencies::free_balance(SETT, &SerpTreasuryModule::account_id()), 10000); + assert_eq!(Currencies::free_balance(SETR, &SerpTreasuryModule::account_id()), 10000); }); } #[test] -fn swap_exact_settcurrency_to_dinar_work() { +fn swap_exact_setcurrency_to_dinar_work() { ExtBuilder::default().build().execute_with(|| { assert_ok!(Currencies::deposit(USDJ, &BOB, 10000)); assert_ok!(Currencies::deposit(DNAR, &BOB, 10000)); @@ -136,13 +136,13 @@ fn swap_exact_settcurrency_to_dinar_work() { 0, )); assert_ok!(Currencies::deposit(USDJ, &SerpTreasuryModule::account_id(), 10000)); - assert_ok!(SerpTreasuryModule::swap_exact_settcurrency_to_dinar( + assert_ok!(SerpTreasuryModule::swap_exact_setcurrency_to_dinar( USDJ, 100, None )); assert_eq!(Currencies::free_balance(USDJ, &SerpTreasuryModule::account_id()), 100); assert_noop!( - SerpTreasuryModule::swap_exact_settcurrency_to_dinar(USDJ, 100, Some(&vec![USDJ, DNAR])), + SerpTreasuryModule::swap_exact_setcurrency_to_dinar(USDJ, 100, Some(&vec![USDJ, DNAR])), Error::::InvalidSwapPath ); }); diff --git a/lib-serml/settmint/settmint-engine/src/mock.rs b/lib-serml/settmint/settmint-engine/src/mock.rs index 393937c91..c01669a79 100644 --- a/lib-serml/settmint/settmint-engine/src/mock.rs +++ b/lib-serml/settmint/settmint-engine/src/mock.rs @@ -44,7 +44,7 @@ pub const CHARITY_FUND: AccountId = 4; // Currencies constants - CurrencyId/TokenSymbol pub const DNAR: CurrencyId = CurrencyId::Token(TokenSymbol::DNAR); pub const DRAM: CurrencyId = CurrencyId::Token(TokenSymbol::DRAM); -pub const SETT: CurrencyId = CurrencyId::Token(TokenSymbol::SETT); +pub const SETR: CurrencyId = CurrencyId::Token(TokenSymbol::SETR); pub const AUDJ: CurrencyId = CurrencyId::Token(TokenSymbol::AUDJ); pub const CADJ: CurrencyId = CurrencyId::Token(TokenSymbol::CADJ); pub const CHFJ: CurrencyId = CurrencyId::Token(TokenSymbol::CHFJ); @@ -165,9 +165,9 @@ impl MockPriceSource { impl PriceProvider for MockPriceSource { fn get_relative_price(base: CurrencyId, quote: CurrencyId) -> Option { match (base, quote) { - (USDJ, SETT) => RELATIVE_PRICE.with(|v| *v.borrow_mut()), - (SETT, USDJ) => RELATIVE_PRICE.with(|v| *v.borrow_mut()), - (SETT, EURJ) => RELATIVE_PRICE.with(|v| *v.borrow_mut()), + (USDJ, SETR) => RELATIVE_PRICE.with(|v| *v.borrow_mut()), + (SETR, USDJ) => RELATIVE_PRICE.with(|v| *v.borrow_mut()), + (SETR, EURJ) => RELATIVE_PRICE.with(|v| *v.borrow_mut()), _ => None, } } @@ -196,16 +196,16 @@ impl PriceProvider for MockPriceSource { parameter_types! { pub StableCurrencyIds: Vec = vec![ - SETT, AUDJ, CADJ, CHFJ, EURJ, GBPJ, + SETR, AUDJ, CADJ, CHFJ, EURJ, GBPJ, JPYJ, SARJ, SEKJ, SGDJ, USDJ, ]; - pub const SetterCurrencyId: CurrencyId = SETT; // Setter currency ticker is SETT/ + pub const SetterCurrencyId: CurrencyId = SETR; // Setter currency ticker is SETR/ pub const GetSettUSDCurrencyId: CurrencyId = USDJ; // Setter currency ticker is USDJ/ pub const DirhamCurrencyId: CurrencyId = DRAM; // SettinDEX currency ticker is DRAM/ pub const SerpTreasuryPalletId: PalletId = PalletId(*b"set/serp"); pub CharityFundAccountId: AccountId = CHARITY_FUND; - pub const SettPayTreasuryAccountId: AccountId = SETTPAY; + pub const SettPayTreasuryAccountId: AccountId = SETRPAY; pub const CashDropVaultAccountId: AccountId = VAULT; pub SerpTesSchedule: BlockNumber = 60; // Triggers SERP-TES for serping after Every 60 blocks @@ -215,7 +215,7 @@ parameter_types! { pub RewardableCurrencyIds: Vec = vec![ DNAR, DRAM, - SETT, + SETR, AUDJ, CADJ, CHFJ, @@ -228,7 +228,7 @@ parameter_types! { USDJ, ]; pub NonStableDropCurrencyIds: Vec = vec![DNAR, DRAM]; - pub SettCurrencyDropCurrencyIds: Vec = vec![ + pub SetCurrencyDropCurrencyIds: Vec = vec![ AUDJ, CADJ, CHFJ, @@ -245,7 +245,7 @@ parameter_types! { parameter_type_with_key! { pub MinimumClaimableTransferAmounts: |currency_id: CurrencyId| -> Balance { match currency_id { - &SETT => 2, + &SETR => 2, &AUDJ => 2, &CHFJ => 2, &EURJ => 2, @@ -260,7 +260,7 @@ parameter_type_with_key! { parameter_type_with_key! { pub GetStableCurrencyMinimumSupply: |currency_id: CurrencyId| -> Balance { match currency_id { - &SETT => 10_000, + &SETR => 10_000, &AUDJ => 10_000, &CHFJ => 10_000, &EURJ => 10_000, @@ -290,7 +290,7 @@ impl serp_treasury::Config for Runtime { type PriceSource = MockPriceSource; type RewardableCurrencyIds = RewardableCurrencyIds; type NonStableDropCurrencyIds = StableCurrencyIds; - type SettCurrencyDropCurrencyIds = SettCurrencyDropCurrencyIds; + type SetCurrencyDropCurrencyIds = SetCurrencyDropCurrencyIds; type MinimumClaimableTransferAmounts = MinimumClaimableTransferAmounts; type PalletId = SerpTreasuryPalletId; type WeightInfo = (); @@ -301,17 +301,17 @@ parameter_types! { pub const GetExchangeFee: (u32, u32) = (1, 1000); // 0.1% pub const TradingPathLimit: u32 = 3; pub EnabledTradingPairs: Vec = vec![ - TradingPair::from_currency_ids(DNAR, SETT).unwrap(), - TradingPair::from_currency_ids(AUDJ, SETT).unwrap(), - TradingPair::from_currency_ids(CADJ, SETT).unwrap(), - TradingPair::from_currency_ids(CHFJ, SETT).unwrap(), - TradingPair::from_currency_ids(EURJ, SETT).unwrap(), - TradingPair::from_currency_ids(GBPJ, SETT).unwrap(), - TradingPair::from_currency_ids(JPYJ, SETT).unwrap(), - TradingPair::from_currency_ids(SARJ, SETT).unwrap(), - TradingPair::from_currency_ids(SEKJ, SETT).unwrap(), - TradingPair::from_currency_ids(SGDJ, SETT).unwrap(), - TradingPair::from_currency_ids(USDJ, SETT).unwrap(), + TradingPair::from_currency_ids(DNAR, SETR).unwrap(), + TradingPair::from_currency_ids(AUDJ, SETR).unwrap(), + TradingPair::from_currency_ids(CADJ, SETR).unwrap(), + TradingPair::from_currency_ids(CHFJ, SETR).unwrap(), + TradingPair::from_currency_ids(EURJ, SETR).unwrap(), + TradingPair::from_currency_ids(GBPJ, SETR).unwrap(), + TradingPair::from_currency_ids(JPYJ, SETR).unwrap(), + TradingPair::from_currency_ids(SARJ, SETR).unwrap(), + TradingPair::from_currency_ids(SEKJ, SETR).unwrap(), + TradingPair::from_currency_ids(SGDJ, SETR).unwrap(), + TradingPair::from_currency_ids(USDJ, SETR).unwrap(), TradingPair::from_currency_ids(AUDJ, DNAR).unwrap(), TradingPair::from_currency_ids(CADJ, DNAR).unwrap(), TradingPair::from_currency_ids(CHFJ, DNAR).unwrap(), @@ -353,7 +353,7 @@ parameter_types! { SGDJ, USDJ, ]; - pub const GetReserveCurrencyId: CurrencyId = SETT; + pub const GetReserveCurrencyId: CurrencyId = SETR; pub DefaultStandardExchangeRate: ExchangeRate = ExchangeRate::one(); pub const MinimumStandardValue: Balance = 2; } @@ -405,9 +405,9 @@ impl Default for ExtBuilder { fn default() -> Self { Self { balances: vec![ - (ALICE, SETT, 1000), - (BOB, SETT, 1000), - (CAROL, SETT, 100), + (ALICE, SETR, 1000), + (BOB, SETR, 1000), + (CAROL, SETR, 100), (ALICE, EURJ, 1000), (BOB, EURJ, 1000), (CAROL, USDJ, 1000), diff --git a/lib-serml/settmint/settmint-engine/src/tests.rs b/lib-serml/settmint/settmint-engine/src/tests.rs index 8140e43c4..1f01112d5 100644 --- a/lib-serml/settmint/settmint-engine/src/tests.rs +++ b/lib-serml/settmint/settmint-engine/src/tests.rs @@ -29,7 +29,7 @@ use orml_traits::MultiCurrency; fn get_standard_exchange_rate_work() { ExtBuilder::default().build().execute_with(|| { assert_eq!( - SettmintEngineModule::get_standard_exchange_rate(SETT), + SettmintEngineModule::get_standard_exchange_rate(SETR), DefaultStandardExchangeRate::get() ); }); @@ -39,7 +39,7 @@ fn get_standard_exchange_rate_work() { fn calculate_reserve_ratio_work() { ExtBuilder::default().build().execute_with(|| { assert_eq!( - SettmintEngineModule::calculate_reserve_ratio(SETT, 100, 50, Price::saturating_from_rational(1, 1)), + SettmintEngineModule::calculate_reserve_ratio(SETR, 100, 50, Price::saturating_from_rational(1, 1)), Ratio::saturating_from_rational(100, 50) ); }); @@ -48,18 +48,18 @@ fn calculate_reserve_ratio_work() { #[test] fn adjust_position_work() { ExtBuilder::default().build().execute_with(|| { - assert_eq!(Currencies::free_balance(SETT, &ALICE), 1000); + assert_eq!(Currencies::free_balance(SETR, &ALICE), 1000); assert_eq!(Currencies::free_balance(USDJ, &ALICE), 0); assert_eq!(SettmintManagerModule::positions(USDJ, ALICE).standard, 0); assert_eq!(SettmintManagerModule::positions(USDJ, ALICE).reserve, 0); assert_ok!(SettmintEngineModule::adjust_position(&ALICE, USDJ, 100, 50)); - assert_eq!(Currencies::free_balance(SETT, &ALICE), 900); + assert_eq!(Currencies::free_balance(SETR, &ALICE), 900); assert_eq!(Currencies::free_balance(USDJ, &ALICE), 50); assert_eq!(SettmintManagerModule::positions(USDJ, ALICE).standard, 50); assert_eq!(SettmintManagerModule::positions(USDJ, ALICE).reserve, 100); assert_eq!(SettmintEngineModule::adjust_position(&ALICE, USDJ, 0, 20).is_ok(), true); assert_ok!(SettmintEngineModule::adjust_position(&ALICE, USDJ, 0, -20)); - assert_eq!(Currencies::free_balance(SETT, &ALICE), 900); + assert_eq!(Currencies::free_balance(SETR, &ALICE), 900); assert_eq!(Currencies::free_balance(USDJ, &ALICE), 50); assert_eq!(SettmintManagerModule::positions(USDJ, ALICE).standard, 50); assert_eq!(SettmintManagerModule::positions(USDJ, ALICE).reserve, 100); diff --git a/lib-serml/settmint/settmint-gateway/src/lib.rs b/lib-serml/settmint/settmint-gateway/src/lib.rs index 4fa139e76..edccc61d9 100644 --- a/lib-serml/settmint/settmint-gateway/src/lib.rs +++ b/lib-serml/settmint/settmint-gateway/src/lib.rs @@ -120,7 +120,7 @@ pub mod module { /// currency from Settmint. /// - `standard_adjustment`: signed amount, positive means to issue some /// amount of `currency_id` to caller according to the standard adjustment, - /// negative means caller will payback some amount of `currency_id` (standard settcurrency) to + /// negative means caller will payback some amount of `currency_id` (standard setcurrency) to /// Settmint according to to the standard adjustment. #[pallet::weight(::WeightInfo::adjust_position())] #[transactional] diff --git a/lib-serml/settmint/settmint-gateway/src/mock.rs b/lib-serml/settmint/settmint-gateway/src/mock.rs index 2d206a164..587eb7c13 100644 --- a/lib-serml/settmint/settmint-gateway/src/mock.rs +++ b/lib-serml/settmint/settmint-gateway/src/mock.rs @@ -47,7 +47,7 @@ pub const CHARITY_FUND: AccountId = 4; // Currencies constants - CurrencyId/TokenSymbol pub const DNAR: CurrencyId = CurrencyId::Token(TokenSymbol::DNAR); pub const DRAM: CurrencyId = CurrencyId::Token(TokenSymbol::DRAM); -pub const SETT: CurrencyId = CurrencyId::Token(TokenSymbol::SETT); +pub const SETR: CurrencyId = CurrencyId::Token(TokenSymbol::SETR); pub const AUDJ: CurrencyId = CurrencyId::Token(TokenSymbol::AUDJ); pub const CADJ: CurrencyId = CurrencyId::Token(TokenSymbol::CADJ); pub const CHFJ: CurrencyId = CurrencyId::Token(TokenSymbol::CHFJ); @@ -170,16 +170,16 @@ ord_parameter_types! { parameter_types! { pub StableCurrencyIds: Vec = vec![ - SETT, AUDJ, CADJ, CHFJ, EURJ, GBPJ, + SETR, AUDJ, CADJ, CHFJ, EURJ, GBPJ, JPYJ, SARJ, SEKJ, SGDJ, USDJ, ]; - pub const SetterCurrencyId: CurrencyId = SETT; // Setter currency ticker is SETT/ + pub const SetterCurrencyId: CurrencyId = SETR; // Setter currency ticker is SETR/ pub const GetSettUSDCurrencyId: CurrencyId = USDJ; // Setter currency ticker is USDJ/ pub const DirhamCurrencyId: CurrencyId = DRAM; // SettinDEX currency ticker is DRAM/ pub const SerpTreasuryPalletId: PalletId = PalletId(*b"set/serp"); pub const CharityFundAccountId: AccountId = CHARITY_FUND; - pub const SettPayTreasuryAccountId: AccountId = SETTPAY; + pub const SettPayTreasuryAccountId: AccountId = SETRPAY; pub const CashDropVaultAccountId: AccountId = VAULT; pub SerpTesSchedule: BlockNumber = 60; // Triggers SERP-TES for serping after Every 60 blocks @@ -189,7 +189,7 @@ parameter_types! { pub RewardableCurrencyIds: Vec = vec![ DNAR, DRAM, - SETT, + SETR, AUDJ, CADJ, CHFJ, @@ -202,7 +202,7 @@ parameter_types! { USDJ, ]; pub NonStableDropCurrencyIds: Vec = vec![DNAR, DRAM]; - pub SettCurrencyDropCurrencyIds: Vec = vec![ + pub SetCurrencyDropCurrencyIds: Vec = vec![ AUDJ, CADJ, CHFJ, @@ -219,7 +219,7 @@ parameter_types! { parameter_type_with_key! { pub MinimumClaimableTransferAmounts: |currency_id: CurrencyId| -> Balance { match currency_id { - &SETT => 2, + &SETR => 2, &AUDJ => 2, &CHFJ => 2, &EURJ => 2, @@ -234,7 +234,7 @@ parameter_type_with_key! { parameter_type_with_key! { pub GetStableCurrencyMinimumSupply: |currency_id: CurrencyId| -> Balance { match currency_id { - &SETT => 10_000, + &SETR => 10_000, &AUDJ => 10_000, &CHFJ => 10_000, &EURJ => 10_000, @@ -265,7 +265,7 @@ impl serp_treasury::Config for Runtime { type PriceSource = MockPriceSource; type RewardableCurrencyIds = RewardableCurrencyIds; type NonStableDropCurrencyIds = StableCurrencyIds; - type SettCurrencyDropCurrencyIds = SettCurrencyDropCurrencyIds; + type SetCurrencyDropCurrencyIds = SetCurrencyDropCurrencyIds; type MinimumClaimableTransferAmounts = MinimumClaimableTransferAmounts; type PalletId = SerpTreasuryPalletId; type WeightInfo = (); @@ -276,17 +276,17 @@ parameter_types! { pub const GetExchangeFee: (u32, u32) = (1, 1000); // 0.1% pub const TradingPathLimit: u32 = 3; pub EnabledTradingPairs: Vec = vec![ - TradingPair::from_currency_ids(DNAR, SETT).unwrap(), - TradingPair::from_currency_ids(AUDJ, SETT).unwrap(), - TradingPair::from_currency_ids(CADJ, SETT).unwrap(), - TradingPair::from_currency_ids(CHFJ, SETT).unwrap(), - TradingPair::from_currency_ids(EURJ, SETT).unwrap(), - TradingPair::from_currency_ids(GBPJ, SETT).unwrap(), - TradingPair::from_currency_ids(JPYJ, SETT).unwrap(), - TradingPair::from_currency_ids(SARJ, SETT).unwrap(), - TradingPair::from_currency_ids(SEKJ, SETT).unwrap(), - TradingPair::from_currency_ids(SGDJ, SETT).unwrap(), - TradingPair::from_currency_ids(USDJ, SETT).unwrap(), + TradingPair::from_currency_ids(DNAR, SETR).unwrap(), + TradingPair::from_currency_ids(AUDJ, SETR).unwrap(), + TradingPair::from_currency_ids(CADJ, SETR).unwrap(), + TradingPair::from_currency_ids(CHFJ, SETR).unwrap(), + TradingPair::from_currency_ids(EURJ, SETR).unwrap(), + TradingPair::from_currency_ids(GBPJ, SETR).unwrap(), + TradingPair::from_currency_ids(JPYJ, SETR).unwrap(), + TradingPair::from_currency_ids(SARJ, SETR).unwrap(), + TradingPair::from_currency_ids(SEKJ, SETR).unwrap(), + TradingPair::from_currency_ids(SGDJ, SETR).unwrap(), + TradingPair::from_currency_ids(USDJ, SETR).unwrap(), TradingPair::from_currency_ids(AUDJ, DNAR).unwrap(), TradingPair::from_currency_ids(CADJ, DNAR).unwrap(), TradingPair::from_currency_ids(CHFJ, DNAR).unwrap(), @@ -328,7 +328,7 @@ parameter_types! { SGDJ, USDJ, ]; - pub const GetReserveCurrencyId: CurrencyId = SETT; + pub const GetReserveCurrencyId: CurrencyId = SETR; pub DefaultStandardExchangeRate: ExchangeRate = ExchangeRate::one(); pub const MinimumStandardValue: Balance = 2; } @@ -412,8 +412,8 @@ impl Default for ExtBuilder { (BOB, DNAR, 1000), (ALICE, DRAM, 1000), (BOB, DRAM, 1000), - (ALICE, SETT, 1000), - (BOB, SETT, 1000), + (ALICE, SETR, 1000), + (BOB, SETR, 1000), (ALICE, USDJ, 1000), (BOB, USDJ, 1000), ], diff --git a/lib-serml/settmint/settmint-manager/src/lib.rs b/lib-serml/settmint/settmint-manager/src/lib.rs index 71389f678..0484a5410 100644 --- a/lib-serml/settmint/settmint-manager/src/lib.rs +++ b/lib-serml/settmint/settmint-manager/src/lib.rs @@ -59,7 +59,7 @@ pub mod module { type Event: From> + IsType<::Event>; /// Convert standard amount under specific standard type to standard - /// value(SettCurrency) + /// value(SetCurrency) type Convert: Convert<(CurrencyId, Balance), Balance>; /// Currency type for deposit/withdraw reserve assets @@ -152,7 +152,7 @@ impl Pallet { let setheum_account = Self::account_id(); let reserve_currency = T::GetReserveCurrencyId::get(); - // ensure the currency is a settcurrency standard + // ensure the currency is a setcurrency standard ensure!( T::StandardCurrencyIds::get().contains(¤cy_id), Error::::InvalidStandardType, diff --git a/lib-serml/settmint/settmint-manager/src/mock.rs b/lib-serml/settmint/settmint-manager/src/mock.rs index 919e17e32..5d2b1009a 100644 --- a/lib-serml/settmint/settmint-manager/src/mock.rs +++ b/lib-serml/settmint/settmint-manager/src/mock.rs @@ -43,7 +43,7 @@ pub const CHARITY_FUND: AccountId = 3; // Currencies constants - CurrencyId/TokenSymbol pub const DNAR: CurrencyId = CurrencyId::Token(TokenSymbol::DNAR); pub const DRAM: CurrencyId = CurrencyId::Token(TokenSymbol::DRAM); -pub const SETT: CurrencyId = CurrencyId::Token(TokenSymbol::SETT); +pub const SETR: CurrencyId = CurrencyId::Token(TokenSymbol::SETR); pub const AUDJ: CurrencyId = CurrencyId::Token(TokenSymbol::AUDJ); pub const CADJ: CurrencyId = CurrencyId::Token(TokenSymbol::CADJ); pub const CHFJ: CurrencyId = CurrencyId::Token(TokenSymbol::CHFJ); @@ -142,17 +142,17 @@ parameter_types! { pub const DexPalletId: PalletId = PalletId(*b"set/sdex"); pub const TradingPathLimit: u32 = 3; pub EnabledTradingPairs: Vec = vec![ - TradingPair::from_currency_ids(DNAR, SETT).unwrap(), - TradingPair::from_currency_ids(AUDJ, SETT).unwrap(), - TradingPair::from_currency_ids(CADJ, SETT).unwrap(), - TradingPair::from_currency_ids(CHFJ, SETT).unwrap(), - TradingPair::from_currency_ids(EURJ, SETT).unwrap(), - TradingPair::from_currency_ids(GBPJ, SETT).unwrap(), - TradingPair::from_currency_ids(JPYJ, SETT).unwrap(), - TradingPair::from_currency_ids(SARJ, SETT).unwrap(), - TradingPair::from_currency_ids(SEKJ, SETT).unwrap(), - TradingPair::from_currency_ids(SGDJ, SETT).unwrap(), - TradingPair::from_currency_ids(USDJ, SETT).unwrap(), + TradingPair::from_currency_ids(DNAR, SETR).unwrap(), + TradingPair::from_currency_ids(AUDJ, SETR).unwrap(), + TradingPair::from_currency_ids(CADJ, SETR).unwrap(), + TradingPair::from_currency_ids(CHFJ, SETR).unwrap(), + TradingPair::from_currency_ids(EURJ, SETR).unwrap(), + TradingPair::from_currency_ids(GBPJ, SETR).unwrap(), + TradingPair::from_currency_ids(JPYJ, SETR).unwrap(), + TradingPair::from_currency_ids(SARJ, SETR).unwrap(), + TradingPair::from_currency_ids(SEKJ, SETR).unwrap(), + TradingPair::from_currency_ids(SGDJ, SETR).unwrap(), + TradingPair::from_currency_ids(USDJ, SETR).unwrap(), TradingPair::from_currency_ids(AUDJ, DNAR).unwrap(), TradingPair::from_currency_ids(CADJ, DNAR).unwrap(), TradingPair::from_currency_ids(CHFJ, DNAR).unwrap(), @@ -220,7 +220,7 @@ ord_parameter_types! { parameter_types! { pub StableCurrencyIds: Vec = vec![ - SETT, + SETR, AUDJ, CADJ, CHFJ, @@ -232,13 +232,13 @@ parameter_types! { SGDJ, USDJ, ]; - pub const SetterCurrencyId: CurrencyId = SETT; // Setter currency ticker is SETT/ + pub const SetterCurrencyId: CurrencyId = SETR; // Setter currency ticker is SETR/ pub const GetSettUSDCurrencyId: CurrencyId = USDJ; // Setter currency ticker is USDJ/ pub const DirhamCurrencyId: CurrencyId = DRAM; // SettinDEX currency ticker is DRAM/ pub const SerpTreasuryPalletId: PalletId = PalletId(*b"set/serp"); pub const CharityFundAccountId: AccountId = CHARITY_FUND; - pub const SettPayTreasuryAccountId: AccountId = SETTPAY; + pub const SettPayTreasuryAccountId: AccountId = SETRPAY; pub const CashDropVaultAccountId: AccountId = VAULT; pub SerpTesSchedule: BlockNumber = 60; // Triggers SERP-TES for serping after Every 60 blocks @@ -248,7 +248,7 @@ parameter_types! { pub RewardableCurrencyIds: Vec = vec![ DNAR, DRAM, - SETT, + SETR, AUDJ, CADJ, CHFJ, @@ -261,7 +261,7 @@ parameter_types! { USDJ, ]; pub NonStableDropCurrencyIds: Vec = vec![DNAR, DRAM]; - pub SettCurrencyDropCurrencyIds: Vec = vec![ + pub SetCurrencyDropCurrencyIds: Vec = vec![ AUDJ, CADJ, CHFJ, @@ -278,7 +278,7 @@ parameter_types! { parameter_type_with_key! { pub MinimumClaimableTransferAmounts: |currency_id: CurrencyId| -> Balance { match currency_id { - &SETT => 2, + &SETR => 2, &AUDJ => 2, &CHFJ => 2, &EURJ => 2, @@ -293,7 +293,7 @@ parameter_type_with_key! { parameter_type_with_key! { pub GetStableCurrencyMinimumSupply: |currency_id: CurrencyId| -> Balance { match currency_id { - &SETT => 10_000, + &SETR => 10_000, &AUDJ => 10_000, &CHFJ => 10_000, &EURJ => 10_000, @@ -324,7 +324,7 @@ impl serp_treasury::Config for Runtime { type PriceSource = MockPriceSource; type RewardableCurrencyIds = RewardableCurrencyIds; type NonStableDropCurrencyIds = StableCurrencyIds; - type SettCurrencyDropCurrencyIds = SettCurrencyDropCurrencyIds; + type SetCurrencyDropCurrencyIds = SetCurrencyDropCurrencyIds; type MinimumClaimableTransferAmounts = MinimumClaimableTransferAmounts; type PalletId = SerpTreasuryPalletId; type WeightInfo = (); @@ -351,7 +351,7 @@ parameter_types! { SGDJ, USDJ, ]; - pub const GetReserveCurrencyId: CurrencyId = SETT; + pub const GetReserveCurrencyId: CurrencyId = SETR; pub const SettmintManagerPalletId: PalletId = PalletId(*b"set/mint"); } @@ -393,11 +393,11 @@ impl Default for ExtBuilder { fn default() -> Self { Self { balances: vec![ - (ALICE, SETT, 1000), + (ALICE, SETR, 1000), (ALICE, USDJ, 1000), (ALICE, EURJ, 1000), (ALICE, CHFJ, 1000), - (BOB, SETT, 1000), + (BOB, SETR, 1000), (BOB, USDJ, 1000), (BOB, EURJ, 1000), (BOB, CHFJ, 1000), diff --git a/lib-serml/settmint/settmint-manager/src/tests.rs b/lib-serml/settmint/settmint-manager/src/tests.rs index ff997506e..d7c129e1b 100644 --- a/lib-serml/settmint/settmint-manager/src/tests.rs +++ b/lib-serml/settmint/settmint-manager/src/tests.rs @@ -30,7 +30,7 @@ fn standards_key() { assert_eq!(SettmintManagerModule::positions(EURJ, &ALICE).standard, 0); assert_ok!(SettmintManagerModule::adjust_position(&ALICE, EURJ, 200, 200)); assert_eq!(SettmintManagerModule::positions(EURJ, &ALICE).standard, 200); - assert_eq!(Currencies::free_balance(SETT, &SettmintManagerModule::account_id()), 100); + assert_eq!(Currencies::free_balance(SETR, &SettmintManagerModule::account_id()), 100); assert_ok!(SettmintManagerModule::adjust_position(&ALICE, EURJ, -100, -100)); assert_eq!(SettmintManagerModule::positions(EURJ, &ALICE).standard, 100); }); @@ -57,9 +57,9 @@ fn check_update_position_underflow_work() { fn adjust_position_should_work() { ExtBuilder::default().build().execute_with(|| { System::set_block_number(1); - assert_eq!(Currencies::free_balance(SETT, &ALICE), 1000); + assert_eq!(Currencies::free_balance(SETR, &ALICE), 1000); - assert_eq!(Currencies::free_balance(SETT, &ALICE), 1000); + assert_eq!(Currencies::free_balance(SETR, &ALICE), 1000); assert_eq!(Currencies::free_balance(EURJ, &SettmintManagerModule::account_id()), 0); assert_eq!(SettmintManagerModule::total_positions(EURJ).standard, 0); assert_eq!(SettmintManagerModule::total_positions(EURJ).reserve, 0); @@ -69,8 +69,8 @@ fn adjust_position_should_work() { // success assert_ok!(SettmintManagerModule::adjust_position(&ALICE, EURJ, 500, 300)); - assert_eq!(Currencies::free_balance(SETT, &ALICE), 750); - assert_eq!(Currencies::free_balance(SETT, &SettmintManagerModule::account_id()), 250); + assert_eq!(Currencies::free_balance(SETR, &ALICE), 750); + assert_eq!(Currencies::free_balance(SETR, &SettmintManagerModule::account_id()), 250); assert_eq!(SettmintManagerModule::total_positions(EURJ).standard, 300); assert_eq!(SettmintManagerModule::total_positions(EURJ).reserve, 500); assert_eq!(SettmintManagerModule::positions(EURJ, &ALICE).standard, 300); @@ -112,8 +112,8 @@ fn transfer_position_should_work() { #[test] fn update_position_should_work() { ExtBuilder::default().build().execute_with(|| { - assert_eq!(Currencies::free_balance(SETT, &SettmintManagerModule::account_id()), 0); - assert_eq!(Currencies::free_balance(SETT, &ALICE), 1000); + assert_eq!(Currencies::free_balance(SETR, &SettmintManagerModule::account_id()), 0); + assert_eq!(Currencies::free_balance(SETR, &ALICE), 1000); assert_eq!(SettmintManagerModule::total_positions(EURJ).standard, 0); assert_eq!(SettmintManagerModule::total_positions(EURJ).reserve, 0); assert_eq!(SettmintManagerModule::positions(EURJ, &ALICE).standard, 0); @@ -135,8 +135,8 @@ fn update_position_should_work() { assert_eq!(alice_ref_count_1, alice_ref_count_0 + 1); // dot not manipulate balance - assert_eq!(Currencies::free_balance(SETT, &SettmintManagerModule::account_id()), 0); - assert_eq!(Currencies::free_balance(SETT, &ALICE), 1000); + assert_eq!(Currencies::free_balance(SETR, &SettmintManagerModule::account_id()), 0); + assert_eq!(Currencies::free_balance(SETR, &ALICE), 1000); // should remove position storage if zero assert_eq!(>::contains_key(EURJ, &ALICE), true); @@ -154,7 +154,7 @@ fn update_position_should_work() { #[test] fn total_reserve_works() { ExtBuilder::default().build().execute_with(|| { - assert_ok!(Currencies::deposit(SETT, &SettmintManagerModule::account_id(), 10)); + assert_ok!(Currencies::deposit(SETR, &SettmintManagerModule::account_id(), 10)); assert_eq!(SettmintManagerModule::total_reserve(), 10); }); } diff --git a/lib-serml/support/src/lib.rs b/lib-serml/support/src/lib.rs index 37dc2cdd0..061e4d5ac 100644 --- a/lib-serml/support/src/lib.rs +++ b/lib-serml/support/src/lib.rs @@ -207,13 +207,13 @@ pub trait SerpTreasury { /// SerpUp ratio for SettPay Cashdrops fn get_cashdrop_serpup(amount: Self::Balance, currency_id: Self::CurrencyId) -> DispatchResult; - /// Reward SETT cashdrop to vault + /// Reward SETR cashdrop to vault fn setter_cashdrop_to_vault() -> DispatchResult; /// Reward USDJ cashdrop to vault fn usdj_cashdrop_to_vault() -> DispatchResult; - /// Trigger SERP-TES when required for Setter (SETT) to serp_down or serp_up. + /// Trigger SERP-TES when required for Setter (SETR) to serp_down or serp_up. fn setter_on_tes() -> DispatchResult; /// Trigger SERP-TES when required for USDJ to serp_down or serp_up. @@ -225,7 +225,7 @@ pub trait SerpTreasury { /// buy back and burn surplus(stable currencies) with swap by DEX. fn on_serpdown(currency_id: Self::CurrencyId, amount: Self::Balance) -> DispatchResult; - /// get the minimum supply of a settcurrency - by key + /// get the minimum supply of a setcurrency - by key fn get_minimum_supply(currency_id: Self::CurrencyId) -> Self::Balance; /// issue standard to `who` @@ -240,7 +240,7 @@ pub trait SerpTreasury { /// burn setter of `who` fn burn_setter(who: &AccountId, setter: Self::Balance) -> DispatchResult; - /// deposit reserve asset (Setter (SETT)) to serp treasury by `who` + /// deposit reserve asset (Setter (SETR)) to serp treasury by `who` fn deposit_setter(from: &AccountId, amount: Self::Balance) -> DispatchResult; /// claim cashdrop of `currency_id` relative to `transfer_amount` for `who` @@ -254,8 +254,8 @@ pub trait SerpTreasuryExtended: SerpTreasury { path: Option<&[Self::CurrencyId]>, ) -> sp_std::result::Result; - /// When SettCurrency needs SerpDown - fn swap_setter_to_exact_settcurrency( + /// When SetCurrency needs SerpDown + fn swap_setter_to_exact_setcurrency( currency_id: Self::CurrencyId, target_amount: Self::Balance, path: Option<&[Self::CurrencyId]>, @@ -267,8 +267,8 @@ pub trait SerpTreasuryExtended: SerpTreasury { maybe_path: Option<&[Self::CurrencyId]>, ) -> sp_std::result::Result; - /// When SettCurrency gets SerpUp - fn swap_exact_settcurrency_to_dinar( + /// When SetCurrency gets SerpUp + fn swap_exact_setcurrency_to_dinar( currency_id: Self::CurrencyId, supply_amount: Self::Balance, maybe_path: Option<&[Self::CurrencyId]>, diff --git a/lib-serml/tokens/currencies/src/mock.rs b/lib-serml/tokens/currencies/src/mock.rs index abcb0d354..c840ad088 100644 --- a/lib-serml/tokens/currencies/src/mock.rs +++ b/lib-serml/tokens/currencies/src/mock.rs @@ -44,7 +44,7 @@ pub type BlockNumber = u64; // Currencies constants - CurrencyId/TokenSymbol pub const DNAR: CurrencyId = CurrencyId::Token(TokenSymbol::DNAR); pub const DRAM: CurrencyId = CurrencyId::Token(TokenSymbol::DRAM); -pub const SETT: CurrencyId = CurrencyId::Token(TokenSymbol::SETT); +pub const SETR: CurrencyId = CurrencyId::Token(TokenSymbol::SETR); pub const AUDJ: CurrencyId = CurrencyId::Token(TokenSymbol::AUDJ); pub const CADJ: CurrencyId = CurrencyId::Token(TokenSymbol::CADJ); pub const CHFJ: CurrencyId = CurrencyId::Token(TokenSymbol::CHFJ); @@ -211,17 +211,17 @@ parameter_types! { pub const DexPalletId: PalletId = PalletId(*b"set/sdex"); pub const TradingPathLimit: u32 = 3; pub EnabledTradingPairs: Vec = vec![ - TradingPair::from_currency_ids(DNAR, SETT).unwrap(), - TradingPair::from_currency_ids(AUDJ, SETT).unwrap(), - TradingPair::from_currency_ids(CADJ, SETT).unwrap(), - TradingPair::from_currency_ids(CHFJ, SETT).unwrap(), - TradingPair::from_currency_ids(EURJ, SETT).unwrap(), - TradingPair::from_currency_ids(GBPJ, SETT).unwrap(), - TradingPair::from_currency_ids(JPYJ, SETT).unwrap(), - TradingPair::from_currency_ids(SARJ, SETT).unwrap(), - TradingPair::from_currency_ids(SEKJ, SETT).unwrap(), - TradingPair::from_currency_ids(SGDJ, SETT).unwrap(), - TradingPair::from_currency_ids(USDJ, SETT).unwrap(), + TradingPair::from_currency_ids(DNAR, SETR).unwrap(), + TradingPair::from_currency_ids(AUDJ, SETR).unwrap(), + TradingPair::from_currency_ids(CADJ, SETR).unwrap(), + TradingPair::from_currency_ids(CHFJ, SETR).unwrap(), + TradingPair::from_currency_ids(EURJ, SETR).unwrap(), + TradingPair::from_currency_ids(GBPJ, SETR).unwrap(), + TradingPair::from_currency_ids(JPYJ, SETR).unwrap(), + TradingPair::from_currency_ids(SARJ, SETR).unwrap(), + TradingPair::from_currency_ids(SEKJ, SETR).unwrap(), + TradingPair::from_currency_ids(SGDJ, SETR).unwrap(), + TradingPair::from_currency_ids(USDJ, SETR).unwrap(), TradingPair::from_currency_ids(AUDJ, DNAR).unwrap(), TradingPair::from_currency_ids(CADJ, DNAR).unwrap(), TradingPair::from_currency_ids(CHFJ, DNAR).unwrap(), @@ -289,7 +289,7 @@ ord_parameter_types! { parameter_types! { pub StableCurrencyIds: Vec = vec![ - SETT, + SETR, AUDJ, CADJ, CHFJ, @@ -301,7 +301,7 @@ parameter_types! { SGDJ, USDJ, ]; - pub const SetterCurrencyId: CurrencyId = SETT; // Setter currency ticker is SETT/ + pub const SetterCurrencyId: CurrencyId = SETR; // Setter currency ticker is SETR/ pub const GetSettUSDCurrencyId: CurrencyId = USDJ; // Setter currency ticker is USDJ/ pub const DirhamCurrencyId: CurrencyId = DRAM; // SettinDEX currency ticker is DRAM/ @@ -314,7 +314,7 @@ parameter_types! { pub RewardableCurrencyIds: Vec = vec![ DNAR, DRAM, - SETT, + SETR, AUDJ, CADJ, CHFJ, @@ -327,7 +327,7 @@ parameter_types! { USDJ, ]; pub NonStableDropCurrencyIds: Vec = vec![DNAR, DRAM]; - pub SettCurrencyDropCurrencyIds: Vec = vec![ + pub SetCurrencyDropCurrencyIds: Vec = vec![ AUDJ, CADJ, CHFJ, @@ -344,7 +344,7 @@ parameter_types! { parameter_type_with_key! { pub MinimumClaimableTransferAmounts: |currency_id: CurrencyId| -> Balance { match currency_id { - &SETT => 2, + &SETR => 2, &AUDJ => 2, &CHFJ => 2, &EURJ => 2, @@ -360,7 +360,7 @@ parameter_type_with_key! { parameter_type_with_key! { pub GetStableCurrencyMinimumSupply: |currency_id: CurrencyId| -> Balance { match currency_id { - &SETT => 10_000, + &SETR => 10_000, &AUDJ => 10_000, &CHFJ => 10_000, &EURJ => 10_000, @@ -391,7 +391,7 @@ impl serp_treasury::Config for Runtime { type PriceSource = MockPriceSource; type RewardableCurrencyIds = RewardableCurrencyIds; type NonStableDropCurrencyIds = StableCurrencyIds; - type SettCurrencyDropCurrencyIds = SettCurrencyDropCurrencyIds; + type SetCurrencyDropCurrencyIds = SetCurrencyDropCurrencyIds; type MinimumClaimableTransferAmounts = MinimumClaimableTransferAmounts; type UpdateOrigin = EnsureSignedBy; type PalletId = SerpTreasuryPalletId; diff --git a/lib-serml/transaction-payment/src/lib.rs b/lib-serml/transaction-payment/src/lib.rs index 11e403a01..3869473c1 100644 --- a/lib-serml/transaction-payment/src/lib.rs +++ b/lib-serml/transaction-payment/src/lib.rs @@ -228,7 +228,7 @@ pub mod module { #[pallet::constant] type NativeCurrencyId: Get; - /// Setter currency id, should be SETT + /// Setter currency id, should be SETR #[pallet::constant] type SetterCurrencyId: Get; diff --git a/lib-serml/transaction-payment/src/mock.rs b/lib-serml/transaction-payment/src/mock.rs index f08a29203..99cff2c55 100644 --- a/lib-serml/transaction-payment/src/mock.rs +++ b/lib-serml/transaction-payment/src/mock.rs @@ -44,7 +44,7 @@ pub const ALICE: AccountId = AccountId::new([1u8; 32]); pub const BOB: AccountId = AccountId::new([2u8; 32]); pub const CHARLIE: AccountId = AccountId::new([3u8; 32]); pub const DNAR: CurrencyId = CurrencyId::Token(TokenSymbol::DNAR); -pub const SETT: CurrencyId = CurrencyId::Token(TokenSymbol::SETT); +pub const SETR: CurrencyId = CurrencyId::Token(TokenSymbol::SETR); pub const DOT: CurrencyId = CurrencyId::Token(TokenSymbol::DOT); parameter_types! { @@ -152,8 +152,8 @@ parameter_types! { pub const GetExchangeFee: (u32, u32) = (0, 100); pub const TradingPathLimit: u32 = 3; pub EnabledTradingPairs: Vec = vec![ - TradingPair::from_currency_ids(SETT, DNAR).unwrap(), - TradingPair::from_currency_ids(SETT, DOT).unwrap(), + TradingPair::from_currency_ids(SETR, DNAR).unwrap(), + TradingPair::from_currency_ids(SETR, DOT).unwrap(), ]; } @@ -169,9 +169,9 @@ impl setheum_dex::Config for Runtime { } parameter_types! { - pub AllNonNativeCurrencyIds: Vec = vec![SETT, DOT]; + pub AllNonNativeCurrencyIds: Vec = vec![SETR, DOT]; pub MaxSlippageSwapWithDEX: Ratio = Ratio::one(); - pub const SetterCurrencyId: CurrencyId = SETT; + pub const SetterCurrencyId: CurrencyId = SETR; pub static TransactionByteFee: u128 = 1; } @@ -254,7 +254,7 @@ pub struct ExtBuilder { impl Default for ExtBuilder { fn default() -> Self { Self { - balances: vec![(ALICE, SETT, 10000), (ALICE, DOT, 1000)], + balances: vec![(ALICE, SETR, 10000), (ALICE, DOT, 1000)], base_weight: 0, byte_fee: 2, weight_to_fee: 1, diff --git a/lib-serml/transaction-payment/src/tests.rs b/lib-serml/transaction-payment/src/tests.rs index 7763ecbaf..8538bf934 100644 --- a/lib-serml/transaction-payment/src/tests.rs +++ b/lib-serml/transaction-payment/src/tests.rs @@ -27,13 +27,13 @@ use frame_support::{ }; use mock::{ AccountId, BlockWeights, Call, Currencies, SetheumDEX, ExtBuilder, Origin, Runtime, TransactionPayment, DNAR, ALICE, - SETT, BOB, CHARLIE, DOT, FEE_UNBALANCED_AMOUNT, TIP_UNBALANCED_AMOUNT, + SETR, BOB, CHARLIE, DOT, FEE_UNBALANCED_AMOUNT, TIP_UNBALANCED_AMOUNT, }; use orml_traits::MultiCurrency; use sp_runtime::{testing::TestXt, traits::One}; const CALL: &::Call = - &Call::Currencies(setheum_currencies::Call::transfer(BOB, SETT, 12)); + &Call::Currencies(setheum_currencies::Call::transfer(BOB, SETR, 12)); const CALL2: &::Call = &Call::Currencies(setheum_currencies::Call::transfer_native_currency(BOB, 12)); @@ -56,10 +56,10 @@ fn charges_fee_when_native_is_enough_but_cannot_keep_alive() { assert_ok!(Currencies::update_balance( Origin::root(), ALICE, - SETT, + SETR, fee.unique_saturated_into(), )); - assert_eq!(Currencies::free_balance(SETT, &ALICE), fee); + assert_eq!(Currencies::free_balance(SETR, &ALICE), fee); assert_noop!( ChargeTransactionPayment::::from(0).validate(&ALICE, CALL, &INFO, 23), TransactionValidityError::Invalid(InvalidTransaction::Payment) @@ -82,7 +82,7 @@ fn charges_fee_when_native_is_enough_but_cannot_keep_alive() { .priority, fee2.saturated_into::() ); - assert_eq!(Currencies::free_balance(SETT, &ALICE), Currencies::minimum_balance(DNAR)); + assert_eq!(Currencies::free_balance(SETR, &ALICE), Currencies::minimum_balance(DNAR)); }); } @@ -198,21 +198,21 @@ fn charges_fee_when_validate_and_native_is_not_enough() { .one_hundred_thousand_for_alice_n_charlie() .build() .execute_with(|| { - assert_ok!(>::transfer(SETT, &ALICE, &BOB, 1000)); + assert_ok!(>::transfer(SETR, &ALICE, &BOB, 1000)); assert_eq!(>::free_balance(DNAR, &BOB), 0); - assert_eq!(>::free_balance(SETT, &BOB), 1000); + assert_eq!(>::free_balance(SETR, &BOB), 1000); // add liquidity to DEX assert_ok!(SetheumDEX::add_liquidity( Origin::signed(ALICE), DNAR, - SETT, + SETR, 10000, 1000, 0, false )); - assert_eq!(SetheumDEX::get_liquidity_pool(DNAR, SETT), (10000, 1000)); + assert_eq!(SetheumDEX::get_liquidity_pool(DNAR, SETR), (10000, 1000)); let fee = 500 * 2 + 1000; // len * byte + weight assert_eq!( @@ -224,8 +224,8 @@ fn charges_fee_when_validate_and_native_is_not_enough() { ); assert_eq!(Currencies::free_balance(DNAR, &BOB), Currencies::minimum_balance(DNAR)); - assert_eq!(Currencies::free_balance(SETT, &BOB), 748); - assert_eq!(SetheumDEX::get_liquidity_pool(DNAR, SETT), (10000 - 2000 - 10, 1252)); + assert_eq!(Currencies::free_balance(SETR, &BOB), 748); + assert_eq!(SetheumDEX::get_liquidity_pool(DNAR, SETR), (10000 - 2000 - 10, 1252)); }); } @@ -235,9 +235,9 @@ fn set_default_fee_token_work() { assert_eq!(TransactionPayment::default_fee_currency_id(&ALICE), None); assert_ok!(TransactionPayment::set_default_fee_token( Origin::signed(ALICE), - Some(SETT) + Some(SETR) )); - assert_eq!(TransactionPayment::default_fee_currency_id(&ALICE), Some(SETT)); + assert_eq!(TransactionPayment::default_fee_currency_id(&ALICE), Some(SETR)); assert_ok!(TransactionPayment::set_default_fee_token(Origin::signed(ALICE), None)); assert_eq!(TransactionPayment::default_fee_currency_id(&ALICE), None); }); @@ -253,7 +253,7 @@ fn charge_fee_by_default_fee_token() { assert_ok!(SetheumDEX::add_liquidity( Origin::signed(ALICE), DNAR, - SETT, + SETR, 10000, 1000, 0, @@ -262,14 +262,14 @@ fn charge_fee_by_default_fee_token() { assert_ok!(SetheumDEX::add_liquidity( Origin::signed(ALICE), DOT, - SETT, + SETR, 100, 1000, 0, false )); - assert_eq!(SetheumDEX::get_liquidity_pool(DNAR, SETT), (10000, 1000)); - assert_eq!(SetheumDEX::get_liquidity_pool(DOT, SETT), (100, 1000)); + assert_eq!(SetheumDEX::get_liquidity_pool(DNAR, SETR), (10000, 1000)); + assert_eq!(SetheumDEX::get_liquidity_pool(DOT, SETR), (100, 1000)); assert_ok!(TransactionPayment::set_default_fee_token( Origin::signed(BOB), Some(DOT) @@ -277,7 +277,7 @@ fn charge_fee_by_default_fee_token() { assert_eq!(TransactionPayment::default_fee_currency_id(&BOB), Some(DOT)); assert_ok!(>::transfer(DOT, &ALICE, &BOB, 100)); assert_eq!(>::free_balance(DNAR, &BOB), 0); - assert_eq!(>::free_balance(SETT, &BOB), 0); + assert_eq!(>::free_balance(SETR, &BOB), 0); assert_eq!(>::free_balance(DOT, &BOB), 100); let fee = 500 * 2 + 1000; // len * byte + weight @@ -290,10 +290,10 @@ fn charge_fee_by_default_fee_token() { ); assert_eq!(Currencies::free_balance(DNAR, &BOB), Currencies::minimum_balance(DNAR)); - assert_eq!(Currencies::free_balance(SETT, &BOB), 0); + assert_eq!(Currencies::free_balance(SETR, &BOB), 0); assert_eq!(Currencies::free_balance(DOT, &BOB), 100 - 34); - assert_eq!(SetheumDEX::get_liquidity_pool(DNAR, SETT), (10000 - 2000 - 10, 1252)); - assert_eq!(SetheumDEX::get_liquidity_pool(DOT, SETT), (100 + 34, 1000 - 252)); + assert_eq!(SetheumDEX::get_liquidity_pool(DNAR, SETR), (10000 - 2000 - 10, 1252)); + assert_eq!(SetheumDEX::get_liquidity_pool(DOT, SETR), (100 + 34, 1000 - 252)); }); } diff --git a/node/service/src/chain_spec/newrome.rs b/node/service/src/chain_spec/newrome.rs index 8b5a9bcc8..c78dfa7a8 100644 --- a/node/service/src/chain_spec/newrome.rs +++ b/node/service/src/chain_spec/newrome.rs @@ -237,7 +237,7 @@ fn testnet_genesis( NativeTokenExistentialDeposit, OperatorMembershipSetheumConfig, OrmlNFTConfig, RenVmBridgeConfig, SessionConfig, StakerStatus, StakingConfig, SudoConfig, SystemConfig, TechnicalCommitteeMembershipConfig, TokensConfig, VestingConfig, - DNAR, DRAM, SETT, USDJ, EURJ, JPYJ, GBPJ, AUDJ, CADJ, CHFJ, SEKJ, SGDJ, SARJ RENBTC, + DNAR, DRAM, SETR, USDJ, EURJ, JPYJ, GBPJ, AUDJ, CADJ, CHFJ, SEKJ, SGDJ, SARJ RENBTC, }; #[cfg(feature = "std")] use sp_std::collections::btree_map::BTreeMap; @@ -336,7 +336,7 @@ fn testnet_genesis( endowed_accounts: endowed_accounts .iter() .flat_map(|x| vec![ - (x.clone(), SETT, initial_balance), + (x.clone(), SETR, initial_balance), (x.clone(), USDJ, initial_balance), (x.clone(), EURJ, initial_balance), (x.clone(), JPYJ, initial_balance), @@ -361,18 +361,18 @@ fn testnet_genesis( initial_added_liquidity_pools: vec![( get_account_id_from_seed::("Alice"), vec![ - (TradingPair::new(SETT, DNAR), (1_000_000u128, 2_000_000u128)), - (TradingPair::new(SETT, MENA), (1_000_000u128, 2_000_000u128)), - (TradingPair::new(SETT, USDJ), (1_000_000u128, 1_606_750u128)), - (TradingPair::new(SETT, EURJ), (1_000_000u128, 1_365_737u128)), - (TradingPair::new(SETT, JPYJ), (1_000_000u128, 1_767_103u128)), - (TradingPair::new(SETT, GBPJ), (1_000_000u128, 1_156_860u128)), - (TradingPair::new(SETT, AUDJ), (1_000_000u128, 2_153_045u128)), - (TradingPair::new(SETT, CADJ), (1_000_000u128, 2_008_437u128)), - (TradingPair::new(SETT, CHFJ), (1_000_000u128, 1_462_142u128)), - (TradingPair::new(SETT, SEKJ), (1_000_000u128, 13_850_185u128)), - (TradingPair::new(SETT, SGDJ), (1_000_000u128, 2_169_112u128)), - (TradingPair::new(SETT, SARJ), (1_000_000u128, 6_025_312u128)), + (TradingPair::new(SETR, DNAR), (1_000_000u128, 2_000_000u128)), + (TradingPair::new(SETR, MENA), (1_000_000u128, 2_000_000u128)), + (TradingPair::new(SETR, USDJ), (1_000_000u128, 1_606_750u128)), + (TradingPair::new(SETR, EURJ), (1_000_000u128, 1_365_737u128)), + (TradingPair::new(SETR, JPYJ), (1_000_000u128, 1_767_103u128)), + (TradingPair::new(SETR, GBPJ), (1_000_000u128, 1_156_860u128)), + (TradingPair::new(SETR, AUDJ), (1_000_000u128, 2_153_045u128)), + (TradingPair::new(SETR, CADJ), (1_000_000u128, 2_008_437u128)), + (TradingPair::new(SETR, CHFJ), (1_000_000u128, 1_462_142u128)), + (TradingPair::new(SETR, SEKJ), (1_000_000u128, 13_850_185u128)), + (TradingPair::new(SETR, SGDJ), (1_000_000u128, 2_169_112u128)), + (TradingPair::new(SETR, SARJ), (1_000_000u128, 6_025_312u128)), ], )], }, @@ -404,7 +404,7 @@ fn newrome_genesis( IndicesConfig, NativeTokenExistentialDeposit, OperatorMembershipSetheumConfig, OrmlNFTConfig, SessionConfig, StakerStatus, StakingConfig, SudoConfig, SystemConfig, TechnicalCommitteeMembershipConfig, TokensConfig, VestingConfig, - DNAR, DRAM, SETT, USDJ, EURJ, JPYJ, GBPJ, AUDJ, CADJ, CHFJ, SEKJ, SGDJ, SARJ RENBTC, + DNAR, DRAM, SETR, USDJ, EURJ, JPYJ, GBPJ, AUDJ, CADJ, CHFJ, SEKJ, SGDJ, SARJ RENBTC, }; #[cfg(feature = "std")] use sp_std::collections::btree_map::BTreeMap; @@ -501,7 +501,7 @@ fn newrome_genesis( pallet_treasury: Some(Default::default()), orml_tokens: Some(TokensConfig { endowed_accounts: vec![ - (root_key.clone(), SETT, initial_balance), + (root_key.clone(), SETR, initial_balance), (root_key.clone(), USDJ, initial_balance), (root_key.clone(), EURJ, initial_balance), (root_key.clone(), JPYJ, initial_balance), @@ -536,7 +536,7 @@ fn newrome_genesis( let dnar_airdrop_accounts_json = &include_bytes!("../../../../resources/newrome-airdrop-DNAR.json")[..]; let dnar_airdrop_accounts: Vec<(AccountId, Balance)> = serde_json::from_slice(dnar_airdrop_accounts_json).unwrap(); - let sett_airdrop_accounts_json = &include_bytes!("../../../../resources/newrome-airdrop-SETT.json")[..]; + let sett_airdrop_accounts_json = &include_bytes!("../../../../resources/newrome-airdrop-SETR.json")[..]; let sett_airdrop_accounts: Vec<(AccountId, Balance)> = serde_json::from_slice(sett_airdrop_accounts_json).unwrap(); @@ -546,7 +546,7 @@ fn newrome_genesis( .chain( sett_airdrop_accounts .iter() - .map(|(account_id, sett_amount)| (account_id.clone(), AirDropCurrencyId::SETT, *sett_amount)), + .map(|(account_id, sett_amount)| (account_id.clone(), AirDropCurrencyId::SETR, *sett_amount)), ) .collect::>() }, diff --git a/node/service/src/chain_spec/setheum.rs b/node/service/src/chain_spec/setheum.rs index 98c3d1b27..c9b04e099 100644 --- a/node/service/src/chain_spec/setheum.rs +++ b/node/service/src/chain_spec/setheum.rs @@ -37,7 +37,7 @@ use setheum_runtime::{ NativeTokenExistentialDeposit, OperatorMembershipSetheumConfig, OrmlNFTConfig, RenVmBridgeConfig, SessionConfig, StakerStatus, StakingConfig, SudoConfig, SystemConfig, TechnicalCommitteeMembershipConfig, TokensConfig, VestingConfig, - DNAR, DRAM, SETT, USDJ, EURJ, JPYJ, GBPJ, AUDJ, CADJ, CHFJ, SEKJ, SGDJ, SARJ RENBTC, + DNAR, DRAM, SETR, USDJ, EURJ, JPYJ, GBPJ, AUDJ, CADJ, CHFJ, SEKJ, SGDJ, SARJ RENBTC, }; use runtime_common::TokenInfo; @@ -62,7 +62,7 @@ fn setheum_properties() -> Properties { let mut token_symbol: Vec = vec![]; let mut token_decimals: Vec = vec![]; [ - DNAR, DRAM, SETT, USDJ, EURJ, JPYJ, GBPJ, AUDJ, CADJ, CHFJ, SEKJ, SGDJ, SARJ RENBTC, + DNAR, DRAM, SETR, USDJ, EURJ, JPYJ, GBPJ, AUDJ, CADJ, CHFJ, SEKJ, SGDJ, SARJ RENBTC, ].iter().for_each(|token| { token_symbol.push(token.symbol().unwrap().to_string()); token_decimals.push(token.decimals().unwrap() as u32); @@ -100,7 +100,7 @@ pub fn latest_setheum_config() -> Result { let airdrop_accounts: Vec<(AccountId, Balance)> = serde_json::from_slice(airdrop_accounts_json).unwrap(); let other_allocation_json = &include_bytes!("../../../../resources/setheum-allocation-DNAR.json")[..]; let other_allocation: Vec<(AccountId, Balance)> = serde_json::from_slice(other_allocation_json).unwrap(); - // TODO: Update to add `setheum-allocation-SETT.json` and `setheum-allocation-DRAM.json` too. + // TODO: Update to add `setheum-allocation-SETR.json` and `setheum-allocation-DRAM.json` too. // TODO: Update! // Initial PoA authorities @@ -220,7 +220,7 @@ pub fn latest_setheum_config() -> Result { "total allocation must be equal to 258 million DNAR" ); - // TODO: Update to add `setheum-vesting-SETT.json` and `setheum-vesting-DRAM.json` too. + // TODO: Update to add `setheum-vesting-SETR.json` and `setheum-vesting-DRAM.json` too. let vesting_list_json = &include_bytes!("../../../../resources/setheum-vesting-DNAR.json")[..]; let vesting_list: Vec<(AccountId, BlockNumber, BlockNumber, u32, Balance)> = serde_json::from_slice(vesting_list_json).unwrap(); diff --git a/primitives/src/currency.rs b/primitives/src/currency.rs index 6cbf82fa7..b1c8ecaad 100644 --- a/primitives/src/currency.rs +++ b/primitives/src/currency.rs @@ -129,56 +129,56 @@ macro_rules! create_currency_id { let mut lp_tokens = vec![ Token { - symbol: "LP_DNAR_SETT".to_string(), - address: EvmAddress::try_from(CurrencyId::DexShare(DexShare::Token(DNAR), DexShare::Token(SETT))).unwrap(), + symbol: "LP_DNAR_SETR".to_string(), + address: EvmAddress::try_from(CurrencyId::DexShare(DexShare::Token(DNAR), DexShare::Token(SETR))).unwrap(), }, Token { - symbol: "LP_DRAM_SETT".to_string(), - address: EvmAddress::try_from(CurrencyId::DexShare(DexShare::Token(DRAM), DexShare::Token(SETT))).unwrap(), + symbol: "LP_DRAM_SETR".to_string(), + address: EvmAddress::try_from(CurrencyId::DexShare(DexShare::Token(DRAM), DexShare::Token(SETR))).unwrap(), }, Token { - symbol: "LP_USDJ_SETT".to_string(), - address: EvmAddress::try_from(CurrencyId::DexShare(DexShare::Token(USDJ), DexShare::Token(SETT))).unwrap(), + symbol: "LP_USDJ_SETR".to_string(), + address: EvmAddress::try_from(CurrencyId::DexShare(DexShare::Token(USDJ), DexShare::Token(SETR))).unwrap(), }, Token { - symbol: "LP_EURJ_SETT".to_string(), - address: EvmAddress::try_from(CurrencyId::DexShare(DexShare::Token(EURJ), DexShare::Token(SETT))).unwrap(), + symbol: "LP_EURJ_SETR".to_string(), + address: EvmAddress::try_from(CurrencyId::DexShare(DexShare::Token(EURJ), DexShare::Token(SETR))).unwrap(), }, Token { - symbol: "LP_JPYJ_SETT".to_string(), - address: EvmAddress::try_from(CurrencyId::DexShare(DexShare::Token(JPYJ), DexShare::Token(SETT))).unwrap(), + symbol: "LP_JPYJ_SETR".to_string(), + address: EvmAddress::try_from(CurrencyId::DexShare(DexShare::Token(JPYJ), DexShare::Token(SETR))).unwrap(), }, Token { - symbol: "LP_GBPJ_SETT".to_string(), - address: EvmAddress::try_from(CurrencyId::DexShare(DexShare::Token(GBPJ), DexShare::Token(SETT))).unwrap(), + symbol: "LP_GBPJ_SETR".to_string(), + address: EvmAddress::try_from(CurrencyId::DexShare(DexShare::Token(GBPJ), DexShare::Token(SETR))).unwrap(), }, Token { - symbol: "LP_AUDJ_SETT".to_string(), - address: EvmAddress::try_from(CurrencyId::DexShare(DexShare::Token(AUDJ), DexShare::Token(SETT))).unwrap(), + symbol: "LP_AUDJ_SETR".to_string(), + address: EvmAddress::try_from(CurrencyId::DexShare(DexShare::Token(AUDJ), DexShare::Token(SETR))).unwrap(), }, Token { - symbol: "LP_CADJ_SETT".to_string(), - address: EvmAddress::try_from(CurrencyId::DexShare(DexShare::Token(CADJ), DexShare::Token(SETT))).unwrap(), + symbol: "LP_CADJ_SETR".to_string(), + address: EvmAddress::try_from(CurrencyId::DexShare(DexShare::Token(CADJ), DexShare::Token(SETR))).unwrap(), }, Token { - symbol: "LP_CHFJ_SETT".to_string(), - address: EvmAddress::try_from(CurrencyId::DexShare(DexShare::Token(CHFJ), DexShare::Token(SETT))).unwrap(), + symbol: "LP_CHFJ_SETR".to_string(), + address: EvmAddress::try_from(CurrencyId::DexShare(DexShare::Token(CHFJ), DexShare::Token(SETR))).unwrap(), }, Token { - symbol: "LP_SEKJ_SETT".to_string(), - address: EvmAddress::try_from(CurrencyId::DexShare(DexShare::Token(SEKJ), DexShare::Token(SETT))).unwrap(), + symbol: "LP_SEKJ_SETR".to_string(), + address: EvmAddress::try_from(CurrencyId::DexShare(DexShare::Token(SEKJ), DexShare::Token(SETR))).unwrap(), }, Token { - symbol: "LP_SGDJ_SETT".to_string(), - address: EvmAddress::try_from(CurrencyId::DexShare(DexShare::Token(SGDJ), DexShare::Token(SETT))).unwrap(), + symbol: "LP_SGDJ_SETR".to_string(), + address: EvmAddress::try_from(CurrencyId::DexShare(DexShare::Token(SGDJ), DexShare::Token(SETR))).unwrap(), }, Token { - symbol: "LP_SARJ_SETT".to_string(), - address: EvmAddress::try_from(CurrencyId::DexShare(DexShare::Token(SARJ), DexShare::Token(SETT))).unwrap(), + symbol: "LP_SARJ_SETR".to_string(), + address: EvmAddress::try_from(CurrencyId::DexShare(DexShare::Token(SARJ), DexShare::Token(SETR))).unwrap(), }, Token { - symbol: "LP_RENBTC_SETT".to_string(), - address: EvmAddress::try_from(CurrencyId::DexShare(DexShare::Token(RENBTC), DexShare::Token(SETT))).unwrap(), + symbol: "LP_RENBTC_SETR".to_string(), + address: EvmAddress::try_from(CurrencyId::DexShare(DexShare::Token(RENBTC), DexShare::Token(SETR))).unwrap(), }, ]; tokens.append(&mut lp_tokens); @@ -200,7 +200,7 @@ create_currency_id! { /// Setheum Network DNAR("Setheum Dinar", 12) = 0, DRAM("Setheum Dirham", 12) = 1, - SETT("Setter", 12) = 2, + SETR("Setter", 12) = 2, // SettCurrencies USDJ("Setheum US Dollar", 12) = 3, EURJ("Setheum Euro", 12) = 4, diff --git a/primitives/src/lib.rs b/primitives/src/lib.rs index 8255f937e..6def7d58f 100644 --- a/primitives/src/lib.rs +++ b/primitives/src/lib.rs @@ -101,7 +101,7 @@ pub use sp_runtime::OpaqueExtrinsic as UncheckedExtrinsic; #[derive(Encode, Decode, Eq, PartialEq, Copy, Clone, RuntimeDebug, PartialOrd, Ord)] #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] pub enum AirDropCurrencyId { - SETT = 0, + SETR = 0, DNAR = 1, DRAM = 2, } diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index db5817d92..b7b506657 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -49,7 +49,7 @@ pub use precompile::{ }; pub use primitives::currency::{ TokenInfo, - DNAR, DRAM, SETT, USDJ, EURJ, JPYJ, GBPJ, AUDJ, CADJ, CHFJ, SEKJ, SGDJ, SARJ, RENBTC, + DNAR, DRAM, SETR, USDJ, EURJ, JPYJ, GBPJ, AUDJ, CADJ, CHFJ, SEKJ, SGDJ, SARJ, RENBTC, USD, EUR, JPY, GBP, AUD, CAD, CHF, SEK, SGD, SAR, KWD, JOD, BHD, KYD, OMR, GIP, }; diff --git a/runtime/common/src/precompile/mock.rs b/runtime/common/src/precompile/mock.rs index e43692a43..268550f64 100644 --- a/runtime/common/src/precompile/mock.rs +++ b/runtime/common/src/precompile/mock.rs @@ -150,7 +150,7 @@ impl pallet_balances::Config for Test { // Currencies constants - CurrencyId/TokenSymbol pub const DNAR: CurrencyId = CurrencyId::Token(TokenSymbol::DNAR); pub const DRAM: CurrencyId = CurrencyId::Token(TokenSymbol::DRAM); -pub const SETT: CurrencyId = CurrencyId::Token(TokenSymbol::SETT); +pub const SETR: CurrencyId = CurrencyId::Token(TokenSymbol::SETR); pub const AUDJ: CurrencyId = CurrencyId::Token(TokenSymbol::AUDJ); pub const CADJ: CurrencyId = CurrencyId::Token(TokenSymbol::CADJ); pub const CHFJ: CurrencyId = CurrencyId::Token(TokenSymbol::CHFJ); @@ -241,8 +241,8 @@ impl orml_nft::Config for Test { parameter_types! { pub const TransactionByteFee: Balance = 10; - pub const SetterCurrencyId: CurrencyId = CurrencyId::Token(TokenSymbol::SETT); - pub AllNonNativeCurrencyIds: Vec = vec![CurrencyId::Token(TokenSymbol::SETT)]; + pub const SetterCurrencyId: CurrencyId = CurrencyId::Token(TokenSymbol::SETR); + pub AllNonNativeCurrencyIds: Vec = vec![CurrencyId::Token(TokenSymbol::SETR)]; pub MaxSlippageSwapWithDEX: Ratio = Ratio::one(); } @@ -436,7 +436,7 @@ impl ExchangeRateProvider for MockLiquidStakingExchangeProvider { } parameter_types! { - pub const SetterCurrencyId: CurrencyId = SETT; // Setter currency ticker is SETT. + pub const SetterCurrencyId: CurrencyId = SETR; // Setter currency ticker is SETR. pub const GetSettUSDCurrencyId: CurrencyId = USDJ; // SettUSD currency ticker is USDJ. pub const GetFiatAUDCurrencyId: CurrencyId = AUD; // The AUD Fiat currency denomination. pub const GetFiatCADCurrencyId: CurrencyId = CAD; // The CAD Fiat currency denomination. @@ -450,19 +450,19 @@ parameter_types! { pub const GetFiatUSDCurrencyId: CurrencyId = USD; // The USD Fiat currency denomination. pub FiatUsdFixedPrice: Price = Price::saturating_from_rational(1, 1); - 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 const GetSetterPegOneCurrencyId: CurrencyId = GBP; // Fiat pegs of the Setter (SETR). + pub const GetSetterPegTwoCurrencyId: CurrencyId = EUR; // Fiat pegs of the Setter (SETR). + pub const GetSetterPegThreeCurrencyId: CurrencyId = KWD; // Fiat pegs of the Setter (SETR). + pub const GetSetterPegFourCurrencyId: CurrencyId = JOD; // Fiat pegs of the Setter (SETR). + pub const GetSetterPegFiveCurrencyId: CurrencyId = BHD; // Fiat pegs of the Setter (SETR). + pub const GetSetterPegSixCurrencyId: CurrencyId = KYD; // Fiat pegs of the Setter (SETR). + pub const GetSetterPegSevenCurrencyId: CurrencyId = OMR; // Fiat pegs of the Setter (SETR). + pub const GetSetterPegEightCurrencyId: CurrencyId = CHF; // Fiat pegs of the Setter (SETR). + pub const GetSetterPegNineCurrencyId: CurrencyId = GIP; // Fiat pegs of the Setter (SETR). + pub const GetSetterPegTenCurrencyId: CurrencyId = USD; // Fiat pegs of the Setter (SETR). pub StableCurrencyIds: Vec = vec![ - SETT, AUDJ, CADJ, CHFJ, EURJ, GBPJ, + SETR, AUDJ, CADJ, CHFJ, EURJ, GBPJ, JPYJ, SARJ, SEKJ, SGDJ, USDJ, ]; pub FiatCurrencyIds: Vec = vec![ diff --git a/runtime/common/src/precompile/tests.rs b/runtime/common/src/precompile/tests.rs index bfc2f39f5..33b36c017 100644 --- a/runtime/common/src/precompile/tests.rs +++ b/runtime/common/src/precompile/tests.rs @@ -23,7 +23,7 @@ use crate::precompile::{ dnar_evm_address, alice, alice_evm_addr, usdj_evm_address, bob, bob_evm_addr, erc20_address_not_exists, get_task_id, lp_dnar_usdj_evm_address, new_test_ext, renbtc_evm_address, run_to_block, Balances, DexModule, DexPrecompile, Event as TestEvent, MultiCurrencyPrecompile, Oracle, OraclePrecompile, Origin, Price, - ScheduleCallPrecompile, System, Test, ALICE, USDJ, SETT, INITIAL_BALANCE, RENBTC, + ScheduleCallPrecompile, System, Test, ALICE, USDJ, SETR, INITIAL_BALANCE, RENBTC, }, schedule_call::TaskInfo, }; diff --git a/runtime/newrome/src/benchmarking/dex.rs b/runtime/newrome/src/benchmarking/dex.rs index 759fa7c27..79e3c9665 100644 --- a/runtime/newrome/src/benchmarking/dex.rs +++ b/runtime/newrome/src/benchmarking/dex.rs @@ -23,7 +23,7 @@ use frame_system::RawOrigin; use orml_benchmarking::runtime_benchmarks; use orml_traits::MultiCurrencyExtended; use primitives::{ - currency::{DNAR, SETT}, + currency::{DNAR, SETR}, TradingPair, }; use sp_runtime::traits::UniqueSaturatedInto; @@ -71,25 +71,25 @@ runtime_benchmarks! { // enable a Disabled trading pair enable_trading_pair { - let trading_pair = TradingPair::from_currency_ids(SETT, DNAR).unwrap(); + let trading_pair = TradingPair::from_currency_ids(SETR, DNAR).unwrap(); let _ = Dex::disable_trading_pair(RawOrigin::Root.into(), trading_pair.first(), trading_pair.second()); }: _(RawOrigin::Root, trading_pair.first(), trading_pair.second()) // disable a Enabled trading pair disable_trading_pair { - let trading_pair = TradingPair::from_currency_ids(SETT, DNAR).unwrap(); + let trading_pair = TradingPair::from_currency_ids(SETR, DNAR).unwrap(); let _ = Dex::enable_trading_pair(RawOrigin::Root.into(), trading_pair.first(), trading_pair.second()); }: _(RawOrigin::Root, trading_pair.first(), trading_pair.second()) // list a Provisioning trading pair list_provisioning { - let trading_pair = TradingPair::from_currency_ids(SETT, DNAR).unwrap(); + let trading_pair = TradingPair::from_currency_ids(SETR, DNAR).unwrap(); let _ = Dex::disable_trading_pair(RawOrigin::Root.into(), trading_pair.first(), trading_pair.second()); }: _(RawOrigin::Root, trading_pair.first(), trading_pair.second(), dollar(trading_pair.first()), dollar(trading_pair.second()), dollar(trading_pair.first()), dollar(trading_pair.second()), 10) // update parameters of a Provisioning trading pair update_provisioning_parameters { - let trading_pair = TradingPair::from_currency_ids(SETT, DNAR).unwrap(); + let trading_pair = TradingPair::from_currency_ids(SETR, DNAR).unwrap(); let _ = Dex::disable_trading_pair(RawOrigin::Root.into(), trading_pair.first(), trading_pair.second()); Dex::list_provisioning( RawOrigin::Root.into(), @@ -106,7 +106,7 @@ runtime_benchmarks! { // end a Provisioning trading pair end_provisioning { let founder: AccountId = whitelisted_caller(); - let trading_pair = TradingPair::from_currency_ids(SETT, DNAR).unwrap(); + let trading_pair = TradingPair::from_currency_ids(SETR, DNAR).unwrap(); let _ = Dex::disable_trading_pair(RawOrigin::Root.into(), trading_pair.first(), trading_pair.second()); Dex::list_provisioning( RawOrigin::Root.into(), @@ -135,7 +135,7 @@ runtime_benchmarks! { add_provision { let founder: AccountId = whitelisted_caller(); - let trading_pair = TradingPair::from_currency_ids(SETT, DNAR).unwrap(); + let trading_pair = TradingPair::from_currency_ids(SETR, DNAR).unwrap(); let _ = Dex::disable_trading_pair(RawOrigin::Root.into(), trading_pair.first(), trading_pair.second()); Dex::list_provisioning( RawOrigin::Root.into(), @@ -155,7 +155,7 @@ runtime_benchmarks! { claim_dex_share { let founder: AccountId = whitelisted_caller(); - let trading_pair = TradingPair::from_currency_ids(SETT, DNAR).unwrap(); + let trading_pair = TradingPair::from_currency_ids(SETR, DNAR).unwrap(); let _ = Dex::disable_trading_pair(RawOrigin::Root.into(), trading_pair.first(), trading_pair.second()); Dex::list_provisioning( RawOrigin::Root.into(), @@ -190,7 +190,7 @@ runtime_benchmarks! { add_liquidity { let first_maker: AccountId = account("first_maker", 0, SEED); let second_maker: AccountId = whitelisted_caller(); - let trading_pair = TradingPair::from_currency_ids(SETT, DNAR).unwrap(); + let trading_pair = TradingPair::from_currency_ids(SETR, DNAR).unwrap(); let amount_a = 100 * dollar(trading_pair.first()); let amount_b = 10_000 * dollar(trading_pair.second()); @@ -206,7 +206,7 @@ runtime_benchmarks! { add_liquidity_and_stake { let first_maker: AccountId = account("first_maker", 0, SEED); let second_maker: AccountId = whitelisted_caller(); - let trading_pair = TradingPair::from_currency_ids(SETT, DNAR).unwrap(); + let trading_pair = TradingPair::from_currency_ids(SETR, DNAR).unwrap(); let amount_a = 100 * dollar(trading_pair.first()); let amount_b = 10_000 * dollar(trading_pair.second()); @@ -221,21 +221,21 @@ runtime_benchmarks! { // remove liquidity by liquid lp share remove_liquidity { let maker: AccountId = whitelisted_caller(); - let trading_pair = TradingPair::from_currency_ids(SETT, DNAR).unwrap(); + let trading_pair = TradingPair::from_currency_ids(SETR, DNAR).unwrap(); inject_liquidity(maker.clone(), trading_pair.first(), trading_pair.second(), 100 * dollar(trading_pair.first()), 10_000 * dollar(trading_pair.second()), false)?; }: remove_liquidity(RawOrigin::Signed(maker), trading_pair.first(), trading_pair.second(), 50 * dollar(trading_pair.first()), Default::default(), Default::default(), false) // remove liquidity by withdraw staking lp share remove_liquidity_by_unstake { let maker: AccountId = whitelisted_caller(); - let trading_pair = TradingPair::from_currency_ids(SETT, DNAR).unwrap(); + let trading_pair = TradingPair::from_currency_ids(SETR, DNAR).unwrap(); inject_liquidity(maker.clone(), trading_pair.first(), trading_pair.second(), 100 * dollar(trading_pair.first()), 10_000 * dollar(trading_pair.second()), true)?; }: remove_liquidity(RawOrigin::Signed(maker), trading_pair.first(), trading_pair.second(), 50 * dollar(trading_pair.first()), Default::default(), Default::default(), true) swap_with_exact_supply { let u in 2 .. TradingPathLimit::get() as u32; - let trading_pair = TradingPair::from_currency_ids(SETT, DNAR).unwrap(); + let trading_pair = TradingPair::from_currency_ids(SETR, DNAR).unwrap(); let mut path: Vec = vec![]; for i in 1 .. u { if i == 1 { @@ -260,7 +260,7 @@ runtime_benchmarks! { swap_with_exact_target { let u in 2 .. TradingPathLimit::get() as u32; - let trading_pair = TradingPair::from_currency_ids(SETT, DNAR).unwrap(); + let trading_pair = TradingPair::from_currency_ids(SETR, DNAR).unwrap(); let mut path: Vec = vec![]; for i in 1 .. u { if i == 1 { diff --git a/runtime/newrome/src/benchmarking/prices.rs b/runtime/newrome/src/benchmarking/prices.rs index 61e6cdb3f..4205f6417 100644 --- a/runtime/newrome/src/benchmarking/prices.rs +++ b/runtime/newrome/src/benchmarking/prices.rs @@ -16,7 +16,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -use crate::{SetheumOracle, StandardCurrencyIds, CurrencyId, Origin, Price, Prices, Runtime, SETT}; +use crate::{SetheumOracle, StandardCurrencyIds, CurrencyId, Origin, Price, Prices, Runtime, SETR}; use frame_system::RawOrigin; use orml_benchmarking::runtime_benchmarks; @@ -33,15 +33,15 @@ runtime_benchmarks! { // feed price SetheumOracle::feed_values(RawOrigin::Root.into(), vec![(currency_id, Price::one())])?; - }: _(RawOrigin::Root, SETT) + }: _(RawOrigin::Root, SETR) unlock_price { let currency_id: CurrencyId = StandardCurrencyIds::get()[0]; // feed price SetheumOracle::feed_values(RawOrigin::Root.into(), vec![(currency_id, Price::one())])?; - Prices::lock_price(Origin::root(), SETT)?; - }: _(RawOrigin::Root, SETT) + Prices::lock_price(Origin::root(), SETR)?; + }: _(RawOrigin::Root, SETR) } #[cfg(test)] diff --git a/runtime/newrome/src/benchmarking/settmint_manager.rs b/runtime/newrome/src/benchmarking/settmint_manager.rs index ec738e488..58e662a3a 100644 --- a/runtime/newrome/src/benchmarking/settmint_manager.rs +++ b/runtime/newrome/src/benchmarking/settmint_manager.rs @@ -18,7 +18,7 @@ use crate::{ dollar, SetheumOracle, AccountId, Amount, SettmintEngine, StandardCurrencyIds, CurrencyId, SettmintGateway, Indices, Price, Rate, - Ratio, Runtime, USDJ, SETT, + Ratio, Runtime, USDJ, SETR, }; use super::utils::set_balance; @@ -44,7 +44,7 @@ runtime_benchmarks! { let caller: AccountId = account("caller", 0, SEED); let to: AccountId = account("to", 0, SEED); let to_lookup = Indices::unlookup(to); - }: _(RawOrigin::Signed(caller), SETT, to_lookup) + }: _(RawOrigin::Signed(caller), SETR, to_lookup) unauthorize { let caller: AccountId = account("caller", 0, SEED); @@ -52,10 +52,10 @@ runtime_benchmarks! { let to_lookup = Indices::unlookup(to); SettmintGateway::authorize( RawOrigin::Signed(caller.clone()).into(), - SETT, + SETR, to_lookup.clone() )?; - }: _(RawOrigin::Signed(caller), SETT, to_lookup) + }: _(RawOrigin::Signed(caller), SETR, to_lookup) unauthorize_all { let c in 0 .. StandardCurrencyIds::get().len().saturating_sub(1) as u32; diff --git a/runtime/newrome/src/lib.rs b/runtime/newrome/src/lib.rs index 332d4b5a5..b0982986d 100644 --- a/runtime/newrome/src/lib.rs +++ b/runtime/newrome/src/lib.rs @@ -108,7 +108,7 @@ pub use runtime_common::{ cent, deposit, dollar, microcent, millicent, BlockLength, BlockWeights, ExchangeRate, GasToWeight, OffchainSolutionWeightLimit, Price, Rate, Ratio, RuntimeBlockLength, RuntimeBlockWeights,SystemContractsFilter, TimeStampedPrice, - DNAR, DRAM, SETT, USDJ, EURJ, JPYJ, GBPJ, AUDJ, CADJ, CHFJ, SEKJ, SGDJ, SARJ RENBTC, + DNAR, DRAM, SETR, USDJ, EURJ, JPYJ, GBPJ, AUDJ, CADJ, CHFJ, SEKJ, SGDJ, SARJ RENBTC, USD, EUR, JPY, GBP, AUD, CAD, CHF, SEK, SGD, SAR, KWD, JOD, BHD, KYD, OMR, GIP }; mod authority; @@ -950,7 +950,7 @@ parameter_types! { pub const FastTrackVotingPeriod: BlockNumber = 3 * HOURS; pub MinimumDeposit: Balance = 100 * dollar(); pub GoldenMinimumDepositMultiple: u32 = 1; // 1x of the `MinimumDeposit` is minimum deposit for DNAR (1). - pub SetterMinimumDepositMultiple: u32 = 2; // 2x of the `MinimumDeposit` is minimum deposit for SETT (2). + pub SetterMinimumDepositMultiple: u32 = 2; // 2x of the `MinimumDeposit` is minimum deposit for SETR (2). pub SilverMinimumDepositMultiple: u32 = 3; // 3x of the `MinimumDeposit` is minimum deposit for DRAM (3). pub const EnactmentPeriod: BlockNumber = 28 * DAYS; pub const CooloffPeriod: BlockNumber = 7 * DAYS; @@ -958,12 +958,12 @@ parameter_types! { pub const MaxProposals: u32 = 100; pub PreimageByteDeposit: Balance = cent(DNAR); pub const InstantAllowed: bool = true; - pub const GovernanceCurrencyIds: Vec = vec![DNAR, SETT, DRAM]; + pub const GovernanceCurrencyIds: Vec = vec![DNAR, SETR, DRAM]; } parameter_types! { pub const GetNativeCurrencyId: CurrencyId = DNAR; - pub const SetterCurrencyId: CurrencyId = SETT; + pub const SetterCurrencyId: CurrencyId = SETR; pub const DirhamCurrencyId: CurrencyId = DRAM; pub const GetSettUSDCurrencyId: CurrencyId = USDJ; pub const GetFiatAUDCurrencyId: CurrencyId = AUD; @@ -1080,7 +1080,7 @@ parameter_type_with_key! { TokenSymbol::DNAR => Balance::max_value(), // unsupported TokenSymbol::DRAM => Balance::max_value(*currency_id), // unsupported - TokenSymbol::SETT => cent(*currency_id), + TokenSymbol::SETR => cent(*currency_id), TokenSymbol::USDJ => cent(*currency_id), TokenSymbol::EURJ => cent(*currency_id), TokenSymbol::JPYJ => cent(*currency_id), @@ -1127,19 +1127,19 @@ impl orml_tokens::Config for Runtime { parameter_types! { pub FiatUsdFixedPrice: Price = Price::saturating_from_rational(1, 1); - 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 const GetSetterPegOneCurrencyId: CurrencyId = GBP; // Fiat pegs of the Setter (SETR). + pub const GetSetterPegTwoCurrencyId: CurrencyId = EUR; // Fiat pegs of the Setter (SETR). + pub const GetSetterPegThreeCurrencyId: CurrencyId = KWD; // Fiat pegs of the Setter (SETR). + pub const GetSetterPegFourCurrencyId: CurrencyId = JOD; // Fiat pegs of the Setter (SETR). + pub const GetSetterPegFiveCurrencyId: CurrencyId = BHD; // Fiat pegs of the Setter (SETR). + pub const GetSetterPegSixCurrencyId: CurrencyId = KYD; // Fiat pegs of the Setter (SETR). + pub const GetSetterPegSevenCurrencyId: CurrencyId = OMR; // Fiat pegs of the Setter (SETR). + pub const GetSetterPegEightCurrencyId: CurrencyId = CHF; // Fiat pegs of the Setter (SETR). + pub const GetSetterPegNineCurrencyId: CurrencyId = GIP; // Fiat pegs of the Setter (SETR). + pub const GetSetterPegTenCurrencyId: CurrencyId = USD; // Fiat pegs of the Setter (SETR). pub StableCurrencyIds: Vec = vec![ - SETT, USDJ, EURJ, JPYJ, GBPJ, AUDJ, CADJ, CHFJ, SEKJ, SGDJ, SARJ + SETR, USDJ, EURJ, JPYJ, GBPJ, AUDJ, CADJ, CHFJ, SEKJ, SGDJ, SARJ ]; pub FiatCurrencyIds: Vec = vec![ USD, EUR, JPY, GBP, AUD, CAD, CHF, SEK, SGD, SAR, KWD, JOD, BHD, KYD, OMR, GIP @@ -1255,7 +1255,7 @@ parameter_types! { pub StandardCurrencyIds: Vec = vec![ USDJ, EURJ, JPYJ, GBPJ, AUDJ, CADJ, CHFJ, SEKJ, SGDJ, SARJ ]; - pub const GetReserveCurrencyId: CurrencyId = SETT; + pub const GetReserveCurrencyId: CurrencyId = SETR; } impl settmint_manager::Config for Runtime { type Event = Event; @@ -1327,9 +1327,9 @@ where } parameter_types! { - pub GetReserveCurrencyId: CurrencyId = SETT; + pub GetReserveCurrencyId: CurrencyId = SETR; pub DefaultStandardExchangeRate: ExchangeRate = ExchangeRate::saturating_from_rational(1, 10); - pub MinimumStandardValue: Balance = dollar(SETT); + pub MinimumStandardValue: Balance = dollar(SETR); } impl settmint_engine::Config for Runtime { @@ -1356,21 +1356,21 @@ parameter_types! { pub const GetExchangeFee: (u32, u32) = (1, 1000); // 0.1% pub const TradingPathLimit: u32 = 3; pub EnabledTradingPairs: Vec = vec![ - TradingPair::new(SETT, DNAR), - TradingPair::new(SETT, DRAM), - - TradingPair::new(SETT, USDJ), - TradingPair::new(SETT, EURJ), - TradingPair::new(SETT, JPYJ), - TradingPair::new(SETT, GBPJ), - TradingPair::new(SETT, AUDJ), - TradingPair::new(SETT, CADJ), - TradingPair::new(SETT, CHFJ), - TradingPair::new(SETT, SGDJ), - TradingPair::new(SETT, SEKJ), - TradingPair::new(SETT, SARJ), + TradingPair::new(SETR, DNAR), + TradingPair::new(SETR, DRAM), + + TradingPair::new(SETR, USDJ), + TradingPair::new(SETR, EURJ), + TradingPair::new(SETR, JPYJ), + TradingPair::new(SETR, GBPJ), + TradingPair::new(SETR, AUDJ), + TradingPair::new(SETR, CADJ), + TradingPair::new(SETR, CHFJ), + TradingPair::new(SETR, SGDJ), + TradingPair::new(SETR, SEKJ), + TradingPair::new(SETR, SARJ), - TradingPair::new(SETT, RENBTC), + TradingPair::new(SETR, RENBTC), ]; } @@ -1397,7 +1397,7 @@ parameter_types! { parameter_type_with_key! { pub GetStableCurrencyMinimumSupply: |currency_id: CurrencyId| -> Balance { match currency_id { - &SETT => 10_000, + &SETR => 10_000, &USDJ => 10_000, &EURJ => 10_000, &JPYJ => 10_000, @@ -1414,10 +1414,10 @@ parameter_type_with_key! { } pub RewardableCurrencyIds: Vec = vec![ - DNAR, DRAM, SETT, USDJ, EURJ, JPYJ, GBPJ, AUDJ, CADJ, CHFJ, SEKJ, SGDJ, SARJ + DNAR, DRAM, SETR, USDJ, EURJ, JPYJ, GBPJ, AUDJ, CADJ, CHFJ, SEKJ, SGDJ, SARJ ]; pub NonStableDropCurrencyIds: Vec = vec![DNAR, DRAM]; -pub SettCurrencyDropCurrencyIds: Vec = vec![ +pub SetCurrencyDropCurrencyIds: Vec = vec![ USDJ, EURJ, JPYJ, GBPJ, AUDJ, CADJ, CHFJ, SEKJ, SGDJ, SARJ ]; @@ -1426,7 +1426,7 @@ parameter_type_with_key! { match currency_id { &DNAR => 1, &DRAM => 1, - &SETT => 1, + &SETR => 1, &USDJ => 1, &EURJ => 1, &JPYJ => 100, @@ -1461,7 +1461,7 @@ impl serp_treasury::Config for Runtime { type PriceSource = SerpPrices; type RewardableCurrencyIds = RewardableCurrencyIds; type NonStableDropCurrencyIds = NonStableDropCurrencyIds; - type SettCurrencyDropCurrencyIds = SettCurrencyDropCurrencyIds; + type SetCurrencyDropCurrencyIds = SetCurrencyDropCurrencyIds; type MinimumClaimableTransferAmounts = MinimumClaimableTransferAmounts; type PalletId = SerpTreasuryPalletId; type WeightInfo = weights::serp_treasury::WeightInfo; @@ -1470,7 +1470,7 @@ impl serp_treasury::Config for Runtime { parameter_types! { // All currency types except for native currency, Sort by fee charge order pub AllNonNativeCurrencyIds: Vec = vec![ - DRAM, SETT, USDJ, EURJ, JPYJ, GBPJ, AUDJ, CADJ, CHFJ, SEKJ, SGDJ, SARJ, RENBTC + DRAM, SETR, USDJ, EURJ, JPYJ, GBPJ, AUDJ, CADJ, CHFJ, SEKJ, SGDJ, SARJ, RENBTC ]; } diff --git a/runtime/setheum/src/lib.rs b/runtime/setheum/src/lib.rs index 2216c53ea..aaaad967f 100644 --- a/runtime/setheum/src/lib.rs +++ b/runtime/setheum/src/lib.rs @@ -108,7 +108,7 @@ pub use runtime_common::{ cent, deposit, dollar, microcent, millicent, BlockLength, BlockWeights, ExchangeRate, GasToWeight, OffchainSolutionWeightLimit, Price, Rate, Ratio, RuntimeBlockLength, RuntimeBlockWeights,SystemContractsFilter, TimeStampedPrice, - DNAR, DRAM, SETT, USDJ, EURJ, JPYJ, GBPJ, AUDJ, CADJ, CHFJ, SEKJ, SGDJ, SARJ RENBTC, + DNAR, DRAM, SETR, USDJ, EURJ, JPYJ, GBPJ, AUDJ, CADJ, CHFJ, SEKJ, SGDJ, SARJ RENBTC, USD, EUR, JPY, GBP, AUD, CAD, CHF, SEK, SGD, SAR, KWD, JOD, BHD, KYD, OMR, GIP }; mod authority; @@ -949,7 +949,7 @@ parameter_types! { pub const FastTrackVotingPeriod: BlockNumber = 3 * HOURS; pub MinimumDeposit: Balance = 100 * dollar(); pub GoldenMinimumDepositMultiple: u32 = 1; // 1x of the `MinimumDeposit` is minimum deposit for DNAR (1). - pub SetterMinimumDepositMultiple: u32 = 2; // 2x of the `MinimumDeposit` is minimum deposit for SETT (2). + pub SetterMinimumDepositMultiple: u32 = 2; // 2x of the `MinimumDeposit` is minimum deposit for SETR (2). pub SilverMinimumDepositMultiple: u32 = 3; // 3x of the `MinimumDeposit` is minimum deposit for DRAM (3). pub const EnactmentPeriod: BlockNumber = 28 * DAYS; pub const CooloffPeriod: BlockNumber = 7 * DAYS; @@ -957,12 +957,12 @@ parameter_types! { pub const MaxProposals: u32 = 100; pub PreimageByteDeposit: Balance = cent(DNAR); pub const InstantAllowed: bool = true; - pub const GovernanceCurrencyIds: Vec = vec![DNAR, SETT, DRAM]; + pub const GovernanceCurrencyIds: Vec = vec![DNAR, SETR, DRAM]; } parameter_types! { pub const GetNativeCurrencyId: CurrencyId = DNAR; - pub const SetterCurrencyId: CurrencyId = SETT; + pub const SetterCurrencyId: CurrencyId = SETR; pub const DirhamCurrencyId: CurrencyId = DRAM; pub const GetSettUSDCurrencyId: CurrencyId = USDJ; pub const GetFiatAUDCurrencyId: CurrencyId = AUD; @@ -1077,7 +1077,7 @@ parameter_type_with_key! { TokenSymbol::DNAR => Balance::max_value(), // unsupported TokenSymbol::DRAM => Balance::max_value(*currency_id), // unsupported - TokenSymbol::SETT => cent(*currency_id), + TokenSymbol::SETR => cent(*currency_id), TokenSymbol::USDJ => cent(*currency_id), TokenSymbol::EURJ => cent(*currency_id), TokenSymbol::JPYJ => cent(*currency_id), @@ -1124,19 +1124,19 @@ impl orml_tokens::Config for Runtime { parameter_types! { pub FiatUsdFixedPrice: Price = Price::saturating_from_rational(1, 1); - 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 const GetSetterPegOneCurrencyId: CurrencyId = GBP; // Fiat pegs of the Setter (SETR). + pub const GetSetterPegTwoCurrencyId: CurrencyId = EUR; // Fiat pegs of the Setter (SETR). + pub const GetSetterPegThreeCurrencyId: CurrencyId = KWD; // Fiat pegs of the Setter (SETR). + pub const GetSetterPegFourCurrencyId: CurrencyId = JOD; // Fiat pegs of the Setter (SETR). + pub const GetSetterPegFiveCurrencyId: CurrencyId = BHD; // Fiat pegs of the Setter (SETR). + pub const GetSetterPegSixCurrencyId: CurrencyId = KYD; // Fiat pegs of the Setter (SETR). + pub const GetSetterPegSevenCurrencyId: CurrencyId = OMR; // Fiat pegs of the Setter (SETR). + pub const GetSetterPegEightCurrencyId: CurrencyId = CHF; // Fiat pegs of the Setter (SETR). + pub const GetSetterPegNineCurrencyId: CurrencyId = GIP; // Fiat pegs of the Setter (SETR). + pub const GetSetterPegTenCurrencyId: CurrencyId = USD; // Fiat pegs of the Setter (SETR). pub StableCurrencyIds: Vec = vec![ - SETT, USDJ, EURJ, JPYJ, GBPJ, AUDJ, CADJ, CHFJ, SEKJ, SGDJ, SARJ + SETR, USDJ, EURJ, JPYJ, GBPJ, AUDJ, CADJ, CHFJ, SEKJ, SGDJ, SARJ ]; pub FiatCurrencyIds: Vec = vec![ USD, EUR, JPY, GBP, AUD, CAD, CHF, SEK, SGD, SAR, KWD, JOD, BHD, KYD, OMR, GIP @@ -1252,7 +1252,7 @@ parameter_types! { pub StandardCurrencyIds: Vec = vec![ USDJ, EURJ, JPYJ, GBPJ, AUDJ, CADJ, CHFJ, SEKJ, SGDJ, SARJ ]; - pub const GetReserveCurrencyId: CurrencyId = SETT; + pub const GetReserveCurrencyId: CurrencyId = SETR; } impl settmint_manager::Config for Runtime { type Event = Event; @@ -1324,9 +1324,9 @@ where } parameter_types! { - pub GetReserveCurrencyId: CurrencyId = SETT; + pub GetReserveCurrencyId: CurrencyId = SETR; pub DefaultStandardExchangeRate: ExchangeRate = ExchangeRate::saturating_from_rational(1, 10); - pub MinimumStandardValue: Balance = dollar(SETT); + pub MinimumStandardValue: Balance = dollar(SETR); } impl settmint_engine::Config for Runtime { @@ -1352,21 +1352,21 @@ impl settmint_gateway::Config for Runtime { parameter_types! { pub const TradingPathLimit: u32 = 3; pub EnabledTradingPairs: Vec = vec![ - TradingPair::new(SETT, DNAR), - TradingPair::new(SETT, DRAM), - - TradingPair::new(SETT, USDJ), - TradingPair::new(SETT, EURJ), - TradingPair::new(SETT, JPYJ), - TradingPair::new(SETT, GBPJ), - TradingPair::new(SETT, AUDJ), - TradingPair::new(SETT, CADJ), - TradingPair::new(SETT, CHFJ), - TradingPair::new(SETT, SEKJ), - TradingPair::new(SETT, SGDJ), - TradingPair::new(SETT, SARJ), + TradingPair::new(SETR, DNAR), + TradingPair::new(SETR, DRAM), + + TradingPair::new(SETR, USDJ), + TradingPair::new(SETR, EURJ), + TradingPair::new(SETR, JPYJ), + TradingPair::new(SETR, GBPJ), + TradingPair::new(SETR, AUDJ), + TradingPair::new(SETR, CADJ), + TradingPair::new(SETR, CHFJ), + TradingPair::new(SETR, SEKJ), + TradingPair::new(SETR, SGDJ), + TradingPair::new(SETR, SARJ), - TradingPair::new(SETT, RENBTC), + TradingPair::new(SETR, RENBTC), ]; } @@ -1393,7 +1393,7 @@ parameter_types! { parameter_type_with_key! { pub GetStableCurrencyMinimumSupply: |currency_id: CurrencyId| -> Balance { match currency_id { - &SETT => 10_000, + &SETR => 10_000, &USDJ => 10_000, &EURJ => 10_000, &JPYJ => 10_000, @@ -1410,10 +1410,10 @@ parameter_type_with_key! { } pub RewardableCurrencyIds: Vec = vec![ - DNAR, DRAM, SETT, USDJ, EURJ, JPYJ, GBPJ, AUDJ, CADJ, CHFJ, SEKJ, SGDJ, SARJ + DNAR, DRAM, SETR, USDJ, EURJ, JPYJ, GBPJ, AUDJ, CADJ, CHFJ, SEKJ, SGDJ, SARJ ]; pub NonStableDropCurrencyIds: Vec = vec![DNAR, DRAM]; -pub SettCurrencyDropCurrencyIds: Vec = vec![ +pub SetCurrencyDropCurrencyIds: Vec = vec![ USDJ, EURJ, JPYJ, GBPJ, AUDJ, CADJ, CHFJ, SEKJ, SGDJ, SARJ ]; @@ -1422,7 +1422,7 @@ parameter_type_with_key! { match currency_id { &DNAR => 1, &DRAM => 1, - &SETT => 1, + &SETR => 1, &USDJ => 1, &EURJ => 1, &JPYJ => 100, @@ -1457,7 +1457,7 @@ impl serp_treasury::Config for Runtime { type PriceSource = SerpPrices; type RewardableCurrencyIds = RewardableCurrencyIds; type NonStableDropCurrencyIds = NonStableDropCurrencyIds; - type SettCurrencyDropCurrencyIds = SettCurrencyDropCurrencyIds; + type SetCurrencyDropCurrencyIds = SetCurrencyDropCurrencyIds; type MinimumClaimableTransferAmounts = MinimumClaimableTransferAmounts; type PalletId = SerpTreasuryPalletId; type WeightInfo = weights::serp_treasury::WeightInfo; @@ -1466,7 +1466,7 @@ impl serp_treasury::Config for Runtime { parameter_types! { // All currency types except for native currency, Sort by fee charge order pub AllNonNativeCurrencyIds: Vec = vec![ - DRAM, SETT, USDJ, EURJ, JPYJ, GBPJ, AUDJ, CADJ, CHFJ, SEKJ, SGDJ, SARJ, RENBTC + DRAM, SETR, USDJ, EURJ, JPYJ, GBPJ, AUDJ, CADJ, CHFJ, SEKJ, SGDJ, SARJ, RENBTC ]; }